From 343801e8b2e7175e2cafa25a2e6213412509c963 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hu=C3=A1ng=20J=C3=B9nli=C3=A0ng?= Date: Mon, 23 Mar 2020 17:19:10 -0400 Subject: [PATCH 1/2] chore: compact loc information in parser fixtures --- .../babel-parser/test/helpers/runFixtureTests.js | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/packages/babel-parser/test/helpers/runFixtureTests.js b/packages/babel-parser/test/helpers/runFixtureTests.js index b84cba4a5967..9c21aa351e22 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)), ); } From a93d80b4ee4fbfe02355c66e1b4db9f7e6da38a9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hu=C3=A1ng=20J=C3=B9nli=C3=A0ng?= Date: Mon, 23 Mar 2020 17:19:52 -0400 Subject: [PATCH 2/2] chore: update test fixtures --- .../output.json | 548 +- .../array-pattern-trailing-comma/output.json | 196 +- .../basic/block-trailing-comment/output.json | 105 +- .../output.json | 197 +- .../comment-within-condition/output.json | 118 +- .../output.json | 299 +- .../output.json | 157 +- .../output.json | 186 +- .../basic/function-trailing-comma/output.json | 146 +- .../output.json | 223 +- .../output.json | 303 +- .../surrounding-call-comments/output.json | 158 +- .../surrounding-debugger-comments/output.json | 131 +- .../surrounding-return-comments/output.json | 131 +- .../surrounding-throw-comments/output.json | 144 +- .../output.json | 210 +- .../output.json | 264 +- .../switch-fallthrough-comment/output.json | 210 +- .../output.json | 185 +- .../output.json | 224 +- .../output.json | 211 +- .../output.json | 507 +- .../switch-no-default-comment/output.json | 118 +- .../comments/html/first-line/output.json | 78 +- .../interpreter-directive-import/output.json | 106 +- .../interpreter-directive-object/output.json | 133 +- .../comments/regression/10230/output.json | 211 +- .../comments/regression/10432/output.json | 332 +- .../comments/regression/10448/output.json | 145 +- .../comments/regression/10892/output.json | 158 +- .../core/categorized/01-regex/output.json | 159 +- .../core/categorized/02-regex/output.json | 132 +- .../core/categorized/03-regex/output.json | 171 +- .../core/categorized/04-regex/output.json | 145 +- .../core/categorized/05-regex/output.json | 132 +- .../core/categorized/06-regex/output.json | 145 +- .../core/categorized/07-regex/output.json | 92 +- .../identifier-name-loc/output.json | 80 +- .../invalid-assignment-pattern-1/output.json | 106 +- .../invalid-assignment-pattern-2/output.json | 119 +- .../invalid-assignment-pattern-3/output.json | 172 +- .../invalid-assignment-pattern-4/output.json | 185 +- .../invalid-assignment-pattern-5/output.json | 106 +- .../invalid-fn-decl-inside-loop/output.json | 92 +- .../output.json | 146 +- .../categorized/label-kind-switch/output.json | 93 +- .../categorized/not-directive/output.json | 2929 +--------- .../categorized/regex-after-block/output.json | 91 +- .../startline-specified/output.json | 132 +- .../valid-assignment-pattern-1/output.json | 120 +- .../valid-assignment-pattern-2/output.json | 93 +- .../valid-assignment-pattern-3/output.json | 93 +- .../output.json | 198 +- .../output.json | 185 +- .../output.json | 132 +- .../output.json | 119 +- .../output.json | 105 +- .../output.json | 172 +- .../output.json | 105 +- .../output.json | 132 +- .../output.json | 106 +- .../output.json | 119 +- .../output.json | 133 +- .../output.json | 65 +- .../core/escape-keyword/async/output.json | 66 +- .../core/escape-keyword/invalid/output.json | 120 +- .../used-as-property/output.json | 119 +- .../non-octal-eight/output.json | 65 +- .../non-octal-nine/output.json | 65 +- .../output.json | 213 +- .../output.json | 212 +- .../valid-property-initializer/output.json | 319 +- .../output.json | 106 +- .../opts/allowUndeclaredExports/output.json | 80 +- .../core/opts/ranges-false/output.json | 159 +- .../core/opts/ranges-true/output.json | 159 +- .../core/opts/tokens-false/output.json | 159 +- .../core/opts/tokens-true/output.json | 328 +- .../fixtures/core/regression/2591/output.json | 132 +- .../fixtures/core/regression/9374/output.json | 119 +- .../output.json | 656 +-- .../output.json | 260 +- .../non-octal-float-strict-mode/output.json | 52 +- .../regression/non-octal-float/output.json | 52 +- .../use-strict-with-pre-semi/output.json | 197 +- .../dupl-bind-2nd-lvl-lex-nested/output.json | 185 +- .../scope/dupl-bind-2nd-lvl-lex/output.json | 172 +- .../dupl-bind-2nd-lvl-var-nested/output.json | 185 +- .../scope/dupl-bind-2nd-lvl-var/output.json | 172 +- .../dupl-bind-catch-arr-destr/output.json | 119 +- .../scope/dupl-bind-catch-dbl-let/output.json | 172 +- .../scope/dupl-bind-catch-func/output.json | 132 +- .../dupl-bind-catch-hang-func/output.json | 158 +- .../dupl-bind-catch-let-outside/output.json | 132 +- .../scope/dupl-bind-catch-let/output.json | 132 +- .../dupl-bind-catch-obj-destr/output.json | 226 +- .../dupl-bind-catch-var-arr-destr/output.json | 145 +- .../dupl-bind-catch-var-nested/output.json | 198 +- .../dupl-bind-catch-var-obj-destr/output.json | 172 +- .../dupl-bind-catch-var-outside/output.json | 132 +- .../scope/dupl-bind-catch-var/output.json | 132 +- .../scope/dupl-bind-class-class/output.json | 132 +- .../scope/dupl-bind-class-const/output.json | 132 +- .../scope/dupl-bind-class-func/output.json | 132 +- .../scope/dupl-bind-class-let/output.json | 132 +- .../scope/dupl-bind-class-var/output.json | 119 +- .../scope/dupl-bind-const-const/output.json | 119 +- .../core/scope/dupl-bind-func-gen/output.json | 119 +- .../dupl-bind-func-module-sloppy/output.json | 119 +- .../scope/dupl-bind-func-module/output.json | 106 +- .../dupl-bind-func-script-sloppy/output.json | 119 +- .../scope/dupl-bind-func-script/output.json | 106 +- .../dupl-bind-func-var-sloppy/output.json | 132 +- .../core/scope/dupl-bind-func-var/output.json | 119 +- .../core/scope/dupl-bind-gen-func/output.json | 119 +- .../dupl-bind-gen-gen-script/output.json | 132 +- .../core/scope/dupl-bind-let-let/output.json | 93 +- .../dupl-bind-nested-let-var/output.json | 132 +- .../dupl-bind-nested-var-let/output.json | 132 +- .../core/scope/dupl-bind-var-var/output.json | 93 +- .../fixtures/core/scope/for-let/output.json | 145 +- .../fixtures/core/scope/for-var/output.json | 145 +- .../core/scope/let-assign/output.json | 132 +- .../undecl-export-as-default/output.json | 80 +- .../core/scope/undecl-export-as/output.json | 120 +- .../scope/undecl-export-block/output.json | 133 +- .../undecl-export-builtin-as/output.json | 80 +- .../scope/undecl-export-builtin/output.json | 80 +- .../output.json | 120 +- .../output.json | 120 +- .../core/scope/undecl-export-if/output.json | 146 +- .../core/scope/undecl-export-var/output.json | 133 +- .../core/scope/undecl-export/output.json | 80 +- .../commonjs/output.json | 106 +- .../sourcetype-unambiguous/flow/output.json | 173 +- .../import-meta/output.json | 134 +- .../module-export-all/output.json | 52 +- .../module-export-default/output.json | 52 +- .../module-export-named/output.json | 79 +- .../module-import/output.json | 52 +- .../fixtures/core/uncategorised/1/output.json | 52 +- .../core/uncategorised/10/output.json | 98 +- .../core/uncategorised/100/output.json | 52 +- .../core/uncategorised/101/output.json | 52 +- .../core/uncategorised/102/output.json | 79 +- .../core/uncategorised/103/output.json | 79 +- .../core/uncategorised/104/output.json | 79 +- .../core/uncategorised/105/output.json | 79 +- .../core/uncategorised/106/output.json | 79 +- .../core/uncategorised/107/output.json | 79 +- .../core/uncategorised/108/output.json | 79 +- .../core/uncategorised/109/output.json | 66 +- .../core/uncategorised/11/output.json | 92 +- .../core/uncategorised/110/output.json | 66 +- .../core/uncategorised/111/output.json | 79 +- .../core/uncategorised/112/output.json | 79 +- .../core/uncategorised/113/output.json | 106 +- .../core/uncategorised/114/output.json | 93 +- .../core/uncategorised/115/output.json | 93 +- .../core/uncategorised/116/output.json | 106 +- .../core/uncategorised/117/output.json | 94 +- .../core/uncategorised/118/output.json | 66 +- .../core/uncategorised/119/output.json | 80 +- .../core/uncategorised/12/output.json | 124 +- .../core/uncategorised/120/output.json | 107 +- .../core/uncategorised/121/output.json | 134 +- .../core/uncategorised/122/output.json | 107 +- .../core/uncategorised/123/output.json | 80 +- .../core/uncategorised/124/output.json | 106 +- .../core/uncategorised/125/output.json | 106 +- .../core/uncategorised/126/output.json | 185 +- .../core/uncategorised/127/output.json | 160 +- .../core/uncategorised/128/output.json | 80 +- .../core/uncategorised/129/output.json | 80 +- .../core/uncategorised/13/output.json | 124 +- .../core/uncategorised/130/output.json | 80 +- .../core/uncategorised/131/output.json | 80 +- .../core/uncategorised/132/output.json | 66 +- .../core/uncategorised/133/output.json | 66 +- .../core/uncategorised/134/output.json | 66 +- .../core/uncategorised/135/output.json | 66 +- .../core/uncategorised/136/output.json | 66 +- .../core/uncategorised/137/output.json | 66 +- .../core/uncategorised/138/output.json | 66 +- .../core/uncategorised/139/output.json | 66 +- .../core/uncategorised/14/output.json | 79 +- .../core/uncategorised/140/output.json | 66 +- .../core/uncategorised/141/output.json | 66 +- .../core/uncategorised/142/output.json | 66 +- .../core/uncategorised/143/output.json | 66 +- .../core/uncategorised/144/output.json | 66 +- .../core/uncategorised/145/output.json | 66 +- .../core/uncategorised/146/output.json | 66 +- .../core/uncategorised/147/output.json | 66 +- .../core/uncategorised/148/output.json | 66 +- .../core/uncategorised/149/output.json | 66 +- .../core/uncategorised/15/output.json | 79 +- .../core/uncategorised/150/output.json | 66 +- .../core/uncategorised/151/output.json | 80 +- .../core/uncategorised/152/output.json | 80 +- .../core/uncategorised/153/output.json | 80 +- .../core/uncategorised/154/output.json | 80 +- .../core/uncategorised/155/output.json | 80 +- .../core/uncategorised/156/output.json | 80 +- .../core/uncategorised/157/output.json | 80 +- .../core/uncategorised/158/output.json | 80 +- .../core/uncategorised/159/output.json | 80 +- .../core/uncategorised/16/output.json | 79 +- .../core/uncategorised/160/output.json | 80 +- .../core/uncategorised/161/output.json | 80 +- .../core/uncategorised/162/output.json | 80 +- .../core/uncategorised/163/output.json | 80 +- .../core/uncategorised/164/output.json | 80 +- .../core/uncategorised/165/output.json | 107 +- .../core/uncategorised/166/output.json | 80 +- .../core/uncategorised/167/output.json | 80 +- .../core/uncategorised/168/output.json | 80 +- .../core/uncategorised/169/output.json | 80 +- .../core/uncategorised/17/output.json | 79 +- .../core/uncategorised/170/output.json | 80 +- .../core/uncategorised/171/output.json | 80 +- .../core/uncategorised/172/output.json | 80 +- .../core/uncategorised/173/output.json | 107 +- .../core/uncategorised/174/output.json | 107 +- .../core/uncategorised/175/output.json | 107 +- .../core/uncategorised/176/output.json | 107 +- .../core/uncategorised/177/output.json | 107 +- .../core/uncategorised/178/output.json | 107 +- .../core/uncategorised/179/output.json | 107 +- .../core/uncategorised/18/output.json | 79 +- .../core/uncategorised/180/output.json | 107 +- .../core/uncategorised/181/output.json | 107 +- .../core/uncategorised/182/output.json | 107 +- .../core/uncategorised/183/output.json | 107 +- .../core/uncategorised/184/output.json | 107 +- .../core/uncategorised/185/output.json | 107 +- .../core/uncategorised/186/output.json | 107 +- .../core/uncategorised/187/output.json | 107 +- .../core/uncategorised/188/output.json | 107 +- .../core/uncategorised/189/output.json | 107 +- .../core/uncategorised/19/output.json | 79 +- .../core/uncategorised/190/output.json | 107 +- .../core/uncategorised/191/output.json | 80 +- .../core/uncategorised/192/output.json | 80 +- .../core/uncategorised/193/output.json | 107 +- .../core/uncategorised/194/output.json | 107 +- .../core/uncategorised/195/output.json | 107 +- .../core/uncategorised/196/output.json | 107 +- .../core/uncategorised/197/output.json | 92 +- .../core/uncategorised/198/output.json | 119 +- .../core/uncategorised/199/output.json | 79 +- .../fixtures/core/uncategorised/2/output.json | 52 +- .../core/uncategorised/20/output.json | 79 +- .../core/uncategorised/200/output.json | 79 +- .../core/uncategorised/201/output.json | 79 +- .../core/uncategorised/202/output.json | 79 +- .../core/uncategorised/203/output.json | 79 +- .../core/uncategorised/204/output.json | 79 +- .../core/uncategorised/205/output.json | 79 +- .../core/uncategorised/206/output.json | 79 +- .../core/uncategorised/207/output.json | 79 +- .../core/uncategorised/208/output.json | 79 +- .../core/uncategorised/209/output.json | 79 +- .../core/uncategorised/21/output.json | 79 +- .../core/uncategorised/210/output.json | 79 +- .../core/uncategorised/211/output.json | 79 +- .../core/uncategorised/212/output.json | 79 +- .../core/uncategorised/213/output.json | 66 +- .../core/uncategorised/214/output.json | 119 +- .../core/uncategorised/215/output.json | 39 +- .../core/uncategorised/216/output.json | 66 +- .../core/uncategorised/217/output.json | 93 +- .../core/uncategorised/218/output.json | 79 +- .../core/uncategorised/219/output.json | 119 +- .../core/uncategorised/22/output.json | 119 +- .../core/uncategorised/220/output.json | 159 +- .../core/uncategorised/221/output.json | 120 +- .../core/uncategorised/222/output.json | 147 +- .../core/uncategorised/223/output.json | 39 +- .../core/uncategorised/224/output.json | 53 +- .../core/uncategorised/225/output.json | 80 +- .../core/uncategorised/226/output.json | 53 +- .../core/uncategorised/227/output.json | 53 +- .../core/uncategorised/228/output.json | 93 +- .../core/uncategorised/229/output.json | 92 +- .../core/uncategorised/23/output.json | 119 +- .../core/uncategorised/230/output.json | 106 +- .../core/uncategorised/231/output.json | 133 +- .../core/uncategorised/232/output.json | 92 +- .../core/uncategorised/233/output.json | 92 +- .../core/uncategorised/234/output.json | 172 +- .../core/uncategorised/235/output.json | 104 +- .../core/uncategorised/236/output.json | 92 +- .../core/uncategorised/237/output.json | 172 +- .../core/uncategorised/238/output.json | 52 +- .../core/uncategorised/239/output.json | 52 +- .../core/uncategorised/24/output.json | 119 +- .../core/uncategorised/240/output.json | 92 +- .../core/uncategorised/241/output.json | 105 +- .../core/uncategorised/242/output.json | 145 +- .../core/uncategorised/243/output.json | 132 +- .../core/uncategorised/244/output.json | 159 +- .../core/uncategorised/245/output.json | 200 +- .../core/uncategorised/246/output.json | 121 +- .../core/uncategorised/247/output.json | 147 +- .../core/uncategorised/25/output.json | 119 +- .../core/uncategorised/250/output.json | 78 +- .../core/uncategorised/251/output.json | 78 +- .../core/uncategorised/252/output.json | 119 +- .../core/uncategorised/253/output.json | 119 +- .../core/uncategorised/254/output.json | 78 +- .../core/uncategorised/255/output.json | 119 +- .../core/uncategorised/256/output.json | 119 +- .../core/uncategorised/257/output.json | 146 +- .../core/uncategorised/258/output.json | 173 +- .../core/uncategorised/259/output.json | 78 +- .../core/uncategorised/26/output.json | 119 +- .../core/uncategorised/260/output.json | 78 +- .../core/uncategorised/261/output.json | 92 +- .../core/uncategorised/262/output.json | 119 +- .../core/uncategorised/263/output.json | 133 +- .../core/uncategorised/264/output.json | 133 +- .../core/uncategorised/265/output.json | 107 +- .../core/uncategorised/266/output.json | 107 +- .../core/uncategorised/267/output.json | 120 +- .../core/uncategorised/268/output.json | 53 +- .../core/uncategorised/269/output.json | 132 +- .../core/uncategorised/27/output.json | 118 +- .../core/uncategorised/270/output.json | 158 +- .../core/uncategorised/271/output.json | 93 +- .../core/uncategorised/272/output.json | 106 +- .../core/uncategorised/273/output.json | 53 +- .../core/uncategorised/274/output.json | 80 +- .../core/uncategorised/275/output.json | 92 +- .../core/uncategorised/276/output.json | 92 +- .../core/uncategorised/277/output.json | 92 +- .../core/uncategorised/278/output.json | 92 +- .../core/uncategorised/279/output.json | 146 +- .../core/uncategorised/28/output.json | 159 +- .../core/uncategorised/280/output.json | 119 +- .../core/uncategorised/281/output.json | 186 +- .../core/uncategorised/282/output.json | 253 +- .../core/uncategorised/283/output.json | 39 +- .../core/uncategorised/284/output.json | 106 +- .../core/uncategorised/285/output.json | 66 +- .../core/uncategorised/286/output.json | 66 +- .../core/uncategorised/287/output.json | 94 +- .../core/uncategorised/288/output.json | 107 +- .../core/uncategorised/289/output.json | 132 +- .../core/uncategorised/29/output.json | 146 +- .../core/uncategorised/290/output.json | 120 +- .../core/uncategorised/291/output.json | 134 +- .../core/uncategorised/292/output.json | 93 +- .../core/uncategorised/293/output.json | 107 +- .../core/uncategorised/294/output.json | 132 +- .../core/uncategorised/295/output.json | 159 +- .../core/uncategorised/296/output.json | 106 +- .../core/uncategorised/297/output.json | 106 +- .../core/uncategorised/298/output.json | 146 +- .../core/uncategorised/299/output.json | 65 +- .../fixtures/core/uncategorised/3/output.json | 52 +- .../core/uncategorised/30/output.json | 119 +- .../core/uncategorised/300/output.json | 106 +- .../core/uncategorised/301/output.json | 106 +- .../core/uncategorised/302/output.json | 92 +- .../core/uncategorised/303/output.json | 159 +- .../core/uncategorised/304/output.json | 105 +- .../core/uncategorised/305/output.json | 144 +- .../core/uncategorised/306/output.json | 144 +- .../core/uncategorised/307/output.json | 105 +- .../core/uncategorised/308/output.json | 144 +- .../core/uncategorised/309/output.json | 144 +- .../core/uncategorised/31/output.json | 119 +- .../core/uncategorised/310/output.json | 105 +- .../core/uncategorised/311/output.json | 144 +- .../core/uncategorised/312/output.json | 144 +- .../core/uncategorised/313/output.json | 93 +- .../core/uncategorised/314/output.json | 132 +- .../core/uncategorised/315/output.json | 132 +- .../core/uncategorised/316/output.json | 26 +- .../core/uncategorised/317/output.json | 106 +- .../core/uncategorised/318/output.json | 130 +- .../core/uncategorised/319/output.json | 105 +- .../core/uncategorised/32/output.json | 119 +- .../core/uncategorised/320/output.json | 78 +- .../core/uncategorised/321/output.json | 80 +- .../core/uncategorised/322/output.json | 52 +- .../core/uncategorised/323/output.json | 132 +- .../core/uncategorised/324/output.json | 78 +- .../core/uncategorised/325/output.json | 53 +- .../core/uncategorised/326/output.json | 107 +- .../core/uncategorised/327/output.json | 78 +- .../core/uncategorised/328/output.json | 78 +- .../core/uncategorised/329/output.json | 91 +- .../core/uncategorised/33/output.json | 119 +- .../core/uncategorised/330/output.json | 65 +- .../core/uncategorised/331/output.json | 105 +- .../core/uncategorised/332/output.json | 78 +- .../core/uncategorised/333/output.json | 78 +- .../core/uncategorised/334/output.json | 78 +- .../core/uncategorised/335/output.json | 157 +- .../core/uncategorised/336/output.json | 104 +- .../core/uncategorised/337/output.json | 118 +- .../core/uncategorised/338/output.json | 117 +- .../core/uncategorised/339/output.json | 105 +- .../core/uncategorised/34/output.json | 119 +- .../core/uncategorised/340/output.json | 119 +- .../core/uncategorised/341/output.json | 65 +- .../core/uncategorised/342/output.json | 119 +- .../core/uncategorised/343/output.json | 145 +- .../core/uncategorised/344/output.json | 119 +- .../core/uncategorised/349/output.json | 52 +- .../core/uncategorised/35/output.json | 118 +- .../core/uncategorised/350/output.json | 52 +- .../core/uncategorised/351/output.json | 52 +- .../core/uncategorised/354/output.json | 52 +- .../core/uncategorised/355/output.json | 52 +- .../core/uncategorised/356/output.json | 52 +- .../core/uncategorised/36/output.json | 118 +- .../core/uncategorised/361/output.json | 53 +- .../core/uncategorised/362/output.json | 53 +- .../core/uncategorised/363/output.json | 53 +- .../core/uncategorised/366/output.json | 79 +- .../core/uncategorised/367/output.json | 78 +- .../core/uncategorised/368/output.json | 92 +- .../core/uncategorised/369/output.json | 104 +- .../core/uncategorised/37/output.json | 187 +- .../core/uncategorised/370/output.json | 65 +- .../core/uncategorised/371/output.json | 65 +- .../core/uncategorised/372/output.json | 65 +- .../core/uncategorised/373/output.json | 65 +- .../core/uncategorised/374/output.json | 146 +- .../core/uncategorised/38/output.json | 187 +- .../core/uncategorised/382/output.json | 79 +- .../core/uncategorised/383/output.json | 105 +- .../core/uncategorised/384/output.json | 92 +- .../core/uncategorised/39/output.json | 187 +- .../core/uncategorised/397/output.json | 80 +- .../core/uncategorised/398/output.json | 80 +- .../core/uncategorised/399/output.json | 80 +- .../fixtures/core/uncategorised/4/output.json | 52 +- .../core/uncategorised/40/output.json | 187 +- .../core/uncategorised/400/output.json | 80 +- .../core/uncategorised/401/output.json | 66 +- .../core/uncategorised/402/output.json | 66 +- .../core/uncategorised/403/output.json | 66 +- .../core/uncategorised/404/output.json | 66 +- .../core/uncategorised/409/output.json | 39 +- .../core/uncategorised/41/output.json | 187 +- .../core/uncategorised/411/output.json | 39 +- .../core/uncategorised/417/output.json | 105 +- .../core/uncategorised/418/output.json | 92 +- .../core/uncategorised/42/output.json | 186 +- .../core/uncategorised/425/output.json | 52 +- .../core/uncategorised/427/output.json | 79 +- .../core/uncategorised/43/output.json | 186 +- .../core/uncategorised/44/output.json | 119 +- .../core/uncategorised/446/output.json | 53 +- .../core/uncategorised/447/output.json | 53 +- .../core/uncategorised/448/output.json | 53 +- .../core/uncategorised/449/output.json | 53 +- .../core/uncategorised/45/output.json | 119 +- .../core/uncategorised/454/output.json | 39 +- .../core/uncategorised/455/output.json | 39 +- .../core/uncategorised/456/output.json | 39 +- .../core/uncategorised/457/output.json | 79 +- .../core/uncategorised/459/output.json | 92 +- .../core/uncategorised/46/output.json | 78 +- .../core/uncategorised/460/output.json | 92 +- .../core/uncategorised/461/output.json | 158 +- .../core/uncategorised/462/output.json | 158 +- .../core/uncategorised/463/output.json | 144 +- .../core/uncategorised/464/output.json | 144 +- .../core/uncategorised/465/output.json | 158 +- .../core/uncategorised/466/output.json | 144 +- .../core/uncategorised/467/output.json | 144 +- .../core/uncategorised/468/output.json | 145 +- .../core/uncategorised/469/output.json | 145 +- .../core/uncategorised/47/output.json | 104 +- .../core/uncategorised/470/output.json | 158 +- .../core/uncategorised/471/output.json | 158 +- .../core/uncategorised/472/output.json | 145 +- .../core/uncategorised/473/output.json | 145 +- .../core/uncategorised/474/output.json | 132 +- .../core/uncategorised/475/output.json | 132 +- .../core/uncategorised/476/output.json | 132 +- .../core/uncategorised/477/output.json | 132 +- .../core/uncategorised/478/output.json | 132 +- .../core/uncategorised/479/output.json | 132 +- .../core/uncategorised/48/output.json | 104 +- .../core/uncategorised/480/output.json | 132 +- .../core/uncategorised/481/output.json | 132 +- .../core/uncategorised/482/output.json | 132 +- .../core/uncategorised/483/output.json | 132 +- .../core/uncategorised/484/output.json | 92 +- .../core/uncategorised/485/output.json | 92 +- .../core/uncategorised/486/output.json | 158 +- .../core/uncategorised/487/output.json | 158 +- .../core/uncategorised/488/output.json | 118 +- .../core/uncategorised/489/output.json | 118 +- .../core/uncategorised/49/output.json | 78 +- .../core/uncategorised/490/output.json | 185 +- .../core/uncategorised/491/output.json | 118 +- .../core/uncategorised/492/output.json | 212 +- .../core/uncategorised/493/output.json | 172 +- .../core/uncategorised/494/output.json | 199 +- .../core/uncategorised/495/output.json | 106 +- .../core/uncategorised/496/output.json | 106 +- .../core/uncategorised/497/output.json | 146 +- .../core/uncategorised/498/output.json | 146 +- .../core/uncategorised/499/output.json | 120 +- .../fixtures/core/uncategorised/5/output.json | 52 +- .../core/uncategorised/50/output.json | 78 +- .../core/uncategorised/500/output.json | 120 +- .../core/uncategorised/501/output.json | 157 +- .../core/uncategorised/502/output.json | 157 +- .../core/uncategorised/503/output.json | 158 +- .../core/uncategorised/504/output.json | 132 +- .../core/uncategorised/505/output.json | 132 +- .../core/uncategorised/506/output.json | 132 +- .../core/uncategorised/507/output.json | 132 +- .../core/uncategorised/508/output.json | 132 +- .../core/uncategorised/509/output.json | 132 +- .../core/uncategorised/51/output.json | 78 +- .../core/uncategorised/510/output.json | 132 +- .../core/uncategorised/511/output.json | 106 +- .../core/uncategorised/512/output.json | 92 +- .../core/uncategorised/513/output.json | 92 +- .../core/uncategorised/514/output.json | 120 +- .../core/uncategorised/515/output.json | 106 +- .../core/uncategorised/516/output.json | 106 +- .../core/uncategorised/517/output.json | 173 +- .../core/uncategorised/518/output.json | 133 +- .../core/uncategorised/519/output.json | 173 +- .../core/uncategorised/52/output.json | 78 +- .../core/uncategorised/520/output.json | 119 +- .../core/uncategorised/521/output.json | 119 +- .../core/uncategorised/522/output.json | 211 +- .../core/uncategorised/523/output.json | 79 +- .../core/uncategorised/524/output.json | 52 +- .../core/uncategorised/525/output.json | 66 +- .../core/uncategorised/526/output.json | 93 +- .../core/uncategorised/527/output.json | 79 +- .../core/uncategorised/528/output.json | 119 +- .../core/uncategorised/529/output.json | 159 +- .../core/uncategorised/53/output.json | 78 +- .../core/uncategorised/530/output.json | 105 +- .../core/uncategorised/531/output.json | 145 +- .../core/uncategorised/532/output.json | 147 +- .../core/uncategorised/533/output.json | 79 +- .../core/uncategorised/534/output.json | 119 +- .../core/uncategorised/535/output.json | 159 +- .../core/uncategorised/537/output.json | 105 +- .../core/uncategorised/538/output.json | 65 +- .../core/uncategorised/539/output.json | 106 +- .../core/uncategorised/54/output.json | 78 +- .../core/uncategorised/540/output.json | 91 +- .../core/uncategorised/541/output.json | 92 +- .../core/uncategorised/542/output.json | 105 +- .../core/uncategorised/543/output.json | 170 +- .../core/uncategorised/544/output.json | 159 +- .../core/uncategorised/545/output.json | 133 +- .../core/uncategorised/546/output.json | 133 +- .../core/uncategorised/547/output.json | 159 +- .../core/uncategorised/548/output.json | 133 +- .../core/uncategorised/549/output.json | 133 +- .../core/uncategorised/55/output.json | 78 +- .../core/uncategorised/550/output.json | 105 +- .../core/uncategorised/551/output.json | 52 +- .../core/uncategorised/552/output.json | 105 +- .../core/uncategorised/553/output.json | 52 +- .../core/uncategorised/56/output.json | 78 +- .../core/uncategorised/57/output.json | 52 +- .../core/uncategorised/58/output.json | 52 +- .../core/uncategorised/59/output.json | 78 +- .../fixtures/core/uncategorised/6/output.json | 104 +- .../core/uncategorised/60/output.json | 52 +- .../core/uncategorised/61/output.json | 52 +- .../core/uncategorised/62/output.json | 78 +- .../core/uncategorised/63/output.json | 104 +- .../core/uncategorised/64/output.json | 132 +- .../core/uncategorised/65/output.json | 145 +- .../core/uncategorised/66/output.json | 52 +- .../core/uncategorised/67/output.json | 52 +- .../core/uncategorised/68/output.json | 52 +- .../core/uncategorised/69/output.json | 52 +- .../fixtures/core/uncategorised/7/output.json | 79 +- .../core/uncategorised/70/output.json | 52 +- .../core/uncategorised/71/output.json | 52 +- .../core/uncategorised/72/output.json | 52 +- .../core/uncategorised/73/output.json | 52 +- .../core/uncategorised/74/output.json | 52 +- .../core/uncategorised/75/output.json | 52 +- .../core/uncategorised/76/output.json | 52 +- .../core/uncategorised/77/output.json | 52 +- .../core/uncategorised/78/output.json | 52 +- .../core/uncategorised/79/output.json | 52 +- .../fixtures/core/uncategorised/8/output.json | 79 +- .../core/uncategorised/80/output.json | 52 +- .../core/uncategorised/81/output.json | 52 +- .../core/uncategorised/82/output.json | 52 +- .../core/uncategorised/83/output.json | 52 +- .../core/uncategorised/84/output.json | 52 +- .../core/uncategorised/85/output.json | 52 +- .../core/uncategorised/86/output.json | 52 +- .../core/uncategorised/87/output.json | 52 +- .../core/uncategorised/88/output.json | 52 +- .../core/uncategorised/89/output.json | 52 +- .../fixtures/core/uncategorised/9/output.json | 92 +- .../core/uncategorised/90/output.json | 52 +- .../core/uncategorised/91/output.json | 52 +- .../core/uncategorised/92/output.json | 52 +- .../core/uncategorised/93/output.json | 52 +- .../core/uncategorised/94/output.json | 52 +- .../core/uncategorised/95/output.json | 52 +- .../core/uncategorised/96/output.json | 52 +- .../core/uncategorised/97/output.json | 52 +- .../core/uncategorised/98/output.json | 52 +- .../core/uncategorised/99/output.json | 52 +- .../comma-after-rest/output.json | 105 +- .../comma-after-spread-for-in/output.json | 105 +- .../comma-after-spread-nested/output.json | 118 +- .../comma-after-spread/output.json | 85 +- .../array-rest-spread/with-object/output.json | 184 +- .../output.json | 79 +- .../in-logic-expression/output.json | 171 +- .../object-rest-spread/output.json | 173 +- .../direct-super-in-object-method/output.json | 265 +- .../output.json | 145 +- .../output.json | 134 +- .../output.json | 106 +- .../disallow-static-prototype/output.json | 106 +- .../getter-signature/output.json | 120 +- .../class-methods/linebreaks/output.json | 494 +- .../malformed-super-expression/output.json | 158 +- .../class-methods/tricky-names/output.json | 623 +- .../es2015/class/division/output.json | 452 +- .../es2015/class/extends-strict/output.json | 185 +- .../call-expression/output.json | 132 +- .../destructuring/binding-this/output.json | 119 +- .../duplicate-proto-1/output.json | 160 +- .../duplicate-proto-2/output.json | 186 +- .../duplicate-proto-3/output.json | 160 +- .../duplicate-proto-4/output.json | 203 +- .../error-operator-for-default/output.json | 120 +- .../parenthesized-lhs-array/output.json | 92 +- .../parenthesized-lhs-object/output.json | 119 +- .../in-new-expression/output.json | 174 +- .../for-in/bare-initializer/output.json | 145 +- .../for-in/const-initializer/output.json | 118 +- .../es2015/for-in/let-initializer/output.json | 118 +- .../for-in/nonstrict-initializer/output.json | 531 +- .../for-in/strict-initializer/output.json | 144 +- .../output.json | 131 +- .../output.json | 158 +- .../for-of/bare-initializer/output.json | 145 +- .../es2015/for-of/brackets-const/output.json | 145 +- .../es2015/for-of/brackets-let/output.json | 145 +- .../es2015/for-of/brackets-var/output.json | 145 +- .../es2015/for-of/right-regex/output.json | 239 +- .../invalid-escape-yield/output.json | 92 +- .../generators/invalid-hanging/output.json | 92 +- .../invalid-escape-seq-const/output.json | 132 +- .../invalid-escape-seq-export/output.json | 173 +- .../invalid-escape-seq-if/output.json | 65 +- .../invalid-escape-seq-import/output.json | 105 +- .../invalid-escape-seq-null/output.json | 52 +- .../invalid-escape-seq-true/output.json | 52 +- .../let/let-as-identifier-1/output.json | 79 +- .../let/let-as-identifier-2/output.json | 79 +- .../let/let-as-identifier-3/output.json | 80 +- .../let/let-as-identifier-4/output.json | 79 +- .../let/let-as-identifier-5/output.json | 92 +- .../let/let-as-identifier-6/output.json | 106 +- .../let/let-as-identifier-7/output.json | 106 +- .../let-as-identifier-strict-fail/output.json | 105 +- .../let-at-binding-list-fail-1/output.json | 119 +- .../let-at-binding-list-fail-2/output.json | 119 +- .../let-at-binding-list-fail-3/output.json | 92 +- .../let-at-binding-list-fail-4/output.json | 92 +- .../let-at-binding-list-fail-5/output.json | 66 +- .../let-at-binding-list-fail-6/output.json | 79 +- .../es2015/let/let-at-catch-block/output.json | 132 +- .../let/let-block-with-newline/output.json | 171 +- .../let-with-linebreak-arr-dstrk/output.json | 105 +- .../let-with-linebreak-obj-dstrk/output.json | 159 +- .../es2015/let/let-with-linebreak/output.json | 66 +- .../es2015/let/try-catch-let/output.json | 92 +- .../meta-properties/expression/output.json | 146 +- .../invalid-arrow-function/output.json | 146 +- .../nested-arrow-function/output.json | 133 +- .../new-invalid-prop/output.json | 120 +- .../new-target-inside-params/output.json | 281 +- .../output.json | 120 +- .../output.json | 120 +- .../new-target-invalid/output.json | 80 +- .../meta-properties/new-target/output.json | 120 +- .../meta-properties/statement/output.json | 120 +- .../output.json | 132 +- .../duplicate-export-default/output.json | 104 +- .../output.json | 133 +- .../output.json | 146 +- .../output.json | 213 +- .../output.json | 2004 +------ .../output.json | 252 +- .../output.json | 399 +- .../output.json | 386 +- .../output.json | 427 +- .../output.json | 199 +- .../output.json | 199 +- .../output.json | 199 +- .../output.json | 199 +- .../output.json | 226 +- .../output.json | 239 +- .../output.json | 199 +- .../output.json | 199 +- .../output.json | 172 +- .../output.json | 172 +- .../output.json | 213 +- .../output.json | 213 +- .../output.json | 199 +- .../output.json | 172 +- .../output.json | 146 +- .../output.json | 147 +- .../duplicate-named-export/output.json | 134 +- .../output.json | 197 +- .../output.json | 79 +- .../output.json | 79 +- .../output.json | 92 +- .../output.json | 79 +- .../output.json | 79 +- .../output.json | 93 +- .../output.json | 197 +- .../import-invalid-keyword-flow/output.json | 93 +- .../output.json | 93 +- .../import-invalid-keyword-typeof/output.json | 93 +- .../import-invalid-keyword/output.json | 93 +- .../modules/xml-comment-in-module/output.json | 106 +- .../modules/xml-comment-in-script/output.json | 79 +- .../output.json | 120 +- .../es2015/regex/duplicate-flags/output.json | 52 +- .../es2015/regression/186/output.json | 161 +- .../es2015/regression/6864/output.json | 267 +- .../fixtures/es2015/shorthand/1/output.json | 120 +- .../fixtures/es2015/shorthand/2/output.json | 175 +- .../label-invalid-const/output.json | 106 +- .../label-invalid-func-async/output.json | 93 +- .../label-invalid-func-generator/output.json | 93 +- .../label-invalid-func-strict/output.json | 159 +- .../label-valid-func-non-strict/output.json | 93 +- .../statements/label-valid-var/output.json | 93 +- .../es2015/uncategorised/1/output.json | 52 +- .../es2015/uncategorised/10/output.json | 52 +- .../es2015/uncategorised/105/output.json | 66 +- .../es2015/uncategorised/107/output.json | 121 +- .../es2015/uncategorised/108/output.json | 147 +- .../es2015/uncategorised/109/output.json | 160 +- .../es2015/uncategorised/11/output.json | 52 +- .../es2015/uncategorised/110/output.json | 147 +- .../es2015/uncategorised/111/output.json | 106 +- .../es2015/uncategorised/112/output.json | 120 +- .../es2015/uncategorised/113/output.json | 106 +- .../es2015/uncategorised/114/output.json | 106 +- .../es2015/uncategorised/115/output.json | 120 +- .../es2015/uncategorised/116/output.json | 120 +- .../es2015/uncategorised/117/output.json | 120 +- .../es2015/uncategorised/118/output.json | 120 +- .../es2015/uncategorised/119/output.json | 120 +- .../es2015/uncategorised/12/output.json | 52 +- .../es2015/uncategorised/120/output.json | 120 +- .../es2015/uncategorised/121/output.json | 160 +- .../es2015/uncategorised/122/output.json | 160 +- .../es2015/uncategorised/123/output.json | 184 +- .../es2015/uncategorised/124/output.json | 105 +- .../es2015/uncategorised/125/output.json | 145 +- .../es2015/uncategorised/126/output.json | 106 +- .../es2015/uncategorised/127/output.json | 106 +- .../es2015/uncategorised/128/output.json | 106 +- .../es2015/uncategorised/129/output.json | 146 +- .../es2015/uncategorised/13/output.json | 52 +- .../es2015/uncategorised/131/output.json | 146 +- .../es2015/uncategorised/132/output.json | 160 +- .../es2015/uncategorised/133/output.json | 146 +- .../es2015/uncategorised/134/output.json | 146 +- .../es2015/uncategorised/135/output.json | 254 +- .../es2015/uncategorised/136/output.json | 106 +- .../es2015/uncategorised/137/output.json | 106 +- .../es2015/uncategorised/138/output.json | 160 +- .../es2015/uncategorised/139/output.json | 146 +- .../es2015/uncategorised/14/output.json | 52 +- .../es2015/uncategorised/140/output.json | 66 +- .../es2015/uncategorised/141/output.json | 92 +- .../es2015/uncategorised/142/output.json | 117 +- .../es2015/uncategorised/143/output.json | 105 +- .../es2015/uncategorised/144/output.json | 132 +- .../es2015/uncategorised/145/output.json | 146 +- .../es2015/uncategorised/146/output.json | 92 +- .../es2015/uncategorised/147/output.json | 160 +- .../es2015/uncategorised/148/output.json | 120 +- .../es2015/uncategorised/149/output.json | 159 +- .../es2015/uncategorised/15/output.json | 52 +- .../es2015/uncategorised/150/output.json | 106 +- .../es2015/uncategorised/152/output.json | 132 +- .../es2015/uncategorised/153/output.json | 186 +- .../es2015/uncategorised/154/output.json | 212 +- .../es2015/uncategorised/155/output.json | 225 +- .../es2015/uncategorised/156/output.json | 212 +- .../es2015/uncategorised/157/output.json | 225 +- .../es2015/uncategorised/158/output.json | 185 +- .../es2015/uncategorised/159/output.json | 132 +- .../es2015/uncategorised/16/output.json | 52 +- .../es2015/uncategorised/160/output.json | 106 +- .../es2015/uncategorised/161/output.json | 172 +- .../es2015/uncategorised/162/output.json | 159 +- .../es2015/uncategorised/163/output.json | 107 +- .../es2015/uncategorised/164/output.json | 107 +- .../es2015/uncategorised/165/output.json | 161 +- .../es2015/uncategorised/166/output.json | 134 +- .../es2015/uncategorised/167/output.json | 120 +- .../es2015/uncategorised/168/output.json | 337 +- .../es2015/uncategorised/169/output.json | 120 +- .../es2015/uncategorised/17/output.json | 52 +- .../es2015/uncategorised/170/output.json | 174 +- .../es2015/uncategorised/171/output.json | 133 +- .../es2015/uncategorised/172/output.json | 350 +- .../es2015/uncategorised/173/output.json | 133 +- .../es2015/uncategorised/174/output.json | 146 +- .../es2015/uncategorised/175/output.json | 363 +- .../es2015/uncategorised/176/output.json | 92 +- .../es2015/uncategorised/177/output.json | 106 +- .../es2015/uncategorised/178/output.json | 119 +- .../es2015/uncategorised/179/output.json | 146 +- .../es2015/uncategorised/18/output.json | 65 +- .../es2015/uncategorised/180/output.json | 119 +- .../es2015/uncategorised/181/output.json | 119 +- .../es2015/uncategorised/182/output.json | 173 +- .../es2015/uncategorised/183/output.json | 228 +- .../es2015/uncategorised/184/output.json | 106 +- .../es2015/uncategorised/185/output.json | 120 +- .../es2015/uncategorised/186/output.json | 201 +- .../es2015/uncategorised/187/output.json | 147 +- .../es2015/uncategorised/188/output.json | 106 +- .../es2015/uncategorised/189/output.json | 120 +- .../es2015/uncategorised/19/output.json | 92 +- .../es2015/uncategorised/190/output.json | 201 +- .../es2015/uncategorised/192/output.json | 93 +- .../es2015/uncategorised/193/output.json | 107 +- .../es2015/uncategorised/194/output.json | 107 +- .../es2015/uncategorised/195/output.json | 52 +- .../es2015/uncategorised/196/output.json | 52 +- .../es2015/uncategorised/197/output.json | 105 +- .../es2015/uncategorised/198/output.json | 52 +- .../es2015/uncategorised/2/output.json | 52 +- .../es2015/uncategorised/20/output.json | 119 +- .../es2015/uncategorised/200/output.json | 52 +- .../es2015/uncategorised/201/output.json | 52 +- .../es2015/uncategorised/202/output.json | 52 +- .../es2015/uncategorised/204/output.json | 52 +- .../es2015/uncategorised/205/output.json | 52 +- .../es2015/uncategorised/206/output.json | 52 +- .../es2015/uncategorised/208/output.json | 52 +- .../es2015/uncategorised/209/output.json | 52 +- .../es2015/uncategorised/21/output.json | 65 +- .../es2015/uncategorised/210/output.json | 52 +- .../es2015/uncategorised/211/output.json | 52 +- .../es2015/uncategorised/213/output.json | 52 +- .../es2015/uncategorised/214/output.json | 52 +- .../es2015/uncategorised/215/output.json | 52 +- .../es2015/uncategorised/217/output.json | 52 +- .../es2015/uncategorised/218/output.json | 52 +- .../es2015/uncategorised/219/output.json | 52 +- .../es2015/uncategorised/22/output.json | 69 +- .../es2015/uncategorised/220/output.json | 93 +- .../es2015/uncategorised/221/output.json | 91 +- .../es2015/uncategorised/222/output.json | 118 +- .../es2015/uncategorised/223/output.json | 118 +- .../es2015/uncategorised/226/output.json | 66 +- .../es2015/uncategorised/227/output.json | 212 +- .../es2015/uncategorised/228/output.json | 186 +- .../es2015/uncategorised/229/output.json | 66 +- .../es2015/uncategorised/23/output.json | 65 +- .../es2015/uncategorised/230/output.json | 66 +- .../es2015/uncategorised/231/output.json | 66 +- .../es2015/uncategorised/232/output.json | 79 +- .../es2015/uncategorised/233/output.json | 146 +- .../es2015/uncategorised/234/output.json | 146 +- .../es2015/uncategorised/235/output.json | 160 +- .../es2015/uncategorised/236/output.json | 160 +- .../es2015/uncategorised/24/output.json | 65 +- .../es2015/uncategorised/242/output.json | 131 +- .../es2015/uncategorised/243/output.json | 105 +- .../es2015/uncategorised/244/output.json | 105 +- .../es2015/uncategorised/245/output.json | 119 +- .../es2015/uncategorised/246/output.json | 119 +- .../es2015/uncategorised/247/output.json | 145 +- .../es2015/uncategorised/248/output.json | 119 +- .../es2015/uncategorised/249/output.json | 105 +- .../es2015/uncategorised/25/output.json | 105 +- .../es2015/uncategorised/251/output.json | 78 +- .../es2015/uncategorised/252/output.json | 91 +- .../es2015/uncategorised/26/output.json | 275 +- .../es2015/uncategorised/27/output.json | 145 +- .../es2015/uncategorised/279/output.json | 133 +- .../es2015/uncategorised/28/output.json | 65 +- .../es2015/uncategorised/280/output.json | 160 +- .../es2015/uncategorised/281/output.json | 293 +- .../es2015/uncategorised/284/output.json | 91 +- .../es2015/uncategorised/287/output.json | 146 +- .../es2015/uncategorised/289/output.json | 132 +- .../es2015/uncategorised/29/output.json | 79 +- .../es2015/uncategorised/290/output.json | 118 +- .../es2015/uncategorised/291/output.json | 78 +- .../es2015/uncategorised/296/output.json | 105 +- .../es2015/uncategorised/297/output.json | 131 +- .../es2015/uncategorised/298/output.json | 118 +- .../es2015/uncategorised/299/output.json | 200 +- .../es2015/uncategorised/3/output.json | 52 +- .../es2015/uncategorised/30/output.json | 79 +- .../es2015/uncategorised/300/output.json | 120 +- .../es2015/uncategorised/301/output.json | 106 +- .../es2015/uncategorised/302/output.json | 131 +- .../es2015/uncategorised/303/output.json | 120 +- .../es2015/uncategorised/304/output.json | 147 +- .../es2015/uncategorised/305/output.json | 147 +- .../es2015/uncategorised/306/output.json | 120 +- .../es2015/uncategorised/307/output.json | 146 +- .../es2015/uncategorised/308/output.json | 146 +- .../es2015/uncategorised/309/output.json | 213 +- .../es2015/uncategorised/31/output.json | 93 +- .../es2015/uncategorised/310/output.json | 146 +- .../es2015/uncategorised/313/output.json | 132 +- .../es2015/uncategorised/314/output.json | 106 +- .../es2015/uncategorised/315/output.json | 147 +- .../es2015/uncategorised/316/output.json | 106 +- .../es2015/uncategorised/317/output.json | 170 +- .../es2015/uncategorised/318/output.json | 79 +- .../es2015/uncategorised/319/output.json | 79 +- .../es2015/uncategorised/32/output.json | 105 +- .../es2015/uncategorised/320/output.json | 105 +- .../es2015/uncategorised/321/output.json | 120 +- .../es2015/uncategorised/322/output.json | 98 +- .../es2015/uncategorised/323/output.json | 133 +- .../es2015/uncategorised/324/output.json | 79 +- .../es2015/uncategorised/325/output.json | 79 +- .../es2015/uncategorised/329/output.json | 92 +- .../es2015/uncategorised/33/output.json | 119 +- .../es2015/uncategorised/332/output.json | 132 +- .../es2015/uncategorised/333/output.json | 173 +- .../es2015/uncategorised/334/output.json | 106 +- .../es2015/uncategorised/338/output.json | 105 +- .../es2015/uncategorised/339/output.json | 65 +- .../es2015/uncategorised/34/output.json | 132 +- .../es2015/uncategorised/344/output.json | 52 +- .../es2015/uncategorised/347/output.json | 134 +- .../es2015/uncategorised/348/output.json | 132 +- .../es2015/uncategorised/349/output.json | 131 +- .../es2015/uncategorised/35/output.json | 119 +- .../es2015/uncategorised/350/output.json | 131 +- .../es2015/uncategorised/351/output.json | 158 +- .../es2015/uncategorised/352/output.json | 158 +- .../es2015/uncategorised/354/output.json | 52 +- .../es2015/uncategorised/355/output.json | 146 +- .../es2015/uncategorised/356/output.json | 93 +- .../es2015/uncategorised/357/output.json | 93 +- .../es2015/uncategorised/358/output.json | 93 +- .../es2015/uncategorised/359/output.json | 93 +- .../es2015/uncategorised/36/output.json | 106 +- .../es2015/uncategorised/360/output.json | 133 +- .../es2015/uncategorised/361/output.json | 133 +- .../es2015/uncategorised/362/output.json | 120 +- .../es2015/uncategorised/363/output.json | 120 +- .../es2015/uncategorised/364/output.json | 66 +- .../es2015/uncategorised/365/output.json | 66 +- .../es2015/uncategorised/366/output.json | 66 +- .../es2015/uncategorised/367/output.json | 66 +- .../es2015/uncategorised/368/output.json | 93 +- .../es2015/uncategorised/369/output.json | 93 +- .../es2015/uncategorised/37/output.json | 119 +- .../es2015/uncategorised/370/output.json | 93 +- .../es2015/uncategorised/371/output.json | 93 +- .../es2015/uncategorised/372/output.json | 133 +- .../es2015/uncategorised/373/output.json | 133 +- .../es2015/uncategorised/374/output.json | 120 +- .../es2015/uncategorised/375/output.json | 120 +- .../es2015/uncategorised/376/output.json | 66 +- .../es2015/uncategorised/377/output.json | 66 +- .../es2015/uncategorised/378/output.json | 66 +- .../es2015/uncategorised/379/output.json | 66 +- .../es2015/uncategorised/380/output.json | 92 +- .../es2015/uncategorised/381/output.json | 92 +- .../es2015/uncategorised/382/output.json | 92 +- .../es2015/uncategorised/383/output.json | 79 +- .../es2015/uncategorised/384/output.json | 79 +- .../es2015/uncategorised/385/output.json | 79 +- .../es2015/uncategorised/39/output.json | 133 +- .../es2015/uncategorised/391/output.json | 92 +- .../es2015/uncategorised/393/output.json | 146 +- .../es2015/uncategorised/394/output.json | 317 +- .../es2015/uncategorised/395/output.json | 119 +- .../es2015/uncategorised/4/output.json | 52 +- .../es2015/uncategorised/40/output.json | 79 +- .../es2015/uncategorised/41/output.json | 79 +- .../es2015/uncategorised/42/output.json | 79 +- .../es2015/uncategorised/43/output.json | 93 +- .../es2015/uncategorised/44/output.json | 105 +- .../es2015/uncategorised/45/output.json | 119 +- .../es2015/uncategorised/46/output.json | 80 +- .../es2015/uncategorised/47/output.json | 106 +- .../es2015/uncategorised/48/output.json | 162 +- .../es2015/uncategorised/49/output.json | 92 +- .../es2015/uncategorised/5/output.json | 118 +- .../es2015/uncategorised/50/output.json | 120 +- .../es2015/uncategorised/52/output.json | 119 +- .../es2015/uncategorised/53/output.json | 133 +- .../es2015/uncategorised/54/output.json | 118 +- .../es2015/uncategorised/55/output.json | 119 +- .../es2015/uncategorised/56/output.json | 119 +- .../es2015/uncategorised/6/output.json | 52 +- .../es2015/uncategorised/61/output.json | 161 +- .../es2015/uncategorised/62/output.json | 134 +- .../es2015/uncategorised/63/output.json | 119 +- .../es2015/uncategorised/64/output.json | 92 +- .../es2015/uncategorised/65/output.json | 119 +- .../es2015/uncategorised/66/output.json | 92 +- .../es2015/uncategorised/67/output.json | 119 +- .../es2015/uncategorised/68/output.json | 92 +- .../es2015/uncategorised/69/output.json | 119 +- .../es2015/uncategorised/7/output.json | 52 +- .../es2015/uncategorised/70/output.json | 119 +- .../es2015/uncategorised/71/output.json | 119 +- .../es2015/uncategorised/72/output.json | 79 +- .../es2015/uncategorised/73/output.json | 92 +- .../es2015/uncategorised/74/output.json | 79 +- .../es2015/uncategorised/75/output.json | 92 +- .../es2015/uncategorised/76/output.json | 92 +- .../es2015/uncategorised/77/output.json | 79 +- .../es2015/uncategorised/78/output.json | 79 +- .../es2015/uncategorised/79/output.json | 52 +- .../es2015/uncategorised/8/output.json | 52 +- .../es2015/uncategorised/80/output.json | 65 +- .../es2015/uncategorised/81/output.json | 79 +- .../es2015/uncategorised/82/output.json | 65 +- .../es2015/uncategorised/83/output.json | 79 +- .../es2015/uncategorised/85/output.json | 52 +- .../es2015/uncategorised/86/output.json | 120 +- .../es2015/uncategorised/87/output.json | 201 +- .../es2015/uncategorised/88/output.json | 133 +- .../es2015/uncategorised/89/output.json | 201 +- .../es2015/uncategorised/9/output.json | 118 +- .../es2015/uncategorised/90/output.json | 97 +- .../es2015/uncategorised/91/output.json | 52 +- .../es2015/uncategorised/92/output.json | 79 +- .../es2015/uncategorised/93/output.json | 134 +- .../es2015/uncategorised/94/output.json | 93 +- .../es2015/uncategorised/95/output.json | 161 +- .../es2015/uncategorised/97/output.json | 93 +- .../es2015/uncategorised/98/output.json | 79 +- .../output.json | 426 +- .../fixtures/es2015/yield/asi/output.json | 118 +- .../fixtures/es2015/yield/asi2/output.json | 131 +- .../yield/basic-with-argument/output.json | 105 +- .../yield/basic-without-argument/output.json | 146 +- .../function-name-class-wrapped/output.json | 146 +- .../output.json | 106 +- .../output.json | 66 +- .../output.json | 119 +- .../output.json | 92 +- .../function-name-function-method/output.json | 106 +- .../output.json | 66 +- .../output.json | 92 +- .../output.json | 106 +- .../output.json | 132 +- .../function-name-inside-function/output.json | 106 +- .../function-name-strict-body/output.json | 92 +- .../yield/function-name-strict/output.json | 92 +- .../input-not-followed-by-regex/output.json | 132 +- .../inside-arrow-inside-generator/output.json | 172 +- .../output.json | 159 +- .../output.json | 145 +- .../output.json | 251 +- .../output.json | 159 +- .../output.json | 199 +- .../output.json | 171 +- .../output.json | 145 +- .../output.json | 106 +- .../output.json | 147 +- .../output.json | 107 +- .../output.json | 132 +- .../output.json | 106 +- .../parameter-default-strict/output.json | 133 +- .../output.json | 132 +- .../output.json | 118 +- .../output.json | 132 +- .../output.json | 146 +- .../output.json | 79 +- .../yield/parameter-name-arrow/output.json | 79 +- .../yield/parameter-name-function/output.json | 80 +- .../output.json | 106 +- .../parameter-name-generator/output.json | 80 +- .../parameter-name-strict-body/output.json | 106 +- .../yield/parameter-name-strict/output.json | 106 +- .../es2015/yield/yield class/output.json | 118 +- .../yield/yield-as-identifier/output.json | 79 +- .../output.json | 106 +- .../output.json | 79 +- .../output.json | 106 +- .../output.json | 105 +- .../output.json | 159 +- .../output.json | 118 +- .../output.json | 134 +- .../output.json | 119 +- .../es2015/yield/yield-yield/output.json | 117 +- .../exponentiation-operator/1/output.json | 78 +- .../exponentiation-operator/10/output.json | 91 +- .../exponentiation-operator/11/output.json | 91 +- .../exponentiation-operator/12/output.json | 91 +- .../exponentiation-operator/15/output.json | 104 +- .../exponentiation-operator/16/output.json | 104 +- .../exponentiation-operator/2/output.json | 93 +- .../exponentiation-operator/3/output.json | 79 +- .../exponentiation-operator/4/output.json | 105 +- .../exponentiation-operator/5/output.json | 104 +- .../exponentiation-operator/6/output.json | 104 +- .../exponentiation-operator/7/output.json | 119 +- .../exponentiation-operator/8/output.json | 119 +- .../exponentiation-operator/9/output.json | 93 +- .../array-pattern-default/output.json | 159 +- .../array-pattern/output.json | 133 +- .../arrow-function-concise-body/output.json | 133 +- .../arrow-function/output.json | 158 +- .../output.json | 133 +- .../async-arrow-function/output.json | 158 +- .../async-function/output.json | 132 +- .../simple-parameter-list/default/output.json | 132 +- .../generator-function/output.json | 132 +- .../generator-method/output.json | 185 +- .../simple-parameter-list/method/output.json | 185 +- .../object-pattern-default/output.json | 213 +- .../object-pattern/output.json | 187 +- .../simple-parameter-list/rest/output.json | 119 +- .../es2017/async-functions/1/output.json | 65 +- .../es2017/async-functions/11/output.json | 93 +- .../es2017/async-functions/12/output.json | 120 +- .../es2017/async-functions/13/output.json | 159 +- .../es2017/async-functions/14/output.json | 146 +- .../es2017/async-functions/15/output.json | 213 +- .../es2017/async-functions/16/output.json | 160 +- .../es2017/async-functions/17/output.json | 134 +- .../es2017/async-functions/18/output.json | 146 +- .../es2017/async-functions/19/output.json | 147 +- .../es2017/async-functions/2/output.json | 119 +- .../es2017/async-functions/20/output.json | 107 +- .../es2017/async-functions/21/output.json | 158 +- .../es2017/async-functions/22/output.json | 106 +- .../es2017/async-functions/23/output.json | 119 +- .../es2017/async-functions/24/output.json | 119 +- .../es2017/async-functions/25/output.json | 79 +- .../es2017/async-functions/26/output.json | 189 +- .../es2017/async-functions/27/output.json | 172 +- .../es2017/async-functions/28/output.json | 146 +- .../es2017/async-functions/29/output.json | 172 +- .../es2017/async-functions/30/output.json | 146 +- .../es2017/async-functions/31/output.json | 186 +- .../es2017/async-functions/32/output.json | 213 +- .../es2017/async-functions/33/output.json | 186 +- .../es2017/async-functions/34/output.json | 213 +- .../es2017/async-functions/37/output.json | 146 +- .../es2017/async-functions/38/output.json | 120 +- .../es2017/async-functions/7/output.json | 120 +- .../es2017/async-functions/8/output.json | 146 +- .../allow-await-outside-function/output.json | 65 +- .../output.json | 79 +- .../output.json | 79 +- .../output.json | 66 +- .../output.json | 79 +- .../output.json | 172 +- .../output.json | 106 +- .../output.json | 119 +- .../output.json | 147 +- .../output.json | 212 +- .../output.json | 159 +- .../output.json | 92 +- .../output.json | 174 +- .../await-inside-class-methods/output.json | 157 +- .../output.json | 130 +- .../output.json | 158 +- .../output.json | 158 +- .../await-inside-parameters/output.json | 119 +- .../output.json | 132 +- .../output.json | 172 +- .../output.json | 146 +- .../context-regex-after-statement/output.json | 92 +- .../async-functions/export-arrow/output.json | 92 +- .../export-default-newline/output.json | 93 +- .../es2017/async-functions/export/output.json | 132 +- .../invalid-inside-loop/output.json | 92 +- .../async-functions/newline-arrow/output.json | 107 +- .../async-functions/newline/output.json | 93 +- .../no-constructor/output.json | 106 +- .../object-default-params/output.json | 172 +- .../output.json | 92 +- .../trailing-function-commas/1/output.json | 106 +- .../trailing-function-commas/2/output.json | 108 +- .../trailing-function-commas/3/output.json | 120 +- .../trailing-function-commas/4/output.json | 93 +- .../class-method-2/output.json | 106 +- .../async-generators/class-method/output.json | 306 +- .../async-generators/for-await/output.json | 146 +- .../object-method/output.json | 319 +- .../es2018/object-rest-spread/1/output.json | 106 +- .../es2018/object-rest-spread/10/output.json | 161 +- .../es2018/object-rest-spread/11/output.json | 226 +- .../es2018/object-rest-spread/12/output.json | 226 +- .../es2018/object-rest-spread/13/output.json | 266 +- .../es2018/object-rest-spread/14/output.json | 253 +- .../es2018/object-rest-spread/15/output.json | 266 +- .../es2018/object-rest-spread/18/output.json | 104 +- .../es2018/object-rest-spread/2/output.json | 147 +- .../es2018/object-rest-spread/21/output.json | 131 +- .../es2018/object-rest-spread/24/output.json | 104 +- .../es2018/object-rest-spread/3/output.json | 146 +- .../es2018/object-rest-spread/4/output.json | 106 +- .../es2018/object-rest-spread/5/output.json | 147 +- .../es2018/object-rest-spread/6/output.json | 229 +- .../es2018/object-rest-spread/8/output.json | 188 +- .../comma-after-spread/output.json | 79 +- .../directive-line-separator/output.json | 78 +- .../directive-paragraph-separator/output.json | 78 +- .../string-line-separator/output.json | 78 +- .../string-paragraph-separator/output.json | 78 +- .../template-line-separator/output.json | 91 +- .../template-paragraph-separator/output.json | 91 +- .../no-binding-finally/output.json | 91 +- .../no-binding/output.json | 78 +- .../decimal-as-property-name/output.json | 91 +- .../bigint/hex-as-property-name/output.json | 91 +- .../es2020/bigint/invalid-decimal/output.json | 52 +- .../es2020/bigint/invalid-e/output.json | 52 +- .../invalid-non-octal-decimal-int/output.json | 52 +- .../bigint/invalid-octal-legacy/output.json | 52 +- .../es2020/bigint/valid-binary/output.json | 52 +- .../es2020/bigint/valid-hex/output.json | 52 +- .../es2020/bigint/valid-large/output.json | 52 +- .../es2020/bigint/valid-octal-new/output.json | 52 +- .../es2020/bigint/valid-small/output.json | 52 +- .../direct-calls-only/output.json | 133 +- .../dynamic-import/generator/output.json | 131 +- .../inside-function/output.json | 172 +- .../invalid-arguments-spread/output.json | 104 +- .../dynamic-import/invalid-new/output.json | 78 +- .../invalid-trailing-comma/output.json | 78 +- .../dynamic-import/multiple-args/output.json | 91 +- .../es2020/dynamic-import/no-args/output.json | 65 +- .../dynamic-import/parses-module/output.json | 78 +- .../dynamic-import/parses-strict/output.json | 104 +- .../dynamic-import/return-value/output.json | 105 +- .../dynamic-import/top-level/output.json | 341 +- .../variable-arguments/output.json | 198 +- .../export-ns-from/ns-and-named/output.json | 120 +- .../export-ns-from/ns-default/output.json | 79 +- .../es2020/export-ns-from/ns/output.json | 79 +- .../and-nullish/output.json | 107 +- .../associativity/output.json | 107 +- .../expression/output.json | 79 +- .../multiline/output.json | 107 +- .../nullish-and/output.json | 107 +- .../nullish-or/output.json | 107 +- .../or-nullish/output.json | 107 +- .../with-pipeline/output.json | 107 +- .../output.json | 377 +- .../class-contructor-call/output.json | 120 +- .../conditional-decimal/output.json | 156 +- .../function-call/output.json | 383 +- .../member-access-bracket/output.json | 454 +- .../member-access/output.json | 242 +- .../optioanl-chain-expression/output.json | 120 +- .../optional-constructor/output.json | 66 +- .../optional-super-property-class/output.json | 159 +- .../optional-super-property/output.json | 172 +- .../output.json | 119 +- .../parenthised-chain/output.json | 336 +- .../separated-chaining/output.json | 350 +- .../super-method-class/output.json | 186 +- .../migrated_0000/output.json | 106 +- .../migrated_0001/output.json | 106 +- .../migrated_0002/output.json | 92 +- .../migrated_0003/output.json | 159 +- .../migrated_0004/output.json | 105 +- .../migrated_0005/output.json | 144 +- .../migrated_0006/output.json | 144 +- .../migrated_0007/output.json | 105 +- .../migrated_0008/output.json | 144 +- .../migrated_0009/output.json | 144 +- .../migrated_0010/output.json | 105 +- .../migrated_0011/output.json | 144 +- .../migrated_0012/output.json | 144 +- .../migrated_0013/output.json | 93 +- .../migrated_0014/output.json | 132 +- .../migrated_0015/output.json | 132 +- .../migrated_0000/output.json | 79 +- .../migrated_0001/output.json | 92 +- .../migrated_0002/output.json | 172 +- .../dupe-param/output.json | 120 +- .../migrated_0000/output.json | 106 +- .../migrated_0001/output.json | 66 +- .../migrated_0002/output.json | 66 +- .../migrated_0003/output.json | 94 +- .../migrated_0004/output.json | 107 +- .../migrated_0005/output.json | 132 +- .../migrated_0006/output.json | 120 +- .../migrated_0007/output.json | 134 +- .../migrated_0008/output.json | 132 +- .../migrated_0009/output.json | 106 +- .../migrated_0010/output.json | 106 +- .../migrated_0011/output.json | 146 +- .../migrated_0012/output.json | 65 +- .../migrated_0013/output.json | 80 +- .../migrated_0014/output.json | 118 +- .../declaration-let/migrated_0000/output.json | 66 +- .../declaration-let/migrated_0001/output.json | 79 +- .../declaration-let/migrated_0002/output.json | 92 +- .../declaration-let/migrated_0003/output.json | 172 +- .../migrated_0000/output.json | 144 +- .../migrated_0001/output.json | 144 +- .../array-binding-pattern-01/output.json | 105 +- .../array-binding-pattern-02/output.json | 106 +- .../array-binding-pattern-03/output.json | 119 +- .../array-binding-pattern-empty/output.json | 78 +- .../elision/output.json | 84 +- .../invalid-dup-param/output.json | 146 +- .../dupe-param-1/output.json | 133 +- .../dupe-param-2/output.json | 146 +- .../dupe-param-3/output.json | 186 +- .../es2015-array-pattern/elision/output.json | 92 +- .../empty-pattern-catch-param/output.json | 91 +- .../empty-pattern-fn/output.json | 79 +- .../empty-pattern-lexical/output.json | 78 +- .../empty-pattern-var/output.json | 78 +- .../es2015-array-pattern/hole/output.json | 106 +- .../nested-pattern/output.json | 91 +- .../patterned-catch/output.json | 375 +- .../es2015-array-pattern/rest/output.json | 105 +- .../tailing-hold/output.json | 92 +- .../with-default-catch-param/output.json | 131 +- .../with-default-fn/output.json | 119 +- .../with-object-pattern/output.json | 132 +- .../output.json | 120 +- .../arrow-with-only-rest/output.json | 92 +- .../output.json | 119 +- .../invalid-duplicated-params/output.json | 94 +- .../invalid-param-strict-mode/output.json | 105 +- .../migrated_0000/output.json | 65 +- .../migrated_0001/output.json | 79 +- .../migrated_0002/output.json | 79 +- .../migrated_0003/output.json | 93 +- .../migrated_0004/output.json | 105 +- .../migrated_0005/output.json | 119 +- .../migrated_0006/output.json | 132 +- .../migrated_0007/output.json | 119 +- .../migrated_0008/output.json | 133 +- .../migrated_0009/output.json | 79 +- .../migrated_0010/output.json | 79 +- .../migrated_0011/output.json | 79 +- .../migrated_0012/output.json | 93 +- .../migrated_0013/output.json | 105 +- .../migrated_0014/output.json | 119 +- .../migrated_0015/output.json | 80 +- .../migrated_0016/output.json | 106 +- .../migrated_0017/output.json | 162 +- .../migrated_0018/output.json | 92 +- .../migrated_0019/output.json | 120 +- .../migrated_0020/output.json | 80 +- .../object-binding-pattern-01/output.json | 282 +- .../object-binding-pattern-empty/output.json | 78 +- .../output.json | 145 +- .../output.json | 118 +- .../output.json | 405 +- .../output.json | 146 +- .../output.json | 406 +- .../migrated_0000/output.json | 52 +- .../migrated_0001/output.json | 52 +- .../migrated_0002/output.json | 52 +- .../migrated_0003/output.json | 52 +- .../migrated_0004/output.json | 52 +- .../migrated_0005/output.json | 52 +- .../es2015-class/migrated_0000/output.json | 66 +- .../es2015-class/migrated_0001/output.json | 79 +- .../es2015-class/migrated_0002/output.json | 66 +- .../es2015-class/migrated_0003/output.json | 66 +- .../es2015-class/migrated_0004/output.json | 106 +- .../es2015-class/migrated_0005/output.json | 146 +- .../es2015-class/migrated_0006/output.json | 146 +- .../es2015-class/migrated_0007/output.json | 146 +- .../es2015-class/migrated_0008/output.json | 146 +- .../es2015-class/migrated_0009/output.json | 106 +- .../es2015-class/migrated_0010/output.json | 160 +- .../es2015-class/migrated_0011/output.json | 200 +- .../es2015-class/migrated_0012/output.json | 106 +- .../es2015-class/migrated_0013/output.json | 106 +- .../es2015-class/migrated_0014/output.json | 146 +- .../es2015-class/migrated_0015/output.json | 106 +- .../es2015-class/migrated_0016/output.json | 119 +- .../es2015-class/migrated_0017/output.json | 106 +- .../es2015-class/migrated_0018/output.json | 106 +- .../es2015-class/migrated_0019/output.json | 144 +- .../es2015-class/migrated_0020/output.json | 146 +- .../es2015-class/migrated_0021/output.json | 105 +- .../es2015-class/migrated_0022/output.json | 65 +- .../es2015-class/migrated_0023/output.json | 79 +- .../es2015-class/migrated_0024/output.json | 78 +- .../es2015-class/migrated_0025/output.json | 92 +- .../migrated_0000/output.json | 132 +- .../migrated_0001/output.json | 106 +- .../migrated_0002/output.json | 172 +- .../dup-assignment/output.json | 133 +- .../elision/output.json | 84 +- .../member-expr-in-rest/output.json | 131 +- .../nested-assignment/output.json | 238 +- .../nested-cover-grammar/output.json | 159 +- .../simple-assignment/output.json | 92 +- .../output.json | 78 +- .../invalid-lhs-01/output.json | 118 +- .../invalid-lhs-02/output.json | 118 +- .../invalid-pattern-with-method/output.json | 118 +- .../nested-cover-grammar/output.json | 432 +- .../object-pattern-assignment/output.json | 457 +- .../invalid-group-assignment/output.json | 134 +- .../export-const-number/output.json | 92 +- .../export-default-array/output.json | 52 +- .../export-default-class/output.json | 65 +- .../export-default-expression/output.json | 78 +- .../export-default-function/output.json | 65 +- .../export-default-named-function/output.json | 79 +- .../export-default-number/output.json | 52 +- .../export-default-object/output.json | 92 +- .../export-default-value/output.json | 53 +- .../export-from-batch/output.json | 52 +- .../export-from-default/output.json | 97 +- .../export-from-named-as-default/output.json | 97 +- .../output.json | 97 +- .../output.json | 138 +- .../export-from-specifier/output.json | 97 +- .../export-from-specifiers/output.json | 138 +- .../export-function-declaration/output.json | 105 +- .../export-function/output.json | 79 +- .../export-let-number/output.json | 92 +- .../export-named-as-default/output.json | 120 +- .../export-named-as-specifier/output.json | 147 +- .../export-named-as-specifiers/output.json | 188 +- .../export-named-empty/output.json | 43 +- .../export-named-specifier/output.json | 120 +- .../export-named-specifiers-comma/output.json | 201 +- .../export-named-specifiers/output.json | 201 +- .../export-var-anonymous-function/output.json | 105 +- .../export-var-number/output.json | 92 +- .../export-var/output.json | 79 +- .../invalid-export-named-default/output.json | 80 +- .../for-of-array-pattern-let/output.json | 133 +- .../for-of-array-pattern/output.json | 107 +- .../for-of-object-pattern-const/output.json | 187 +- .../for-of-object-pattern/output.json | 161 +- .../for-of-with-const/output.json | 106 +- .../es2015-for-of/for-of-with-let/output.json | 106 +- .../es2015-for-of/for-of-with-var/output.json | 106 +- .../esprima/es2015-for-of/for-of/output.json | 80 +- .../invalid-const-init/output.json | 119 +- .../invalid-let-init/output.json | 119 +- .../invalid-lhs-init/output.json | 79 +- .../invalid-var-init/output.json | 119 +- .../es2015-for-of/let-of-of/output.json | 106 +- .../output.json | 108 +- .../output.json | 105 +- .../output.json | 105 +- .../generator-declaration/output.json | 66 +- .../output.json | 92 +- .../output.json | 107 +- .../output.json | 147 +- .../output.json | 104 +- .../generator-expression/output.json | 65 +- .../output.json | 144 +- .../generator-method-with-params/output.json | 134 +- .../output.json | 131 +- .../output.json | 131 +- .../output.json | 144 +- .../generator-method-with-yield/output.json | 118 +- .../generator-method/output.json | 92 +- .../output.json | 106 +- .../static-generator-method/output.json | 106 +- .../dakuten_handakuten/output.json | 80 +- .../es2015-identifier/escaped_all/output.json | 66 +- .../escaped_math_alef/output.json | 66 +- .../escaped_math_dal_part/output.json | 66 +- .../escaped_math_kaf_lam/output.json | 66 +- .../escaped_math_zain_start/output.json | 66 +- .../escaped_part/output.json | 66 +- .../escaped_start/output.json | 66 +- .../es2015-identifier/estimated/output.json | 66 +- .../ethiopic_digits/output.json | 66 +- .../output.json | 66 +- .../invalid_expression_await/output.json | 119 +- .../invalid_var_await/output.json | 79 +- .../es2015-identifier/math_alef/output.json | 66 +- .../math_dal_part/output.json | 66 +- .../math_kaf_lam/output.json | 66 +- .../math_zain_start/output.json | 66 +- .../module_await/output.json | 79 +- .../es2015-identifier/valid_await/output.json | 93 +- .../es2015-identifier/weierstrass/output.json | 66 +- .../weierstrass_weierstrass/output.json | 66 +- .../output.json | 120 +- .../output.json | 106 +- .../import-default-as/output.json | 93 +- .../import-default/output.json | 79 +- .../import-jquery/output.json | 79 +- .../import-module/output.json | 52 +- .../import-named-as-specifier/output.json | 93 +- .../import-named-as-specifiers/output.json | 134 +- .../import-named-empty/output.json | 52 +- .../import-named-specifier/output.json | 93 +- .../import-named-specifiers-comma/output.json | 134 +- .../import-named-specifiers/output.json | 134 +- .../import-namespace-specifier/output.json | 79 +- .../import-null-as-nil/output.json | 93 +- .../output.json | 65 +- .../invalid_const_forin/output.json | 119 +- .../invalid_let_forin/output.json | 119 +- .../migrated_0000/output.json | 145 +- .../assign-new-target/output.json | 147 +- .../invalid-new-target/output.json | 107 +- .../new-new-target/output.json | 133 +- .../new-target-declaration/output.json | 120 +- .../new-target-expression/output.json | 146 +- .../new-target-invoke/output.json | 133 +- .../new-target-precedence/output.json | 146 +- .../unknown-property/output.json | 146 +- .../migrated_0000/output.json | 119 +- .../migrated_0001/output.json | 133 +- .../migrated_0002/output.json | 118 +- .../migrated_0003/output.json | 119 +- .../migrated_0004/output.json | 119 +- .../output.json | 171 +- .../output.json | 131 +- .../invalid-proto-identifiers/output.json | 132 +- .../output.json | 131 +- .../invalid-proto-literals/output.json | 130 +- .../output.json | 185 +- .../output.json | 186 +- .../proto-identifier-getter/output.json | 132 +- .../proto-identifier-method/output.json | 132 +- .../proto-identifier-setter/output.json | 146 +- .../proto-identifier-shorthand/output.json | 133 +- .../proto-literal-getter-setter/output.json | 185 +- .../proto-literal-getter/output.json | 131 +- .../proto-literal-method/output.json | 131 +- .../proto-literal-setter/output.json | 145 +- .../proto-literal-shorthand/output.json | 132 +- .../proto-shorthand-identifier/output.json | 133 +- .../proto-shorthand-literal/output.json | 132 +- .../proto-shorthands/output.json | 134 +- .../migrated_0000/output.json | 161 +- .../es2015-object-pattern/elision/output.json | 119 +- .../empty-catch-param/output.json | 91 +- .../empty-fn/output.json | 79 +- .../empty-for-lex/output.json | 104 +- .../empty-lexical/output.json | 78 +- .../empty-var/output.json | 78 +- .../es2015-object-pattern/nested/output.json | 118 +- .../properties/output.json | 348 +- .../migrated_0000/output.json | 52 +- .../migrated_0001/output.json | 52 +- .../migrated_0002/output.json | 118 +- .../migrated_0003/output.json | 52 +- .../migrated_0004/output.json | 52 +- .../migrated_0005/output.json | 52 +- .../migrated_0006/output.json | 118 +- .../function-declaration/output.json | 107 +- .../function-expression/output.json | 133 +- .../object-method/output.json | 173 +- .../object-shorthand-method/output.json | 146 +- .../call-multi-spread/output.json | 147 +- .../call-spread-default/output.json | 134 +- .../call-spread-first/output.json | 121 +- .../call-spread-number/output.json | 92 +- .../call-spread/output.json | 93 +- .../new-multi-spread/output.json | 147 +- .../new-spread-default/output.json | 134 +- .../new-spread-first/output.json | 121 +- .../new-spread-number/output.json | 92 +- .../new-spread/output.json | 93 +- .../arrow_super/output.json | 172 +- .../constructor_super/output.json | 159 +- .../output.json | 92 +- .../new_super/output.json | 186 +- .../super_computed/output.json | 172 +- .../super_member/output.json | 173 +- .../dollar-sign/output.json | 65 +- .../escape-sequences/output.json | 65 +- .../invalid-escape/output.json | 65 +- .../line-terminators/output.json | 65 +- .../literal-escape-sequences/output.json | 65 +- .../new-expression/output.json | 105 +- .../tagged-interpolation/output.json | 119 +- .../output.json | 196 +- .../tagged/output.json | 92 +- .../untagged/output.json | 65 +- .../migrated_0000/output.json | 52 +- .../migrated_0001/output.json | 52 +- .../migrated_0002/output.json | 52 +- .../output.json | 158 +- .../output.json | 118 +- .../output.json | 160 +- .../invalid-yield-generator-catch/output.json | 132 +- .../output.json | 106 +- .../output.json | 79 +- .../output.json | 79 +- .../output.json | 79 +- .../output.json | 106 +- .../output.json | 106 +- .../output.json | 106 +- .../output.json | 80 +- .../invalid-yield-generator-rest/output.json | 135 +- .../output.json | 172 +- .../output.json | 172 +- .../output.json | 106 +- .../output.json | 119 +- .../output.json | 132 +- .../output.json | 105 +- .../output.json | 146 +- .../output.json | 118 +- .../output.json | 106 +- .../output.json | 92 +- .../output.json | 105 +- .../output.json | 119 +- .../output.json | 105 +- .../output.json | 119 +- .../output.json | 92 +- .../yield-array-pattern/output.json | 93 +- .../yield-arrow-concise-body/output.json | 107 +- .../yield-arrow-function-body/output.json | 133 +- .../yield-arrow-parameter-default/output.json | 106 +- .../yield-arrow-parameter-name/output.json | 79 +- .../yield-binding-element/output.json | 120 +- .../yield-binding-property/output.json | 120 +- .../output.json | 133 +- .../yield-catch-parameter/output.json | 92 +- .../yield-expression-precedence/output.json | 214 +- .../output.json | 80 +- .../yield-function-declaration/output.json | 66 +- .../output.json | 79 +- .../yield-function-expression/output.json | 79 +- .../output.json | 147 +- .../yield-generator-arrow-default/output.json | 145 +- .../output.json | 173 +- .../yield-generator-declaration/output.json | 66 +- .../output.json | 146 +- .../output.json | 146 +- .../yield-generator-method/output.json | 92 +- .../output.json | 120 +- .../yield-lexical-declaration/output.json | 79 +- .../output.json | 133 +- .../es2015-yield/yield-method/output.json | 92 +- .../output.json | 120 +- .../yield-rest-parameter/output.json | 93 +- .../yield-strict-binding-property/output.json | 146 +- .../yield-strict-method/output.json | 118 +- .../yield-super-property/output.json | 173 +- .../yield-variable-declaration/output.json | 66 +- .../output.json | 105 +- .../yield-yield-expression/output.json | 105 +- .../migrated_0000/output.json | 80 +- .../migrated_0001/output.json | 80 +- .../migrated_0002/output.json | 78 +- .../migrated_0000/output.json | 79 +- .../migrated_0001/output.json | 79 +- .../migrated_0002/output.json | 79 +- .../migrated_0003/output.json | 79 +- .../migrated_0004/output.json | 79 +- .../migrated_0005/output.json | 79 +- .../migrated_0006/output.json | 79 +- .../migrated_0007/output.json | 79 +- .../migrated_0008/output.json | 79 +- .../migrated_0009/output.json | 79 +- .../migrated_0010/output.json | 79 +- .../migrated_0011/output.json | 79 +- .../migrated_0012/output.json | 79 +- .../migrated_0013/output.json | 79 +- .../migrated_0000/output.json | 80 +- .../migrated_0001/output.json | 80 +- .../migrated_0002/output.json | 80 +- .../migrated_0000/output.json | 80 +- .../migrated_0001/output.json | 80 +- .../migrated_0002/output.json | 107 +- .../migrated_0003/output.json | 107 +- .../migrated_0004/output.json | 107 +- .../migrated_0005/output.json | 107 +- .../migrated_0000/output.json | 107 +- .../migrated_0001/output.json | 107 +- .../migrated_0002/output.json | 107 +- .../migrated_0003/output.json | 107 +- .../migrated_0004/output.json | 107 +- .../migrated_0005/output.json | 107 +- .../migrated_0006/output.json | 107 +- .../migrated_0007/output.json | 107 +- .../migrated_0008/output.json | 107 +- .../migrated_0009/output.json | 107 +- .../migrated_0010/output.json | 107 +- .../migrated_0011/output.json | 107 +- .../migrated_0012/output.json | 107 +- .../migrated_0013/output.json | 107 +- .../migrated_0014/output.json | 107 +- .../migrated_0015/output.json | 107 +- .../migrated_0016/output.json | 107 +- .../migrated_0017/output.json | 107 +- .../migrated_0000/output.json | 80 +- .../migrated_0001/output.json | 80 +- .../migrated_0002/output.json | 80 +- .../migrated_0000/output.json | 323 +- .../migrated_0000/output.json | 92 +- .../migrated_0001/output.json | 119 +- .../migrated_0002/output.json | 118 +- .../migrated_0000/output.json | 80 +- .../migrated_0001/output.json | 80 +- .../migrated_0002/output.json | 80 +- .../migrated_0003/output.json | 80 +- .../migrated_0000/output.json | 104 +- .../migrated_0001/output.json | 104 +- .../migrated_0000/output.json | 66 +- .../migrated_0001/output.json | 66 +- .../migrated_0002/output.json | 79 +- .../migrated_0003/output.json | 79 +- .../migrated_0004/output.json | 106 +- .../migrated_0005/output.json | 93 +- .../migrated_0006/output.json | 93 +- .../migrated_0007/output.json | 106 +- .../migrated_0008/output.json | 94 +- .../migrated_0009/output.json | 66 +- .../migrated_0010/output.json | 80 +- .../migrated_0011/output.json | 107 +- .../migrated_0012/output.json | 134 +- .../migrated_0013/output.json | 107 +- .../migrated_0014/output.json | 80 +- .../migrated_0015/output.json | 106 +- .../migrated_0016/output.json | 106 +- .../migrated_0017/output.json | 185 +- .../migrated_0018/output.json | 160 +- .../migrated_0019/output.json | 80 +- .../migrated_0020/output.json | 80 +- .../migrated_0021/output.json | 80 +- .../migrated_0022/output.json | 80 +- .../migrated_0000/output.json | 80 +- .../migrated_0001/output.json | 80 +- .../migrated_0002/output.json | 80 +- .../migrated_0000/output.json | 66 +- .../migrated_0001/output.json | 66 +- .../migrated_0002/output.json | 66 +- .../migrated_0003/output.json | 66 +- .../migrated_0004/output.json | 66 +- .../migrated_0005/output.json | 66 +- .../migrated_0000/output.json | 79 +- .../migrated_0001/output.json | 79 +- .../migrated_0002/output.json | 92 +- .../migrated_0003/output.json | 98 +- .../migrated_0004/output.json | 92 +- .../migrated_0005/output.json | 124 +- .../migrated_0006/output.json | 124 +- .../migrated_0007/output.json | 79 +- .../migrated_0008/output.json | 79 +- .../migrated_0009/output.json | 79 +- .../migrated_0010/output.json | 79 +- .../migrated_0011/output.json | 79 +- .../migrated_0012/output.json | 39 +- .../migrated_0000/output.json | 52 +- .../migrated_0001/output.json | 52 +- .../migrated_0002/output.json | 52 +- .../migrated_0003/output.json | 52 +- .../migrated_0004/output.json | 52 +- .../migrated_0005/output.json | 52 +- .../migrated_0006/output.json | 52 +- .../migrated_0007/output.json | 52 +- .../migrated_0008/output.json | 52 +- .../migrated_0009/output.json | 52 +- .../migrated_0010/output.json | 52 +- .../migrated_0011/output.json | 52 +- .../migrated_0012/output.json | 52 +- .../migrated_0013/output.json | 52 +- .../migrated_0014/output.json | 52 +- .../migrated_0015/output.json | 52 +- .../migrated_0016/output.json | 52 +- .../migrated_0017/output.json | 52 +- .../migrated_0018/output.json | 52 +- .../migrated_0019/output.json | 52 +- .../migrated_0020/output.json | 52 +- .../migrated_0021/output.json | 52 +- .../migrated_0022/output.json | 52 +- .../migrated_0023/output.json | 52 +- .../migrated_0024/output.json | 52 +- .../migrated_0000/output.json | 52 +- .../migrated_0001/output.json | 65 +- .../migrated_0002/output.json | 79 +- .../migrated_0003/output.json | 79 +- .../migrated_0004/output.json | 79 +- .../migrated_0007/output.json | 79 +- .../migrated_0008/output.json | 79 +- .../migrated_0009/output.json | 79 +- .../migrated_0010/output.json | 79 +- .../migrated_0011/output.json | 79 +- .../migrated_0012/output.json | 79 +- .../migrated_0013/output.json | 106 +- .../u-flag-surrogate-pair/output.json | 79 +- .../u-flag-valid-range/output.json | 79 +- .../migrated_0000/output.json | 52 +- .../migrated_0001/output.json | 52 +- .../migrated_0002/output.json | 52 +- .../migrated_0003/output.json | 52 +- .../migrated_0006/output.json | 52 +- .../migrated_0007/output.json | 52 +- .../migrated_0008/output.json | 52 +- .../migrated_0009/output.json | 52 +- .../migrated_0010/output.json | 52 +- .../migrated_0011/output.json | 52 +- .../migrated_0012/output.json | 52 +- .../migrated_0013/output.json | 52 +- .../migrated_0015/output.json | 52 +- .../migrated_0016/output.json | 52 +- .../migrated_0017/output.json | 52 +- .../migrated_0018/output.json | 52 +- .../migrated_0000/output.json | 79 +- .../migrated_0001/output.json | 79 +- .../migrated_0002/output.json | 119 +- .../migrated_0003/output.json | 119 +- .../migrated_0004/output.json | 119 +- .../migrated_0005/output.json | 119 +- .../migrated_0006/output.json | 119 +- .../migrated_0007/output.json | 118 +- .../migrated_0008/output.json | 159 +- .../migrated_0009/output.json | 146 +- .../migrated_0010/output.json | 119 +- .../migrated_0011/output.json | 119 +- .../migrated_0012/output.json | 119 +- .../migrated_0013/output.json | 119 +- .../migrated_0014/output.json | 119 +- .../migrated_0015/output.json | 118 +- .../migrated_0016/output.json | 118 +- .../migrated_0017/output.json | 187 +- .../migrated_0018/output.json | 187 +- .../migrated_0019/output.json | 187 +- .../migrated_0020/output.json | 187 +- .../migrated_0021/output.json | 187 +- .../migrated_0022/output.json | 186 +- .../migrated_0023/output.json | 186 +- .../migrated_0024/output.json | 119 +- .../migrated_0025/output.json | 119 +- .../migrated_0026/output.json | 119 +- .../migrated_0027/output.json | 118 +- .../migrated_0028/output.json | 254 +- .../migrated_0029/output.json | 132 +- .../migrated_0030/output.json | 185 +- .../migrated_0031/output.json | 185 +- .../migrated_0032/output.json | 185 +- .../migrated_0033/output.json | 199 +- .../migrated_0034/output.json | 92 +- .../migrated_0035/output.json | 105 +- .../migrated_0036/output.json | 130 +- .../migrated_0037/output.json | 91 +- .../migrated_0038/output.json | 132 +- .../migrated_0000/output.json | 52 +- .../migrated_0001/output.json | 52 +- .../migrated_0002/output.json | 52 +- .../migrated_0003/output.json | 104 +- .../migrated_0000/output.json | 80 +- .../migrated_0001/output.json | 80 +- .../migrated_0002/output.json | 80 +- .../migrated_0003/output.json | 80 +- .../migrated_0004/output.json | 80 +- .../migrated_0005/output.json | 80 +- .../migrated_0006/output.json | 107 +- .../migrated_0000/output.json | 66 +- .../migrated_0001/output.json | 66 +- .../migrated_0002/output.json | 66 +- .../migrated_0003/output.json | 66 +- .../migrated_0004/output.json | 66 +- .../migrated_0005/output.json | 66 +- .../migrated_0006/output.json | 66 +- .../migrated_0007/output.json | 66 +- .../migrated_0008/output.json | 66 +- .../migrated_0009/output.json | 66 +- .../migrated_0010/output.json | 66 +- .../migrated_0011/output.json | 66 +- .../migrated_0012/output.json | 66 +- .../invalid-syntax/GH-1106-00/output.json | 52 +- .../invalid-syntax/GH-1106-01/output.json | 52 +- .../invalid-syntax/GH-1106-02/output.json | 52 +- .../invalid-syntax/GH-1106-03/output.json | 52 +- .../invalid-syntax/GH-1106-04/output.json | 52 +- .../invalid-syntax/GH-1106-05/output.json | 52 +- .../invalid-syntax/GH-1106-06/output.json | 52 +- .../invalid-syntax/GH-1106-07/output.json | 52 +- .../invalid-syntax/migrated_0004/output.json | 52 +- .../invalid-syntax/migrated_0005/output.json | 52 +- .../invalid-syntax/migrated_0006/output.json | 52 +- .../invalid-syntax/migrated_0009/output.json | 52 +- .../invalid-syntax/migrated_0012/output.json | 52 +- .../invalid-syntax/migrated_0013/output.json | 52 +- .../invalid-syntax/migrated_0014/output.json | 52 +- .../invalid-syntax/migrated_0015/output.json | 52 +- .../invalid-syntax/migrated_0017/output.json | 52 +- .../invalid-syntax/migrated_0019/output.json | 52 +- .../invalid-syntax/migrated_0020/output.json | 52 +- .../invalid-syntax/migrated_0021/output.json | 52 +- .../invalid-syntax/migrated_0022/output.json | 52 +- .../invalid-syntax/migrated_0024/output.json | 52 +- .../invalid-syntax/migrated_0025/output.json | 52 +- .../invalid-syntax/migrated_0026/output.json | 52 +- .../invalid-syntax/migrated_0027/output.json | 52 +- .../invalid-syntax/migrated_0028/output.json | 52 +- .../invalid-syntax/migrated_0032/output.json | 53 +- .../invalid-syntax/migrated_0033/output.json | 53 +- .../invalid-syntax/migrated_0034/output.json | 53 +- .../invalid-syntax/migrated_0036/output.json | 53 +- .../invalid-syntax/migrated_0037/output.json | 39 +- .../invalid-syntax/migrated_0041/output.json | 79 +- .../invalid-syntax/migrated_0042/output.json | 79 +- .../invalid-syntax/migrated_0043/output.json | 79 +- .../invalid-syntax/migrated_0044/output.json | 79 +- .../invalid-syntax/migrated_0045/output.json | 78 +- .../invalid-syntax/migrated_0046/output.json | 92 +- .../invalid-syntax/migrated_0047/output.json | 104 +- .../invalid-syntax/migrated_0049/output.json | 39 +- .../invalid-syntax/migrated_0050/output.json | 53 +- .../invalid-syntax/migrated_0051/output.json | 39 +- .../invalid-syntax/migrated_0052/output.json | 65 +- .../invalid-syntax/migrated_0053/output.json | 65 +- .../invalid-syntax/migrated_0054/output.json | 65 +- .../invalid-syntax/migrated_0055/output.json | 65 +- .../invalid-syntax/migrated_0056/output.json | 146 +- .../invalid-syntax/migrated_0064/output.json | 79 +- .../invalid-syntax/migrated_0066/output.json | 105 +- .../invalid-syntax/migrated_0067/output.json | 92 +- .../invalid-syntax/migrated_0075/output.json | 105 +- .../invalid-syntax/migrated_0087/output.json | 131 +- .../invalid-syntax/migrated_0088/output.json | 105 +- .../invalid-syntax/migrated_0089/output.json | 105 +- .../invalid-syntax/migrated_0090/output.json | 119 +- .../invalid-syntax/migrated_0091/output.json | 119 +- .../invalid-syntax/migrated_0092/output.json | 93 +- .../invalid-syntax/migrated_0093/output.json | 119 +- .../invalid-syntax/migrated_0094/output.json | 105 +- .../invalid-syntax/migrated_0098/output.json | 78 +- .../invalid-syntax/migrated_0099/output.json | 91 +- .../invalid-syntax/migrated_0100/output.json | 105 +- .../invalid-syntax/migrated_0101/output.json | 131 +- .../invalid-syntax/migrated_0116/output.json | 39 +- .../invalid-syntax/migrated_0118/output.json | 39 +- .../invalid-syntax/migrated_0125/output.json | 105 +- .../invalid-syntax/migrated_0126/output.json | 92 +- .../invalid-syntax/migrated_0133/output.json | 52 +- .../invalid-syntax/migrated_0137/output.json | 79 +- .../invalid-syntax/migrated_0142/output.json | 105 +- .../invalid-syntax/migrated_0143/output.json | 79 +- .../invalid-syntax/migrated_0162/output.json | 53 +- .../invalid-syntax/migrated_0163/output.json | 53 +- .../invalid-syntax/migrated_0164/output.json | 53 +- .../invalid-syntax/migrated_0165/output.json | 53 +- .../invalid-syntax/migrated_0166/output.json | 79 +- .../invalid-syntax/migrated_0167/output.json | 79 +- .../invalid-syntax/migrated_0171/output.json | 39 +- .../invalid-syntax/migrated_0172/output.json | 39 +- .../invalid-syntax/migrated_0173/output.json | 39 +- .../invalid-syntax/migrated_0174/output.json | 79 +- .../invalid-syntax/migrated_0176/output.json | 92 +- .../invalid-syntax/migrated_0177/output.json | 92 +- .../invalid-syntax/migrated_0178/output.json | 158 +- .../invalid-syntax/migrated_0179/output.json | 158 +- .../invalid-syntax/migrated_0180/output.json | 144 +- .../invalid-syntax/migrated_0181/output.json | 144 +- .../invalid-syntax/migrated_0182/output.json | 158 +- .../invalid-syntax/migrated_0183/output.json | 144 +- .../invalid-syntax/migrated_0184/output.json | 144 +- .../invalid-syntax/migrated_0185/output.json | 145 +- .../invalid-syntax/migrated_0186/output.json | 145 +- .../invalid-syntax/migrated_0187/output.json | 158 +- .../invalid-syntax/migrated_0188/output.json | 158 +- .../invalid-syntax/migrated_0189/output.json | 145 +- .../invalid-syntax/migrated_0190/output.json | 145 +- .../invalid-syntax/migrated_0191/output.json | 132 +- .../invalid-syntax/migrated_0192/output.json | 132 +- .../invalid-syntax/migrated_0193/output.json | 132 +- .../invalid-syntax/migrated_0194/output.json | 132 +- .../invalid-syntax/migrated_0195/output.json | 132 +- .../invalid-syntax/migrated_0196/output.json | 132 +- .../invalid-syntax/migrated_0197/output.json | 132 +- .../invalid-syntax/migrated_0198/output.json | 132 +- .../invalid-syntax/migrated_0199/output.json | 132 +- .../invalid-syntax/migrated_0200/output.json | 132 +- .../invalid-syntax/migrated_0201/output.json | 92 +- .../invalid-syntax/migrated_0202/output.json | 92 +- .../invalid-syntax/migrated_0203/output.json | 158 +- .../invalid-syntax/migrated_0204/output.json | 158 +- .../invalid-syntax/migrated_0205/output.json | 118 +- .../invalid-syntax/migrated_0206/output.json | 118 +- .../invalid-syntax/migrated_0207/output.json | 185 +- .../invalid-syntax/migrated_0208/output.json | 118 +- .../invalid-syntax/migrated_0209/output.json | 212 +- .../invalid-syntax/migrated_0210/output.json | 172 +- .../invalid-syntax/migrated_0211/output.json | 199 +- .../invalid-syntax/migrated_0212/output.json | 106 +- .../invalid-syntax/migrated_0213/output.json | 106 +- .../invalid-syntax/migrated_0214/output.json | 146 +- .../invalid-syntax/migrated_0215/output.json | 146 +- .../invalid-syntax/migrated_0216/output.json | 78 +- .../invalid-syntax/migrated_0217/output.json | 120 +- .../invalid-syntax/migrated_0218/output.json | 120 +- .../invalid-syntax/migrated_0219/output.json | 157 +- .../invalid-syntax/migrated_0220/output.json | 157 +- .../invalid-syntax/migrated_0221/output.json | 118 +- .../invalid-syntax/migrated_0222/output.json | 144 +- .../invalid-syntax/migrated_0223/output.json | 158 +- .../invalid-syntax/migrated_0224/output.json | 132 +- .../invalid-syntax/migrated_0225/output.json | 132 +- .../invalid-syntax/migrated_0226/output.json | 132 +- .../invalid-syntax/migrated_0227/output.json | 132 +- .../invalid-syntax/migrated_0228/output.json | 132 +- .../invalid-syntax/migrated_0229/output.json | 132 +- .../invalid-syntax/migrated_0230/output.json | 132 +- .../invalid-syntax/migrated_0231/output.json | 132 +- .../invalid-syntax/migrated_0232/output.json | 132 +- .../invalid-syntax/migrated_0233/output.json | 106 +- .../invalid-syntax/migrated_0234/output.json | 92 +- .../invalid-syntax/migrated_0235/output.json | 106 +- .../invalid-syntax/migrated_0236/output.json | 106 +- .../invalid-syntax/migrated_0239/output.json | 92 +- .../invalid-syntax/migrated_0240/output.json | 120 +- .../invalid-syntax/migrated_0241/output.json | 106 +- .../invalid-syntax/migrated_0242/output.json | 106 +- .../invalid-syntax/migrated_0243/output.json | 173 +- .../invalid-syntax/migrated_0244/output.json | 133 +- .../invalid-syntax/migrated_0245/output.json | 173 +- .../invalid-syntax/migrated_0246/output.json | 119 +- .../invalid-syntax/migrated_0247/output.json | 119 +- .../invalid-syntax/migrated_0248/output.json | 106 +- .../invalid-syntax/migrated_0249/output.json | 120 +- .../invalid-syntax/migrated_0250/output.json | 159 +- .../invalid-syntax/migrated_0270/output.json | 106 +- .../invalid-syntax/migrated_0271/output.json | 105 +- .../invalid-syntax/migrated_0272/output.json | 106 +- .../invalid-syntax/migrated_0273/output.json | 120 +- .../invalid-syntax/migrated_0274/output.json | 145 +- .../invalid-syntax/migrated_0277/output.json | 120 +- .../invalid-syntax/migrated_0278/output.json | 106 +- .../arrow-rest-parameter-array/output.json | 120 +- .../arrow-rest-parameter-object/output.json | 147 +- .../function-declaration/output.json | 107 +- .../function-expression/output.json | 133 +- .../invalid-setter-rest/output.json | 146 +- .../rest-parameter/object-method/output.json | 173 +- .../object-shorthand-method/output.json | 146 +- .../rest-parameter-array/output.json | 106 +- .../rest-parameter-object/output.json | 133 +- .../statement-block/migrated_0000/output.json | 66 +- .../statement-block/migrated_0001/output.json | 119 +- .../statement-block/migrated_0002/output.json | 39 +- .../statement-break/migrated_0000/output.json | 78 +- .../statement-break/migrated_0001/output.json | 119 +- .../statement-break/migrated_0002/output.json | 119 +- .../statement-break/migrated_0003/output.json | 119 +- .../migrated_0000/output.json | 78 +- .../migrated_0001/output.json | 78 +- .../migrated_0002/output.json | 119 +- .../migrated_0003/output.json | 119 +- .../migrated_0004/output.json | 119 +- .../migrated_0000/output.json | 39 +- .../statement-empty/migrated_0000/output.json | 39 +- .../migrated_0000/output.json | 53 +- .../migrated_0001/output.json | 80 +- .../migrated_0002/output.json | 53 +- .../migrated_0003/output.json | 53 +- .../migrated_0004/output.json | 53 +- .../migrated_0005/output.json | 53 +- .../statement-if/migrated_0000/output.json | 93 +- .../statement-if/migrated_0001/output.json | 92 +- .../statement-if/migrated_0002/output.json | 106 +- .../statement-if/migrated_0004/output.json | 133 +- .../statement-if/migrated_0005/output.json | 105 +- .../statement-if/migrated_0006/output.json | 105 +- .../const_forin/output.json | 147 +- .../for-statement-with-seq/output.json | 107 +- .../migrated_0000/output.json | 92 +- .../migrated_0001/output.json | 92 +- .../migrated_0002/output.json | 172 +- .../migrated_0003/output.json | 104 +- .../migrated_0004/output.json | 92 +- .../migrated_0005/output.json | 92 +- .../migrated_0006/output.json | 92 +- .../migrated_0007/output.json | 172 +- .../migrated_0008/output.json | 52 +- .../migrated_0009/output.json | 52 +- .../migrated_0010/output.json | 92 +- .../migrated_0011/output.json | 105 +- .../migrated_0012/output.json | 105 +- .../migrated_0013/output.json | 145 +- .../migrated_0014/output.json | 132 +- .../migrated_0015/output.json | 159 +- .../migrated_0016/output.json | 200 +- .../migrated_0017/output.json | 121 +- .../migrated_0018/output.json | 147 +- .../migrated_0020/output.json | 147 +- .../migrated_0024/output.json | 134 +- .../migrated_0025/output.json | 160 +- .../migrated_0026/output.json | 107 +- .../migrated_0000/output.json | 93 +- .../migrated_0001/output.json | 106 +- .../migrated_0002/output.json | 80 +- .../migrated_0000/output.json | 78 +- .../migrated_0001/output.json | 78 +- .../migrated_0002/output.json | 92 +- .../migrated_0003/output.json | 119 +- .../migrated_0000/output.json | 53 +- .../migrated_0001/output.json | 132 +- .../migrated_0002/output.json | 158 +- .../statement-throw/migrated_0000/output.json | 53 +- .../statement-throw/migrated_0001/output.json | 80 +- .../statement-throw/migrated_0002/output.json | 92 +- .../statement-try/migrated_0000/output.json | 92 +- .../statement-try/migrated_0001/output.json | 92 +- .../statement-try/migrated_0002/output.json | 92 +- .../statement-try/migrated_0003/output.json | 146 +- .../statement-try/migrated_0004/output.json | 119 +- .../statement-try/migrated_0005/output.json | 186 +- .../statement-try/migrated_0006/output.json | 253 +- .../complex-pattern-requires-init/output.json | 65 +- .../migrated_0000/output.json | 66 +- .../migrated_0001/output.json | 93 +- .../migrated_0002/output.json | 79 +- .../migrated_0003/output.json | 119 +- .../migrated_0004/output.json | 159 +- .../migrated_0005/output.json | 120 +- .../migrated_0006/output.json | 147 +- .../statement-with/migrated_0000/output.json | 107 +- .../statement-with/migrated_0001/output.json | 107 +- .../statement-with/migrated_0002/output.json | 120 +- .../fixtures/estree/bigInt/basic/output.json | 79 +- .../estree/class-method/basic/output.json | 119 +- .../estree/class-method/flow/output.json | 320 +- .../class-method/typescript/output.json | 172 +- .../estree/directives/block/output.json | 171 +- .../function-non-strict/output.json | 144 +- .../directives/program-order/output.json | 118 +- .../estree/directives/program/output.json | 131 +- .../estree/directives/raw/output.json | 52 +- .../estree/dynamic-import/basic/output.json | 92 +- .../fixtures/estree/export/batch/output.json | 52 +- .../estree/export/ns-from/output.json | 66 +- .../string-literal-annotation/output.json | 92 +- .../estree/literal/boolean/output.json | 132 +- .../fixtures/estree/literal/null/output.json | 79 +- .../estree/literal/number/output.json | 79 +- .../estree/literal/regexp/output.json | 79 +- .../estree/literal/string/output.json | 79 +- .../estree/object-method/basic/output.json | 132 +- .../estree/object-property/basic/output.json | 119 +- .../estree/typescript/enum/output.json | 106 +- .../typescript/import-require/output.json | 79 +- .../estree/typescript/import/output.json | 357 +- .../estree/typescript/literals/output.json | 423 +- .../async-generator/output.json | 519 +- .../class-private-methods/async/output.json | 172 +- .../combined/output.json | 545 +- .../failure-name-constructor/output.json | 119 +- .../failure-spaces/output.json | 159 +- .../generator/output.json | 172 +- .../class-private-methods/get-set/output.json | 280 +- .../class-private-methods/method/output.json | 159 +- .../instance-field-instance-field/output.json | 172 +- .../instance-field-instance-get/output.json | 172 +- .../output.json | 172 +- .../instance-field-instance-set/output.json | 186 +- .../instance-field-static-field/output.json | 172 +- .../instance-field-static-get/output.json | 172 +- .../instance-field-static-method/output.json | 172 +- .../instance-field-static-set/output.json | 186 +- .../instance-get-instance-field/output.json | 172 +- .../instance-get-instance-get/output.json | 172 +- .../instance-get-instance-method/output.json | 172 +- .../instance-get-instance-set/output.json | 186 +- .../instance-get-static-field/output.json | 172 +- .../instance-get-static-get/output.json | 172 +- .../instance-get-static-method/output.json | 172 +- .../instance-get-static-set/output.json | 186 +- .../output.json | 172 +- .../instance-method-instance-get/output.json | 172 +- .../output.json | 172 +- .../instance-method-instance-set/output.json | 186 +- .../instance-method-static-field/output.json | 172 +- .../instance-method-static-get/output.json | 172 +- .../instance-method-static-method/output.json | 172 +- .../instance-method-static-set/output.json | 186 +- .../instance-set-instance-field/output.json | 186 +- .../instance-set-instance-get/output.json | 186 +- .../instance-set-instance-method/output.json | 186 +- .../instance-set-instance-set/output.json | 200 +- .../instance-set-static-field/output.json | 186 +- .../instance-set-static-get/output.json | 186 +- .../instance-set-static-method/output.json | 186 +- .../instance-set-static-set/output.json | 200 +- .../static-field-instance-field/output.json | 172 +- .../static-field-instance-get/output.json | 172 +- .../static-field-instance-method/output.json | 172 +- .../static-field-instance-set/output.json | 186 +- .../static-field-static-field/output.json | 172 +- .../static-field-static-get/output.json | 172 +- .../static-field-static-method/output.json | 172 +- .../static-field-static-set/output.json | 186 +- .../static-get-instance-field/output.json | 172 +- .../static-get-instance-get/output.json | 172 +- .../static-get-instance-method/output.json | 172 +- .../static-get-instance-set/output.json | 186 +- .../static-get-static-field/output.json | 172 +- .../static-get-static-get/output.json | 172 +- .../static-get-static-method/output.json | 172 +- .../static-get-static-set/output.json | 186 +- .../static-method-instance-field/output.json | 172 +- .../static-method-instance-get/output.json | 172 +- .../static-method-instance-method/output.json | 172 +- .../static-method-instance-set/output.json | 186 +- .../static-method-static-field/output.json | 172 +- .../static-method-static-get/output.json | 172 +- .../static-method-static-method/output.json | 172 +- .../static-method-static-set/output.json | 186 +- .../static-set-instance-field/output.json | 186 +- .../static-set-instance-get/output.json | 186 +- .../static-set-instance-method/output.json | 186 +- .../static-set-instance-set/output.json | 200 +- .../static-set-static-field/output.json | 186 +- .../static-set-static-get/output.json | 186 +- .../static-set-static-method/output.json | 186 +- .../static-set-static-set/output.json | 200 +- .../asi-success/output.json | 146 +- .../output.json | 145 +- .../output.json | 211 +- .../declared-later-outer-class/output.json | 279 +- .../declared-later-same-class/output.json | 199 +- .../output.json | 225 +- .../failure-name-constructor/output.json | 106 +- .../failure-spaces/output.json | 106 +- .../inline/output.json | 292 +- .../output.json | 252 +- .../invalid-destructuring/output.json | 265 +- .../invalid-object-method/output.json | 172 +- .../invalid-ts-type-literal/output.json | 132 +- .../nested/output.json | 3162 +---------- .../pbn-success/output.json | 1567 +---- .../static/output.json | 159 +- .../super-call/output.json | 240 +- .../super-private-member-access/output.json | 226 +- .../undeclared-nested/output.json | 240 +- .../undeclared-top-level/output.json | 120 +- .../arguments-in-arrow-function/output.json | 160 +- .../arguments-in-function/output.json | 200 +- .../arguments-in-key/output.json | 146 +- .../output.json | 254 +- .../arguments-in-nested-class/output.json | 240 +- .../class-properties/arguments/output.json | 147 +- .../class-properties/asi-success/output.json | 227 +- .../output.json | 145 +- .../output.json | 198 +- .../class-properties/computed/output.json | 226 +- .../class-properties/edge-cases/output.json | 1149 +--- .../class-properties/inline/output.json | 240 +- .../new-target-invalid/output.json | 107 +- .../new-target-with-flow/output.json | 902 +-- .../class-properties/new-target/output.json | 902 +-- .../class-properties/no-ctor-2/output.json | 133 +- .../class-properties/no-ctor/output.json | 93 +- .../no-static-prototype-2/output.json | 133 +- .../no-static-prototype/output.json | 93 +- .../output.json | 93 +- .../class-properties/super-call/output.json | 227 +- .../super-inside-arrow-function/output.json | 173 +- .../super-inside-function/output.json | 199 +- .../class-properties/super/output.json | 212 +- .../output.json | 199 +- .../output.json | 171 +- .../class-decorator-call-expr/output.json | 119 +- .../decorators-2/class-decorator/output.json | 93 +- .../decorators-2/class-expression/output.json | 240 +- .../decorators-2/class-generator/output.json | 133 +- .../decorators-2/class-property/output.json | 133 +- .../decorators-2/complex-expr/output.json | 255 +- .../decorators-2/compued-property/output.json | 160 +- .../output.json | 106 +- .../output.json | 106 +- .../output.json | 106 +- .../decoratorsBeforeExport-export/output.json | 106 +- .../export-decorated-class/output.json | 106 +- .../output.json | 106 +- .../decorators-2/get-decorator/output.json | 133 +- .../output.json | 213 +- .../nested-class-decorator/output.json | 186 +- .../output.json | 266 +- .../nested-method-decorator/output.json | 239 +- .../no-class-method-parameter/output.json | 147 +- .../no-constructor-decorators/output.json | 133 +- .../no-export-decorators-on-class/output.json | 92 +- .../no-function-parameters/output.json | 107 +- .../no-object-method-parameters/output.json | 160 +- .../no-object-methods/output.json | 146 +- .../on-computed-name-method/output.json | 132 +- .../decorators-2/parenthesized/output.json | 321 +- .../decorators-2/private-property/output.json | 146 +- .../decorators-2/set-decorator/output.json | 147 +- .../decorators-2/static-method/output.json | 133 +- .../decorators-2/static-property/output.json | 133 +- .../class-decorator-assignment/output.json | 133 +- .../class-decorator-call-expr/output.json | 119 +- .../class-decorator-getter/output.json | 133 +- .../class-decorator-same-line/output.json | 93 +- .../class-decorator-setter/output.json | 147 +- .../decorators/class-decorator/output.json | 93 +- .../class-decorators-multiple/output.json | 160 +- .../class-method-parameter/output.json | 307 +- .../computed-member-expr-on-prop/output.json | 160 +- .../computed-member-expression/output.json | 160 +- .../export-decorators-on-class/output.json | 106 +- .../output.json | 280 +- .../output.json | 92 +- .../output.json | 186 +- .../output.json | 267 +- .../function-expression-parameter/output.json | 293 +- .../decorators/method-decorator/output.json | 133 +- .../method-generator-decorator/output.json | 133 +- .../no-constructor-decorators/output.json | 133 +- .../decorators/object-decorator/output.json | 213 +- .../object-method-parameter/output.json | 320 +- .../conditional-statement/output.json | 331 +- .../scoping-variable/output.json | 239 +- .../do-expressions/with-jsx/output.json | 426 +- .../invalid-lone-import/output.json | 52 +- .../default-and-named/output.json | 120 +- .../default-and-ns/output.json | 106 +- .../default-default/output.json | 79 +- .../default-type-without-flow/output.json | 79 +- .../export-extensions/default/output.json | 79 +- .../export-with-ts/output.json | 398 +- .../output.json | 146 +- .../enabled-call-statement/output.json | 133 +- .../function-sent/enabled-call/output.json | 133 +- .../enabled-if-statement/output.json | 146 +- .../enabled-inside-generator/output.json | 120 +- .../enabled-statement/output.json | 120 +- .../import-meta/error-in-script/output.json | 107 +- .../no-other-prop-names/output.json | 80 +- .../import-meta/not-assignable/output.json | 106 +- .../import-meta/valid-in-module/output.json | 457 +- .../without-dynamic-import/output.json | 457 +- .../and-and-equals/output.json | 161 +- .../mallet/output.json | 161 +- .../qq-equals/output.json | 161 +- .../identifier-start-0/output.json | 53 +- .../numeric-separator/invalid-0/output.json | 52 +- .../numeric-separator/invalid-1/output.json | 52 +- .../numeric-separator/invalid-10/output.json | 52 +- .../numeric-separator/invalid-100/output.json | 52 +- .../numeric-separator/invalid-101/output.json | 52 +- .../numeric-separator/invalid-102/output.json | 52 +- .../numeric-separator/invalid-103/output.json | 52 +- .../numeric-separator/invalid-104/output.json | 52 +- .../numeric-separator/invalid-105/output.json | 52 +- .../numeric-separator/invalid-106/output.json | 52 +- .../numeric-separator/invalid-107/output.json | 52 +- .../numeric-separator/invalid-108/output.json | 52 +- .../numeric-separator/invalid-109/output.json | 52 +- .../numeric-separator/invalid-11/output.json | 52 +- .../numeric-separator/invalid-110/output.json | 52 +- .../numeric-separator/invalid-111/output.json | 52 +- .../numeric-separator/invalid-112/output.json | 52 +- .../numeric-separator/invalid-113/output.json | 52 +- .../numeric-separator/invalid-114/output.json | 52 +- .../numeric-separator/invalid-115/output.json | 52 +- .../numeric-separator/invalid-116/output.json | 52 +- .../numeric-separator/invalid-117/output.json | 52 +- .../numeric-separator/invalid-118/output.json | 52 +- .../numeric-separator/invalid-119/output.json | 52 +- .../numeric-separator/invalid-12/output.json | 52 +- .../numeric-separator/invalid-120/output.json | 52 +- .../numeric-separator/invalid-121/output.json | 52 +- .../numeric-separator/invalid-122/output.json | 52 +- .../numeric-separator/invalid-123/output.json | 52 +- .../numeric-separator/invalid-124/output.json | 65 +- .../numeric-separator/invalid-125/output.json | 65 +- .../numeric-separator/invalid-126/output.json | 65 +- .../numeric-separator/invalid-127/output.json | 65 +- .../numeric-separator/invalid-128/output.json | 65 +- .../numeric-separator/invalid-129/output.json | 65 +- .../numeric-separator/invalid-13/output.json | 52 +- .../numeric-separator/invalid-130/output.json | 65 +- .../numeric-separator/invalid-131/output.json | 65 +- .../numeric-separator/invalid-132/output.json | 65 +- .../numeric-separator/invalid-133/output.json | 65 +- .../numeric-separator/invalid-134/output.json | 65 +- .../numeric-separator/invalid-135/output.json | 65 +- .../numeric-separator/invalid-136/output.json | 65 +- .../numeric-separator/invalid-137/output.json | 65 +- .../numeric-separator/invalid-138/output.json | 65 +- .../numeric-separator/invalid-139/output.json | 65 +- .../numeric-separator/invalid-14/output.json | 52 +- .../numeric-separator/invalid-140/output.json | 65 +- .../numeric-separator/invalid-141/output.json | 65 +- .../numeric-separator/invalid-142/output.json | 65 +- .../numeric-separator/invalid-143/output.json | 65 +- .../numeric-separator/invalid-144/output.json | 65 +- .../numeric-separator/invalid-145/output.json | 65 +- .../numeric-separator/invalid-146/output.json | 65 +- .../numeric-separator/invalid-147/output.json | 65 +- .../numeric-separator/invalid-15/output.json | 52 +- .../numeric-separator/invalid-16/output.json | 52 +- .../numeric-separator/invalid-17/output.json | 52 +- .../numeric-separator/invalid-18/output.json | 52 +- .../numeric-separator/invalid-19/output.json | 52 +- .../numeric-separator/invalid-2/output.json | 52 +- .../numeric-separator/invalid-20/output.json | 52 +- .../numeric-separator/invalid-21/output.json | 52 +- .../numeric-separator/invalid-22/output.json | 52 +- .../numeric-separator/invalid-23/output.json | 52 +- .../numeric-separator/invalid-25/output.json | 52 +- .../numeric-separator/invalid-26/output.json | 52 +- .../numeric-separator/invalid-28/output.json | 52 +- .../numeric-separator/invalid-29/output.json | 52 +- .../numeric-separator/invalid-3/output.json | 52 +- .../numeric-separator/invalid-30/output.json | 52 +- .../numeric-separator/invalid-31/output.json | 52 +- .../numeric-separator/invalid-32/output.json | 52 +- .../numeric-separator/invalid-33/output.json | 52 +- .../numeric-separator/invalid-34/output.json | 52 +- .../numeric-separator/invalid-35/output.json | 52 +- .../numeric-separator/invalid-36/output.json | 52 +- .../numeric-separator/invalid-37/output.json | 52 +- .../numeric-separator/invalid-38/output.json | 52 +- .../numeric-separator/invalid-39/output.json | 52 +- .../numeric-separator/invalid-4/output.json | 52 +- .../numeric-separator/invalid-40/output.json | 52 +- .../numeric-separator/invalid-41/output.json | 52 +- .../numeric-separator/invalid-42/output.json | 52 +- .../numeric-separator/invalid-43/output.json | 52 +- .../numeric-separator/invalid-44/output.json | 52 +- .../numeric-separator/invalid-45/output.json | 52 +- .../numeric-separator/invalid-46/output.json | 52 +- .../numeric-separator/invalid-47/output.json | 52 +- .../numeric-separator/invalid-48/output.json | 52 +- .../numeric-separator/invalid-49/output.json | 52 +- .../numeric-separator/invalid-5/output.json | 52 +- .../numeric-separator/invalid-50/output.json | 52 +- .../numeric-separator/invalid-51/output.json | 52 +- .../numeric-separator/invalid-52/output.json | 78 +- .../numeric-separator/invalid-53/output.json | 78 +- .../numeric-separator/invalid-54/output.json | 78 +- .../numeric-separator/invalid-55/output.json | 78 +- .../numeric-separator/invalid-56/output.json | 78 +- .../numeric-separator/invalid-57/output.json | 78 +- .../numeric-separator/invalid-58/output.json | 78 +- .../numeric-separator/invalid-59/output.json | 78 +- .../numeric-separator/invalid-6/output.json | 52 +- .../numeric-separator/invalid-60/output.json | 78 +- .../numeric-separator/invalid-61/output.json | 78 +- .../numeric-separator/invalid-62/output.json | 78 +- .../numeric-separator/invalid-63/output.json | 78 +- .../numeric-separator/invalid-64/output.json | 78 +- .../numeric-separator/invalid-65/output.json | 78 +- .../numeric-separator/invalid-66/output.json | 78 +- .../numeric-separator/invalid-67/output.json | 78 +- .../numeric-separator/invalid-68/output.json | 78 +- .../numeric-separator/invalid-69/output.json | 78 +- .../numeric-separator/invalid-7/output.json | 52 +- .../numeric-separator/invalid-70/output.json | 78 +- .../numeric-separator/invalid-71/output.json | 78 +- .../numeric-separator/invalid-72/output.json | 78 +- .../numeric-separator/invalid-73/output.json | 78 +- .../numeric-separator/invalid-74/output.json | 78 +- .../numeric-separator/invalid-75/output.json | 78 +- .../numeric-separator/invalid-76/output.json | 65 +- .../numeric-separator/invalid-77/output.json | 65 +- .../numeric-separator/invalid-78/output.json | 65 +- .../numeric-separator/invalid-79/output.json | 65 +- .../numeric-separator/invalid-8/output.json | 52 +- .../numeric-separator/invalid-80/output.json | 65 +- .../numeric-separator/invalid-81/output.json | 65 +- .../numeric-separator/invalid-82/output.json | 65 +- .../numeric-separator/invalid-83/output.json | 65 +- .../numeric-separator/invalid-84/output.json | 65 +- .../numeric-separator/invalid-85/output.json | 65 +- .../numeric-separator/invalid-86/output.json | 65 +- .../numeric-separator/invalid-87/output.json | 65 +- .../numeric-separator/invalid-88/output.json | 65 +- .../numeric-separator/invalid-89/output.json | 65 +- .../numeric-separator/invalid-9/output.json | 52 +- .../numeric-separator/invalid-90/output.json | 65 +- .../numeric-separator/invalid-91/output.json | 65 +- .../numeric-separator/invalid-92/output.json | 65 +- .../numeric-separator/invalid-93/output.json | 65 +- .../numeric-separator/invalid-94/output.json | 65 +- .../numeric-separator/invalid-95/output.json | 65 +- .../numeric-separator/invalid-96/output.json | 65 +- .../numeric-separator/invalid-97/output.json | 65 +- .../numeric-separator/invalid-98/output.json | 65 +- .../numeric-separator/invalid-99/output.json | 65 +- .../numeric-separator/invalid-hex/output.json | 52 +- .../invalid-leading-zero/output.json | 52 +- .../invalid-legacy-octal-literal/output.json | 52 +- .../invalid-non-octal-decimal-int/output.json | 52 +- .../invalid-unicode-2/output.json | 52 +- .../invalid-unicode/output.json | 52 +- .../numeric-separator/valid-0/output.json | 52 +- .../numeric-separator/valid-1/output.json | 52 +- .../numeric-separator/valid-10/output.json | 52 +- .../numeric-separator/valid-11/output.json | 52 +- .../numeric-separator/valid-12/output.json | 52 +- .../numeric-separator/valid-13/output.json | 52 +- .../numeric-separator/valid-14/output.json | 52 +- .../numeric-separator/valid-15/output.json | 52 +- .../numeric-separator/valid-2/output.json | 52 +- .../numeric-separator/valid-3/output.json | 52 +- .../numeric-separator/valid-4/output.json | 52 +- .../numeric-separator/valid-5/output.json | 52 +- .../numeric-separator/valid-6/output.json | 52 +- .../numeric-separator/valid-7/output.json | 52 +- .../numeric-separator/valid-8/output.json | 52 +- .../numeric-separator/valid-9/output.json | 52 +- .../partial-application/call-expr/output.json | 81 +- .../call-on-SuperProperty/output.json | 240 +- .../for-any-arg/output.json | 215 +- .../partial-application/from-left/output.json | 189 +- .../from-right/output.json | 189 +- .../in-SuperCall/output.json | 306 +- .../partial-application/in-new/output.json | 119 +- .../output.json | 253 +- .../output.json | 253 +- .../output.json | 187 +- .../output.json | 280 +- .../output.json | 280 +- .../output.json | 134 +- .../proposal-fsharp-arrow-at-head/output.json | 134 +- .../output.json | 241 +- .../output.json | 240 +- .../output.json | 240 +- .../output.json | 240 +- .../output.json | 240 +- .../proposal-fsharp-await-end/output.json | 119 +- .../proposal-fsharp-await/output.json | 146 +- .../proposal-fsharp-base/output.json | 80 +- .../proposal-fsharp-chain/output.json | 107 +- .../output.json | 160 +- .../proposal-minimal-base/output.json | 80 +- .../proposal-minimal-chain/output.json | 134 +- .../proposal-minimal-multiline/output.json | 160 +- .../proposal-minimal-precedence/output.json | 212 +- .../output.json | 132 +- .../proposal-minimal-with-arrow/output.json | 132 +- .../output.json | 280 +- .../output.json | 187 +- .../output.json | 93 +- .../output.json | 174 +- .../output.json | 118 +- .../output.json | 160 +- .../output.json | 185 +- .../output.json | 159 +- .../output.json | 145 +- .../output.json | 133 +- .../output.json | 157 +- .../output.json | 117 +- .../output.json | 120 +- .../output.json | 120 +- .../output.json | 105 +- .../output.json | 132 +- .../output.json | 211 +- .../output.json | 238 +- .../output.json | 278 +- .../output.json | 172 +- .../output.json | 172 +- .../output.json | 331 +- .../output.json | 211 +- .../output.json | 157 +- .../output.json | 224 +- .../output.json | 131 +- .../output.json | 170 +- .../output.json | 145 +- .../output.json | 199 +- .../output.json | 132 +- .../output.json | 172 +- .../output.json | 118 +- .../output.json | 118 +- .../output.json | 145 +- .../output.json | 211 +- .../output.json | 238 +- .../output.json | 292 +- .../output.json | 172 +- .../output.json | 172 +- .../output.json | 131 +- .../output.json | 211 +- .../output.json | 184 +- .../output.json | 158 +- .../output.json | 183 +- .../output.json | 327 +- .../output.json | 274 +- .../output.json | 399 +- .../output.json | 385 +- .../output.json | 332 +- .../output.json | 211 +- .../output.json | 119 +- .../output.json | 172 +- .../output.json | 145 +- .../output.json | 92 +- .../output.json | 92 +- .../output.json | 92 +- .../output.json | 131 +- .../record-and-tuple/bar-flow/output.json | 185 +- .../record-and-tuple/bar/output.json | 526 +- .../record-and-tuple/hash/output.json | 526 +- .../1/output.json | 92 +- .../10/output.json | 118 +- .../11/output.json | 118 +- .../12/output.json | 144 +- .../13/output.json | 92 +- .../14/output.json | 118 +- .../15/output.json | 118 +- .../16/output.json | 144 +- .../17/output.json | 92 +- .../18/output.json | 118 +- .../19/output.json | 118 +- .../2/output.json | 118 +- .../20/output.json | 144 +- .../21/output.json | 92 +- .../22/output.json | 118 +- .../23/output.json | 118 +- .../24/output.json | 144 +- .../25/output.json | 92 +- .../26/output.json | 118 +- .../27/output.json | 118 +- .../28/output.json | 144 +- .../29/output.json | 92 +- .../3/output.json | 118 +- .../30/output.json | 118 +- .../31/output.json | 118 +- .../32/output.json | 144 +- .../33/output.json | 92 +- .../34/output.json | 118 +- .../35/output.json | 118 +- .../36/output.json | 144 +- .../37/output.json | 92 +- .../38/output.json | 118 +- .../39/output.json | 118 +- .../4/output.json | 144 +- .../40/output.json | 144 +- .../41/output.json | 92 +- .../42/output.json | 118 +- .../43/output.json | 118 +- .../44/output.json | 144 +- .../45/output.json | 92 +- .../46/output.json | 118 +- .../47/output.json | 118 +- .../48/output.json | 144 +- .../49/output.json | 92 +- .../5/output.json | 92 +- .../50/output.json | 118 +- .../51/output.json | 118 +- .../52/output.json | 144 +- .../53/output.json | 92 +- .../54/output.json | 118 +- .../55/output.json | 118 +- .../56/output.json | 144 +- .../57/output.json | 92 +- .../58/output.json | 118 +- .../59/output.json | 118 +- .../6/output.json | 118 +- .../60/output.json | 144 +- .../61/output.json | 92 +- .../62/output.json | 118 +- .../63/output.json | 118 +- .../64/output.json | 144 +- .../65/output.json | 92 +- .../66/output.json | 118 +- .../67/output.json | 118 +- .../68/output.json | 144 +- .../7/output.json | 118 +- .../8/output.json | 144 +- .../9/output.json | 92 +- .../1/output.json | 65 +- .../10/output.json | 91 +- .../11/output.json | 91 +- .../12/output.json | 117 +- .../13/output.json | 65 +- .../14/output.json | 91 +- .../15/output.json | 91 +- .../16/output.json | 117 +- .../17/output.json | 65 +- .../18/output.json | 91 +- .../19/output.json | 91 +- .../2/output.json | 91 +- .../20/output.json | 117 +- .../21/output.json | 65 +- .../22/output.json | 91 +- .../23/output.json | 91 +- .../24/output.json | 117 +- .../25/output.json | 65 +- .../26/output.json | 91 +- .../27/output.json | 91 +- .../28/output.json | 117 +- .../29/output.json | 65 +- .../3/output.json | 91 +- .../30/output.json | 91 +- .../31/output.json | 91 +- .../32/output.json | 117 +- .../33/output.json | 65 +- .../34/output.json | 91 +- .../35/output.json | 91 +- .../36/output.json | 117 +- .../37/output.json | 65 +- .../38/output.json | 91 +- .../39/output.json | 91 +- .../4/output.json | 117 +- .../40/output.json | 117 +- .../41/output.json | 65 +- .../42/output.json | 91 +- .../43/output.json | 91 +- .../44/output.json | 117 +- .../45/output.json | 65 +- .../46/output.json | 91 +- .../47/output.json | 91 +- .../48/output.json | 117 +- .../49/output.json | 65 +- .../5/output.json | 65 +- .../50/output.json | 91 +- .../51/output.json | 91 +- .../52/output.json | 117 +- .../53/output.json | 65 +- .../54/output.json | 91 +- .../55/output.json | 91 +- .../56/output.json | 117 +- .../57/output.json | 65 +- .../58/output.json | 91 +- .../59/output.json | 91 +- .../6/output.json | 91 +- .../60/output.json | 117 +- .../61/output.json | 65 +- .../62/output.json | 91 +- .../63/output.json | 91 +- .../64/output.json | 117 +- .../65/output.json | 65 +- .../66/output.json | 91 +- .../67/output.json | 91 +- .../68/output.json | 117 +- .../7/output.json | 91 +- .../8/output.json | 117 +- .../9/output.json | 65 +- .../throw-expression/comma/output.json | 131 +- .../throw-expression/expression/output.json | 105 +- .../throw-expression/logical/output.json | 131 +- .../throw-expression/statement/output.json | 92 +- .../export-default/output.json | 65 +- .../for-await-module/output.json | 106 +- .../top-level-await/inside-block/output.json | 104 +- .../top-level-module/output.json | 65 +- .../output.json | 299 +- .../unambiguous-ambiguous-modulo/output.json | 106 +- .../unambiguous-ambiguous-script/output.json | 371 +- .../output.json | 106 +- .../unambiguous-module/output.json | 299 +- .../experimental/uncategorised/40/output.json | 160 +- .../experimental/uncategorised/43/output.json | 106 +- .../experimental/uncategorised/44/output.json | 93 +- .../experimental/uncategorised/45/output.json | 93 +- .../experimental/uncategorised/46/output.json | 106 +- .../experimental/uncategorised/47/output.json | 133 +- .../experimental/uncategorised/48/output.json | 133 +- .../experimental/uncategorised/49/output.json | 146 +- .../experimental/uncategorised/62/output.json | 146 +- .../good_01/output.json | 105 +- .../good_02/output.json | 145 +- .../good_03/output.json | 118 +- .../good_04/output.json | 144 +- .../good_05/output.json | 171 +- .../good_06/output.json | 131 +- .../good_07/output.json | 131 +- .../good_08/output.json | 118 +- .../good_09/output.json | 118 +- .../good_10/output.json | 144 +- .../good_11/output.json | 131 +- .../good_12/output.json | 144 +- .../good_13/output.json | 118 +- .../good_14/output.json | 145 +- .../good_15/output.json | 197 +- .../good_01/output.json | 158 +- .../good_02/output.json | 78 +- .../good_03/output.json | 105 +- .../good_04/output.json | 105 +- .../good_05/output.json | 145 +- .../good_06/output.json | 145 +- .../good_07/output.json | 145 +- .../good_08/output.json | 145 +- .../good_09/output.json | 211 +- .../good_10/output.json | 185 +- .../good_11/output.json | 118 +- .../good_12/output.json | 144 +- .../good_13/output.json | 171 +- .../good_14/output.json | 158 +- .../fixtures/flow/array-types/1/output.json | 105 +- .../fixtures/flow/array-types/2/output.json | 118 +- .../fixtures/flow/array-types/3/output.json | 118 +- .../fixtures/flow/array-types/4/output.json | 118 +- .../fixtures/flow/array-types/5/output.json | 118 +- .../fixtures/flow/array-types/6/output.json | 132 +- .../fixtures/flow/array-types/7/output.json | 118 +- .../fixtures/flow/array-types/8/output.json | 131 +- .../fixtures/flow/array-types/9/output.json | 118 +- .../flow/bounded-polymorphism/1/output.json | 132 +- .../flow/bounded-polymorphism/2/output.json | 131 +- .../flow/call-properties/1/output.json | 131 +- .../flow/call-properties/2/output.json | 131 +- .../flow/call-properties/3/output.json | 250 +- .../flow/call-properties/4/output.json | 211 +- .../flow/call-properties/5/output.json | 105 +- .../flow/class-private-property/1/output.json | 212 +- .../flow/class-private-property/2/output.json | 198 +- .../declare-field-initializer/output.json | 119 +- .../declare-field/output.json | 106 +- .../declare-method/output.json | 119 +- .../declare-after-decorators/output.json | 120 +- .../declare-constructor/output.json | 106 +- .../declare-field-computed/output.json | 93 +- .../declare-field-initializer/output.json | 106 +- .../declare-field-named-static/output.json | 93 +- .../declare-field-with-type/output.json | 119 +- .../declare-field/output.json | 93 +- .../declare-method/output.json | 106 +- .../declare-static-field/output.json | 93 +- .../field-named-declare-with-type/output.json | 119 +- .../field-named-declare/output.json | 93 +- .../getter-setter/output.json | 500 +- .../method-named-declare/output.json | 106 +- .../class-properties/named-static/output.json | 120 +- .../static-field-named-declare/output.json | 93 +- .../output.json | 132 +- .../output.json | 172 +- .../fixtures/flow/classes/good_01/output.json | 132 +- .../classes/implements-multiple/output.json | 120 +- .../flow/classes/implements/output.json | 93 +- .../01-type-include/output.json | 118 +- .../02-type-include/output.json | 52 +- .../03-type-flow-include/output.json | 52 +- .../04-type-flow-include/output.json | 118 +- .../05-type-annotation/output.json | 145 +- .../flow/comment/01-type-include/output.json | 172 +- .../flow/comment/02-type-include/output.json | 186 +- .../comment/03-type-flow-include/output.json | 186 +- .../comment/04-type-flow-include/output.json | 172 +- .../comment/05-type-annotation/output.json | 132 +- .../output.json | 52 +- .../fixtures/flow/comment/spread/output.json | 211 +- .../implements-multiple/output.json | 120 +- .../implements-with-mixin/output.json | 120 +- .../flow/declare-class/implements/output.json | 93 +- .../declare-class/mixins-multiple/output.json | 120 +- .../flow/declare-class/mixins/output.json | 93 +- .../declare-export/export-class/output.json | 211 +- .../export-default-arrow/output.json | 105 +- .../export-default-class/output.json | 92 +- .../export-default-function/output.json | 145 +- .../export-default-union/output.json | 117 +- .../declare-export/export-from/output.json | 134 +- .../export-function/output.json | 184 +- .../export-interface-and-var/output.json | 184 +- .../export-interface-commonjs/output.json | 157 +- .../export-interface/output.json | 118 +- .../export-named-pattern/output.json | 159 +- .../declare-export/export-star-as/output.json | 79 +- .../declare-export/export-star/output.json | 91 +- .../export-type-and-var/output.json | 184 +- .../export-type-commonjs/output.json | 157 +- .../export-type-star-from/output.json | 91 +- .../declare-export/export-type/output.json | 118 +- .../declare-export/export-var/output.json | 131 +- .../flow/declare-module/1/output.json | 66 +- .../flow/declare-module/10/output.json | 118 +- .../flow/declare-module/2/output.json | 65 +- .../flow/declare-module/3/output.json | 119 +- .../flow/declare-module/4/output.json | 132 +- .../flow/declare-module/5/output.json | 159 +- .../flow/declare-module/6/output.json | 158 +- .../flow/declare-module/9/output.json | 105 +- .../flow/declare-module/import/output.json | 171 +- .../invalid-commonjs-module/output.json | 170 +- .../invalid-es-module/output.json | 170 +- .../declare-module/invalid-import/output.json | 118 +- .../invalid-module-in-module/output.json | 106 +- .../invalid-multiple-commonjs/output.json | 143 +- .../flow/declare-statements/1/output.json | 53 +- .../flow/declare-statements/10/output.json | 159 +- .../flow/declare-statements/11/output.json | 119 +- .../flow/declare-statements/12/output.json | 105 +- .../flow/declare-statements/13/output.json | 160 +- .../flow/declare-statements/14/output.json | 199 +- .../flow/declare-statements/15/output.json | 226 +- .../flow/declare-statements/16/output.json | 147 +- .../flow/declare-statements/17/output.json | 186 +- .../flow/declare-statements/18/output.json | 184 +- .../flow/declare-statements/19/output.json | 79 +- .../flow/declare-statements/2/output.json | 53 +- .../flow/declare-statements/3/output.json | 92 +- .../flow/declare-statements/4/output.json | 92 +- .../flow/declare-statements/5/output.json | 118 +- .../flow/declare-statements/6/output.json | 172 +- .../flow/declare-statements/7/output.json | 213 +- .../flow/declare-statements/8/output.json | 66 +- .../flow/declare-statements/9/output.json | 199 +- .../declare-statements/symbol/output.json | 79 +- .../flow/def-site-variance/1/output.json | 341 +- .../boolean-explicit/output.json | 146 +- .../boolean-implicit/output.json | 146 +- .../output.json | 66 +- .../output.json | 106 +- .../duplicate-member-name/output.json | 120 +- .../flow/enum-declaration/empty/output.json | 66 +- .../enum-declaration/enum-name/output.json | 66 +- .../flow/enum-declaration/export/output.json | 132 +- .../output.json | 66 +- .../output.json | 66 +- .../output.json | 66 +- .../output.json | 66 +- .../output.json | 66 +- .../output.json | 66 +- .../output.json | 66 +- .../output.json | 66 +- .../output.json | 66 +- .../invalid-member-name/output.json | 120 +- .../no-trailing-comma/output.json | 93 +- .../number-explicit/output.json | 146 +- .../number-implicit/output.json | 146 +- .../output.json | 66 +- .../output.json | 106 +- .../reserved-word-enum-name/output.json | 66 +- .../string-explicit-defaulted/output.json | 120 +- .../string-explicit-initialized/output.json | 146 +- .../string-implicit-defaulted/output.json | 120 +- .../string-implicit-initialized/output.json | 146 +- .../output.json | 120 +- .../output.json | 146 +- .../flow/enum-declaration/symbol/output.json | 120 +- .../output.json | 92 +- .../output.json | 132 +- .../output.json | 132 +- .../output.json | 172 +- .../output.json | 132 +- .../output.json | 132 +- .../output.json | 172 +- .../output.json | 132 +- .../output.json | 132 +- .../explicit_inexact_object/output.json | 332 +- .../output.json | 172 +- .../output.json | 132 +- .../output.json | 172 +- .../output.json | 292 +- .../flow/interface-types/basic/output.json | 119 +- .../output.json | 146 +- .../output.json | 173 +- .../extends-multiple/output.json | 173 +- .../extends-reserved-invalid-1/output.json | 119 +- .../extends-reserved-invalid-2/output.json | 146 +- .../flow/interface-types/extends/output.json | 146 +- .../output.json | 132 +- .../1/output.json | 66 +- .../10/output.json | 159 +- .../2/output.json | 93 +- .../3/output.json | 226 +- .../4/output.json | 119 +- .../5/output.json | 159 +- .../6/output.json | 93 +- .../7/output.json | 160 +- .../8/output.json | 133 +- .../9/output.json | 160 +- .../id-reserved-type-invalid/output.json | 66 +- .../id-reserved-value/output.json | 66 +- .../output.json | 119 +- .../output.json | 106 +- .../implements-exports/output.json | 120 +- .../output.json | 120 +- .../output.json | 93 +- .../implements-reserved-value/output.json | 93 +- .../declare-class-static/output.json | 120 +- .../internal-slot/declare-class/output.json | 120 +- .../interface-method/output.json | 133 +- .../flow/internal-slot/interface/output.json | 120 +- .../internal-slot/object-method/output.json | 133 +- .../internal-slot/object-optional/output.json | 120 +- .../flow/internal-slot/object/output.json | 120 +- .../fixtures/flow/iterator/01/output.json | 173 +- .../fixtures/flow/iterator/02/output.json | 173 +- .../fixtures/flow/iterator/03/output.json | 66 +- .../fixtures/flow/iterator/04/output.json | 66 +- .../fixtures/flow/iterator/05/output.json | 106 +- .../fixtures/flow/iterator/06/output.json | 106 +- .../fixtures/flow/iterator/07/output.json | 66 +- .../fixtures/flow/iterator/08/output.json | 66 +- .../fixtures/flow/iterator/09/output.json | 119 +- .../fixtures/flow/iterator/10/output.json | 119 +- .../fixtures/flow/iterator/11/output.json | 119 +- .../fixtures/flow/iterator/12/output.json | 210 +- .../fixtures/flow/iterator/13/output.json | 210 +- .../fixtures/flow/iterator/14/output.json | 173 +- .../fixtures/flow/iterator/15/output.json | 173 +- .../literal-types/boolean-false/output.json | 92 +- .../literal-types/boolean-true/output.json | 92 +- .../flow/literal-types/null/output.json | 92 +- .../literal-types/number-binary/output.json | 92 +- .../literal-types/number-float/output.json | 92 +- .../literal-types/number-integer/output.json | 92 +- .../number-negative-binary/output.json | 92 +- .../number-negative-float/output.json | 92 +- .../number-negative-octal-2/output.json | 92 +- .../number-negative-octal/output.json | 92 +- .../literal-types/number-octal-2/output.json | 92 +- .../literal-types/number-octal/output.json | 92 +- .../literal-types/string-double/output.json | 146 +- .../literal-types/string-single/output.json | 146 +- .../multiple-declarations/class/output.json | 106 +- .../declare-class/output.json | 186 +- .../declare-function/output.json | 198 +- .../declare-var/output.json | 120 +- .../interface/output.json | 132 +- .../multiple-declarations/type/output.json | 106 +- .../complex-param-types/output.json | 185 +- .../output.json | 159 +- .../invalid-getter-param-count/output.json | 159 +- .../invalid-setter-param-count/output.json | 119 +- .../invalid-setter-param-type/output.json | 159 +- .../opaque_collision/output.json | 120 +- .../opaque_declare_export_neither/output.json | 66 +- .../opaque_declare_export_st_no_t/output.json | 93 +- .../opaque_declare_neither/output.json | 53 +- .../opaque_declare_st_no_t/output.json | 80 +- .../opaque_in_exp/output.json | 132 +- .../opaque_in_func/output.json | 79 +- .../opaque_subtype/output.json | 187 +- .../opaque_subtype_export/output.json | 200 +- .../opaque-type-alias/opaque_type/output.json | 66 +- .../opaque_type_export/output.json | 79 +- .../reserved-type-invalid/output.json | 66 +- .../reserved-value/output.json | 66 +- .../fixtures/flow/optional-type/1/output.json | 106 +- .../fixtures/flow/optional-type/3/output.json | 186 +- .../fixtures/flow/optional-type/4/output.json | 119 +- .../fixtures/flow/optional-type/6/output.json | 92 +- .../test/fixtures/flow/pragma/1/output.json | 227 +- .../test/fixtures/flow/pragma/2/output.json | 185 +- .../test/fixtures/flow/pragma/3/output.json | 172 +- .../test/fixtures/flow/pragma/4/output.json | 224 +- .../test/fixtures/flow/pragma/5/output.json | 237 +- .../fixtures/flow/predicates/1/output.json | 185 +- .../fixtures/flow/predicates/2/output.json | 185 +- .../fixtures/flow/predicates/3/output.json | 198 +- .../fixtures/flow/predicates/4/output.json | 185 +- .../fixtures/flow/predicates/5/output.json | 159 +- .../fixtures/flow/predicates/6/output.json | 479 +- .../proto-props/declare-class/output.json | 321 +- .../flow/qualified-generic-type/1/output.json | 133 +- .../flow/qualified-generic-type/2/output.json | 160 +- .../flow/qualified-generic-type/3/output.json | 173 +- .../flow/qualified-generic-type/4/output.json | 186 +- .../arrow-function-with-newline/output.json | 119 +- .../output.json | 174 +- .../output.json | 201 +- .../flow/regression/issue-10044/output.json | 444 +- .../flow/regression/issue-10314/output.json | 158 +- .../flow/regression/issue-166/output.json | 251 +- .../flow/regression/issue-2083/output.json | 360 +- .../flow/regression/issue-2493/output.json | 331 +- .../flow/regression/issue-264/output.json | 145 +- .../flow/regression/issue-321/output.json | 480 +- .../flow/regression/issue-336/output.json | 198 +- .../regression/issue-58-failing-1/output.json | 174 +- .../regression/issue-58-failing-2/output.json | 267 +- .../regression/issue-58-failing-3/output.json | 201 +- .../regression/issue-58-failing-4/output.json | 201 +- .../flow/regression/issue-58/output.json | 5031 ++--------------- .../flow/regression/issue-593/output.json | 160 +- .../flow/regression/issue-92/output.json | 158 +- .../fixtures/flow/scope/abcdef/output.json | 238 +- .../flow/scope/declare-module/output.json | 146 +- .../dupl-decl-const-declare-class/output.json | 119 +- .../output.json | 119 +- .../dupl-decl-const-interface/output.json | 119 +- .../dupl-decl-const-opaque-type/output.json | 119 +- .../scope/dupl-decl-const-type/output.json | 119 +- .../output.json | 106 +- .../output.json | 106 +- .../output.json | 158 +- .../output.json | 145 +- .../dupl-decl-declare-func-func/output.json | 132 +- .../output.json | 106 +- .../output.json | 132 +- .../dupl-decl-declare-var-let/output.json | 119 +- .../dupl-decl-interface-interface/output.json | 106 +- .../dupl-decl-let-declare-class/output.json | 119 +- .../output.json | 119 +- .../scope/dupl-decl-let-interface/output.json | 119 +- .../dupl-decl-let-opaque-type/output.json | 119 +- .../flow/scope/dupl-decl-let-type/output.json | 119 +- .../dupl-decl-opaque-type-const/output.json | 119 +- .../dupl-decl-opaque-type-let/output.json | 119 +- .../output.json | 106 +- .../dupl-decl-opaque-type-type/output.json | 106 +- .../dupl-decl-opaque-type-var/output.json | 119 +- .../scope/dupl-decl-type-const/output.json | 119 +- .../dupl-decl-type-interface/output.json | 106 +- .../flow/scope/dupl-decl-type-let/output.json | 119 +- .../dupl-decl-type-opaque-type/output.json | 106 +- .../scope/dupl-decl-type-type/output.json | 106 +- .../flow/scope/dupl-decl-type-var/output.json | 119 +- .../output.json | 119 +- .../scope/dupl-decl-var-interface/output.json | 119 +- .../dupl-decl-var-opaque-type/output.json | 119 +- .../flow/scope/dupl-decl-var-type/output.json | 119 +- .../export-named/output.json | 132 +- .../sourcetype-script/export-star/output.json | 52 +- .../flow/sourcetype-script/import/output.json | 146 +- .../1/output.json | 159 +- .../test/fixtures/flow/tuples/1/output.json | 105 +- .../test/fixtures/flow/tuples/2/output.json | 186 +- .../test/fixtures/flow/tuples/3/output.json | 137 +- .../test/fixtures/flow/tuples/4/output.json | 157 +- .../fixtures/flow/type-alias/1/output.json | 66 +- .../fixtures/flow/type-alias/2/output.json | 146 +- .../fixtures/flow/type-alias/3/output.json | 79 +- .../fixtures/flow/type-alias/4/output.json | 716 +-- .../fixtures/flow/type-alias/5/output.json | 398 +- .../fixtures/flow/type-alias/6/output.json | 92 +- .../flow/type-annotations/1/output.json | 146 +- .../flow/type-annotations/10/output.json | 199 +- .../flow/type-annotations/100/output.json | 158 +- .../flow/type-annotations/101/output.json | 185 +- .../flow/type-annotations/102/output.json | 158 +- .../flow/type-annotations/103/output.json | 265 +- .../flow/type-annotations/104/output.json | 238 +- .../flow/type-annotations/105/output.json | 198 +- .../flow/type-annotations/107/output.json | 198 +- .../flow/type-annotations/108/output.json | 1381 +---- .../flow/type-annotations/11/output.json | 239 +- .../flow/type-annotations/110/output.json | 133 +- .../flow/type-annotations/111/output.json | 133 +- .../flow/type-annotations/114/output.json | 160 +- .../flow/type-annotations/115/output.json | 160 +- .../flow/type-annotations/118/output.json | 146 +- .../flow/type-annotations/119/output.json | 146 +- .../flow/type-annotations/12/output.json | 92 +- .../flow/type-annotations/127/output.json | 105 +- .../flow/type-annotations/128/output.json | 131 +- .../flow/type-annotations/129/output.json | 131 +- .../flow/type-annotations/13/output.json | 105 +- .../flow/type-annotations/130/output.json | 224 +- .../flow/type-annotations/131/output.json | 66 +- .../flow/type-annotations/132/output.json | 92 +- .../flow/type-annotations/133/output.json | 185 +- .../flow/type-annotations/134/output.json | 66 +- .../flow/type-annotations/135/output.json | 92 +- .../flow/type-annotations/136/output.json | 132 +- .../flow/type-annotations/137/output.json | 105 +- .../flow/type-annotations/138/output.json | 226 +- .../flow/type-annotations/139/output.json | 146 +- .../flow/type-annotations/14/output.json | 145 +- .../flow/type-annotations/15/output.json | 145 +- .../flow/type-annotations/16/output.json | 92 +- .../flow/type-annotations/17/output.json | 92 +- .../flow/type-annotations/18/output.json | 105 +- .../flow/type-annotations/19/output.json | 131 +- .../flow/type-annotations/2/output.json | 106 +- .../flow/type-annotations/20/output.json | 159 +- .../flow/type-annotations/21/output.json | 185 +- .../flow/type-annotations/22/output.json | 145 +- .../flow/type-annotations/23/output.json | 239 +- .../flow/type-annotations/24/output.json | 239 +- .../flow/type-annotations/25/output.json | 239 +- .../flow/type-annotations/26/output.json | 238 +- .../flow/type-annotations/27/output.json | 146 +- .../flow/type-annotations/28/output.json | 172 +- .../flow/type-annotations/29/output.json | 132 +- .../flow/type-annotations/3/output.json | 146 +- .../flow/type-annotations/30/output.json | 92 +- .../flow/type-annotations/31/output.json | 106 +- .../flow/type-annotations/32/output.json | 132 +- .../flow/type-annotations/33/output.json | 132 +- .../flow/type-annotations/34/output.json | 185 +- .../flow/type-annotations/35/output.json | 145 +- .../flow/type-annotations/36/output.json | 172 +- .../flow/type-annotations/37/output.json | 172 +- .../flow/type-annotations/38/output.json | 185 +- .../flow/type-annotations/39/output.json | 172 +- .../flow/type-annotations/4/output.json | 120 +- .../flow/type-annotations/40/output.json | 172 +- .../flow/type-annotations/41/output.json | 198 +- .../flow/type-annotations/42/output.json | 265 +- .../flow/type-annotations/43/output.json | 239 +- .../flow/type-annotations/44/output.json | 184 +- .../flow/type-annotations/45/output.json | 132 +- .../flow/type-annotations/46/output.json | 186 +- .../flow/type-annotations/47/output.json | 92 +- .../flow/type-annotations/48/output.json | 146 +- .../flow/type-annotations/49/output.json | 133 +- .../flow/type-annotations/5/output.json | 120 +- .../flow/type-annotations/50/output.json | 210 +- .../flow/type-annotations/51/output.json | 131 +- .../flow/type-annotations/52/output.json | 94 +- .../flow/type-annotations/53/output.json | 172 +- .../flow/type-annotations/54/output.json | 172 +- .../flow/type-annotations/55/output.json | 131 +- .../flow/type-annotations/56/output.json | 172 +- .../flow/type-annotations/57/output.json | 158 +- .../flow/type-annotations/58/output.json | 133 +- .../flow/type-annotations/59/output.json | 159 +- .../flow/type-annotations/6/output.json | 119 +- .../flow/type-annotations/60/output.json | 225 +- .../flow/type-annotations/61/output.json | 225 +- .../flow/type-annotations/62/output.json | 171 +- .../flow/type-annotations/63/output.json | 186 +- .../flow/type-annotations/64/output.json | 159 +- .../flow/type-annotations/65/output.json | 159 +- .../flow/type-annotations/66/output.json | 158 +- .../flow/type-annotations/67/output.json | 119 +- .../flow/type-annotations/68/output.json | 133 +- .../flow/type-annotations/69/output.json | 200 +- .../flow/type-annotations/7/output.json | 119 +- .../flow/type-annotations/70/output.json | 119 +- .../flow/type-annotations/71/output.json | 133 +- .../flow/type-annotations/72/output.json | 119 +- .../flow/type-annotations/73/output.json | 133 +- .../flow/type-annotations/74/output.json | 172 +- .../flow/type-annotations/75/output.json | 119 +- .../flow/type-annotations/76/output.json | 133 +- .../flow/type-annotations/77/output.json | 172 +- .../flow/type-annotations/78/output.json | 121 +- .../flow/type-annotations/79/output.json | 173 +- .../flow/type-annotations/8/output.json | 119 +- .../flow/type-annotations/80/output.json | 159 +- .../flow/type-annotations/81/output.json | 185 +- .../flow/type-annotations/82/output.json | 185 +- .../flow/type-annotations/83/output.json | 105 +- .../flow/type-annotations/84/output.json | 118 +- .../flow/type-annotations/85/output.json | 145 +- .../flow/type-annotations/86/output.json | 185 +- .../flow/type-annotations/87/output.json | 199 +- .../flow/type-annotations/88/output.json | 266 +- .../flow/type-annotations/9/output.json | 159 +- .../flow/type-annotations/97/output.json | 131 +- .../flow/type-annotations/98/output.json | 212 +- .../flow/type-annotations/99/output.json | 133 +- .../arrow-func-return-newline/output.json | 158 +- .../flow/type-annotations/builtin/output.json | 650 +-- .../existential-type-param-2/output.json | 210 +- .../existential-type-param/output.json | 159 +- .../output.json | 229 +- .../function-is-valid-type/output.json | 107 +- .../negative-number-literal/output.json | 317 +- .../object-type-method/output.json | 1032 +--- .../flow/type-annotations/symbol/output.json | 119 +- .../typeof-reserved-invalid-2/output.json | 185 +- .../typeof-reserved-invalid-3/output.json | 185 +- .../typeof-reserved-invalid-4/output.json | 158 +- .../typeof-reserved-invalid-6/output.json | 185 +- .../typeof-reserved-valid/output.json | 1290 +---- .../with-default-invalid/output.json | 132 +- .../with-default-valid/output.json | 132 +- .../flow/type-exports/alias/output.json | 79 +- .../flow/type-exports/interface/output.json | 278 +- .../type-exports/specifier-from/output.json | 93 +- .../flow/type-exports/specifier/output.json | 120 +- .../flow/type-exports/star-from/output.json | 52 +- .../fixtures/flow/type-generics/1/output.json | 266 +- .../fixtures/flow/type-generics/2/output.json | 266 +- .../async-arrow-like/output.json | 518 +- .../output.json | 118 +- .../async-arrow-rest/output.json | 118 +- .../type-generics/async-arrow/output.json | 159 +- .../flow/type-generics/with-jsx/output.json | 269 +- .../fixtures/flow/type-grouping/1/output.json | 92 +- .../fixtures/flow/type-grouping/2/output.json | 144 +- .../fixtures/flow/type-grouping/3/output.json | 144 +- .../fixtures/flow/type-grouping/4/output.json | 119 +- .../type-imports/import-type-2/output.json | 120 +- .../import-type-shorthand/output.json | 696 +-- .../flow/type-imports/import-type/output.json | 867 +-- .../invalid-import-type-2/output.json | 93 +- .../invalid-import-type-3/output.json | 79 +- .../invalid-import-type-4/output.json | 79 +- .../invalid-import-type-as/output.json | 93 +- .../output.json | 93 +- .../output.json | 93 +- .../output.json | 93 +- .../invalid-import-type-shorthand/output.json | 93 +- .../invalid-import-type/output.json | 79 +- .../arrow_with_jsx/output.json | 406 +- .../arrow_without_jsx/output.json | 406 +- .../class-method-reserved-word/output.json | 607 +- .../output.json | 711 +-- .../output.json | 395 +- .../default-missing/output.json | 132 +- .../default/output.json | 3364 +---------- .../interface-reserved-word/output.json | 395 +- .../object-method-type-param-jsx/output.json | 211 +- .../object-reserved-word/output.json | 343 +- .../output.json | 66 +- .../type-object-reserved-word/output.json | 382 +- .../flow/typeapp-call/async-call/output.json | 132 +- .../async-generic-arrow/output.json | 222 +- .../disabled-ambiguous-call/output.json | 107 +- .../disabled-ambiguous-new/output.json | 120 +- .../function-call-chain/output.json | 213 +- .../function-call-optional/output.json | 146 +- .../typeapp-call/function-call/output.json | 132 +- .../method-call-computed/output.json | 159 +- .../method-call-optional/output.json | 173 +- .../method-call-optional2/output.json | 173 +- .../flow/typeapp-call/method-call/output.json | 159 +- .../typeapp-call/new-noparens/output.json | 132 +- .../flow/typeapp-call/new/output.json | 132 +- .../rollback-computed/output.json | 146 +- .../typeapp-call/rollback-dot/output.json | 132 +- .../typeapp-call/rollback-jsx/output.json | 186 +- .../output.json | 226 +- .../output.json | 185 +- .../output.json | 92 +- .../output.json | 132 +- .../output.json | 320 +- .../output.json | 132 +- .../output.json | 172 +- .../underscore_is_implicit_in_new/output.json | 132 +- .../fixtures/flow/typecasts/1/output.json | 92 +- .../fixtures/flow/typecasts/2/output.json | 251 +- .../fixtures/flow/typecasts/3/output.json | 198 +- .../fixtures/flow/typecasts/4/output.json | 158 +- .../fail-in-calls-with-one-arg/output.json | 119 +- .../flow/typecasts/fail-in-calls/output.json | 133 +- .../fail-in-optional-calls/output.json | 133 +- .../typecasts/fail-without-parens/output.json | 133 +- .../fails-in-array-expression-1/output.json | 105 +- .../fails-in-array-expression-2/output.json | 105 +- .../fails-in-array-expression-3/output.json | 132 +- .../fails-in-array-expression-4/output.json | 132 +- .../fails-in-array-expression-5/output.json | 159 +- .../works-in-array-pattern/output.json | 1387 +---- .../yield-extra-parentheses/output.json | 185 +- .../fixtures/flow/typecasts/yield/output.json | 185 +- .../test/fixtures/jsx/basic/1/output.json | 80 +- .../test/fixtures/jsx/basic/10/output.json | 158 +- .../test/fixtures/jsx/basic/11/output.json | 119 +- .../test/fixtures/jsx/basic/12/output.json | 160 +- .../test/fixtures/jsx/basic/13/output.json | 257 +- .../test/fixtures/jsx/basic/14/output.json | 158 +- .../test/fixtures/jsx/basic/15/output.json | 210 +- .../test/fixtures/jsx/basic/16/output.json | 107 +- .../test/fixtures/jsx/basic/17/output.json | 111 +- .../test/fixtures/jsx/basic/18/output.json | 150 +- .../test/fixtures/jsx/basic/19/output.json | 215 +- .../test/fixtures/jsx/basic/2/output.json | 172 +- .../test/fixtures/jsx/basic/20/output.json | 445 +- .../test/fixtures/jsx/basic/21/output.json | 231 +- .../test/fixtures/jsx/basic/3/output.json | 336 +- .../test/fixtures/jsx/basic/4/output.json | 253 +- .../test/fixtures/jsx/basic/5/output.json | 80 +- .../test/fixtures/jsx/basic/6/output.json | 106 +- .../test/fixtures/jsx/basic/7/output.json | 162 +- .../test/fixtures/jsx/basic/8/output.json | 232 +- .../test/fixtures/jsx/basic/asi/output.json | 160 +- .../empty-expression-container/output.json | 132 +- .../fixtures/jsx/basic/entity/output.json | 119 +- .../fixtures/jsx/basic/fragment-1/output.json | 78 +- .../fixtures/jsx/basic/fragment-2/output.json | 91 +- .../fixtures/jsx/basic/fragment-3/output.json | 277 +- .../fixtures/jsx/basic/fragment-4/output.json | 221 +- .../fixtures/jsx/basic/fragment-5/output.json | 303 +- .../fixtures/jsx/basic/fragment-6/output.json | 197 +- .../jsx/basic/keyword-tag/output.json | 106 +- .../jsx/basic/namespace-tag/output.json | 238 +- .../jsx/basic/nonentity-decimal/output.json | 119 +- .../fixtures/jsx/basic/nonentity/output.json | 119 +- .../fixtures/jsx/basic/yield-tag/output.json | 159 +- .../attribute-empty-expression/output.json | 130 +- .../jsx/errors/html-comment/output.json | 52 +- .../wrong-closing-tag-fragment/output.json | 91 +- .../jsx/errors/wrong-closing-tag/output.json | 104 +- .../wrong-opening-tag-fragment/output.json | 91 +- .../fixtures/jsx/regression/1/output.json | 255 +- .../fixtures/jsx/regression/2/output.json | 191 +- .../fixtures/jsx/regression/3/output.json | 173 +- .../fixtures/jsx/regression/4/output.json | 119 +- .../fixtures/jsx/regression/5/output.json | 160 +- .../fixtures/jsx/regression/6/output.json | 150 +- .../fixtures/jsx/regression/7/output.json | 123 +- .../jsx/regression/issue-2083/output.json | 147 +- .../jsx/regression/issue-2114/output.json | 149 +- .../jsx/regression/issue-8891/output.json | 667 +-- .../fixtures/jsx/regression/nbsp/output.json | 119 +- .../_errors/space-after/output.json | 53 +- .../_errors/space-before/output.json | 53 +- .../placeholders/arrow/async/output.json | 106 +- .../placeholders/arrow/sync/output.json | 106 +- .../class/body_expression/output.json | 92 +- .../class/body_statement/output.json | 80 +- .../placeholders/class/decorators/output.json | 106 +- .../placeholders/class/id-body/output.json | 93 +- .../class/id-super-body/output.json | 120 +- .../placeholders/class/id-super/output.json | 106 +- .../class/id_expression/output.json | 105 +- .../class/id_statement/output.json | 79 +- .../placeholders/class/super/output.json | 93 +- .../export/declaration/output.json | 79 +- .../export/named-alias-2/output.json | 93 +- .../export/named-alias-3/output.json | 106 +- .../export/named-alias/output.json | 93 +- .../export/named-from-2/output.json | 107 +- .../export/named-from-3/output.json | 133 +- .../export/named-from-alias-2/output.json | 106 +- .../export/named-from-alias-3/output.json | 119 +- .../export/named-from-alias/output.json | 106 +- .../export/named-from/output.json | 119 +- .../placeholders/export/named/output.json | 106 +- .../export/star-from-2/output.json | 92 +- .../export/star-from-3/output.json | 106 +- .../placeholders/export/star-from/output.json | 66 +- .../placeholders/expression/01/output.json | 146 +- .../placeholders/function/body/output.json | 80 +- .../function/id-params-body/output.json | 147 +- .../function/id_declaration/output.json | 79 +- .../function/id_expression/output.json | 105 +- .../placeholders/function/param/output.json | 93 +- .../import/default-file/output.json | 106 +- .../import/default-named-2/output.json | 133 +- .../import/default-named-3/output.json | 159 +- .../import/default-named/output.json | 146 +- .../import/default-star-2/output.json | 119 +- .../import/default-star-3/output.json | 132 +- .../import/default-star/output.json | 119 +- .../placeholders/import/default/output.json | 92 +- .../import/file-empty/output.json | 66 +- .../placeholders/import/file/output.json | 66 +- .../import/named-alias-2/output.json | 106 +- .../import/named-alias-3/output.json | 119 +- .../import/named-alias/output.json | 106 +- .../placeholders/import/named/output.json | 119 +- .../placeholders/import/star/output.json | 92 +- .../placeholders/labels/asi/output.json | 132 +- .../placeholders/labels/break/output.json | 106 +- .../placeholders/labels/continue/output.json | 132 +- .../labels/labeled-statement/output.json | 92 +- .../placeholders/statement/asi/output.json | 80 +- .../placeholders/statement/nested/output.json | 79 +- .../statement/top-level/output.json | 53 +- .../try/try-catch-finally/output.json | 133 +- .../try/with-catch-param/output.json | 119 +- .../output.json | 105 +- .../output.json | 106 +- .../output.json | 105 +- .../array-pattern-empty-with-rest/output.json | 118 +- .../array-pattern-empty/output.json | 92 +- .../output.json | 160 +- .../output.json | 186 +- .../output.json | 162 +- .../output.json | 280 +- .../output.json | 147 +- .../array-pattern-multi-element/output.json | 134 +- .../output.json | 119 +- .../output.json | 132 +- .../output.json | 120 +- .../output.json | 146 +- .../output.json | 119 +- .../array-pattern-single-element/output.json | 106 +- .../output.json | 132 +- .../output.json | 106 +- .../output.json | 132 +- .../object-pattern-empty/output.json | 92 +- .../output.json | 241 +- .../output.json | 267 +- .../output.json | 243 +- .../output.json | 361 +- .../object-pattern-multi-element/output.json | 215 +- .../output.json | 146 +- .../output.json | 159 +- .../output.json | 147 +- .../output.json | 173 +- .../object-pattern-single-element/output.json | 133 +- .../arrow-function/annotated/output.json | 132 +- .../arrow-function-with-newline/output.json | 119 +- .../async-await-null/output.json | 104 +- .../async-generic-after-await/output.json | 169 +- .../async-generic-false-positive/output.json | 185 +- .../async-generic-tokens-true/output.json | 383 +- .../async-rest-optional-parameter/output.json | 157 +- .../arrow-function/async-rest/output.json | 157 +- .../arrow-function/async/output.json | 132 +- .../default-parameter-values/output.json | 131 +- .../arrow-function/destructuring/output.json | 145 +- .../arrow-function/generic-tsx/output.json | 214 +- .../arrow-function/generic/output.json | 188 +- .../optional-parameter/output.json | 225 +- .../predicate-types/output.json | 171 +- .../arrow-function/output.json | 492 +- .../asserts-as-identifier/output.json | 133 +- .../asserts-this-with-predicate/output.json | 317 +- .../assert-predicate/asserts-this/output.json | 145 +- .../asserts-var-with-predicate/output.json | 212 +- .../assert-predicate/asserts-var/output.json | 135 +- .../output.json | 161 +- .../function-declaration/output.json | 414 +- .../output.json | 133 +- .../cast/arrow-async-parameter-as/output.json | 119 +- .../output.json | 119 +- .../output.json | 172 +- .../cast/arrow-in-parens/output.json | 159 +- .../cast/arrow-parameter-as/output.json | 119 +- .../arrow-parameter-assertion/output.json | 119 +- .../typescript/cast/as-const/output.json | 4347 ++------------ .../fixtures/typescript/cast/as/output.json | 423 +- .../cast/assert-and-assign/output.json | 105 +- .../cast/destructure-and-assign/output.json | 210 +- .../cast/false-positive/output.json | 119 +- .../multiple-assert-and-assign/output.json | 131 +- .../cast/need-parentheses/output.json | 281 +- .../cast/null-assertion-2/output.json | 92 +- .../cast/null-assertion-3/output.json | 106 +- .../null-assertion-and-assign-2/output.json | 92 +- .../null-assertion-and-assign/output.json | 92 +- .../null-assertion-false-positive/output.json | 93 +- .../output.json | 93 +- .../cast/null-assertion/output.json | 66 +- .../cast/parameter-typecast/output.json | 133 +- .../type-assertion-after-operator/output.json | 104 +- .../type-assertion-and-assign/output.json | 105 +- .../output.json | 104 +- .../cast/type-assertion/output.json | 78 +- .../class/abstract-false-positive/output.json | 79 +- .../class/abstract-new-line/output.json | 93 +- .../typescript/class/abstract/output.json | 316 +- .../class/async-named-properties/output.json | 172 +- .../class/async-optional-method/output.json | 213 +- .../output.json | 254 +- .../typescript/class/constructor/output.json | 400 +- .../declare-field-initializer/output.json | 132 +- .../class/declare-field-modifiers/output.json | 285 +- .../class/declare-field/output.json | 146 +- .../class/declare-method/output.json | 106 +- .../class/declare-new-line/output.json | 93 +- .../typescript/class/declare/output.json | 309 +- .../class/duplicate-modifier-1/output.json | 93 +- .../class/duplicate-modifier-2/output.json | 93 +- .../expression-extends-implements/output.json | 440 +- .../class/expression-extends/output.json | 252 +- .../class/expression-generic/output.json | 170 +- .../class/expression-implements/output.json | 306 +- .../class/extends-empty/output.json | 66 +- .../extends-implements-empty/output.json | 80 +- .../class/extends-implements/output.json | 227 +- .../typescript/class/extends/output.json | 133 +- .../typescript/class/generic/output.json | 171 +- .../typescript/class/get-generic/output.json | 149 +- .../class/implements-empty/output.json | 66 +- .../typescript/class/implements/output.json | 160 +- .../class/index-signature/output.json | 224 +- .../members-with-modifier-names/output.json | 344 +- .../members-with-reserved-names/output.json | 119 +- .../class/method-computed/output.json | 226 +- .../class/method-generic/output.json | 493 +- .../class/method-no-body/output.json | 146 +- .../class/method-optional/output.json | 132 +- .../class/method-readonly/output.json | 106 +- .../class/method-return-type/output.json | 132 +- .../method-with-newline-with-body/output.json | 106 +- .../output.json | 120 +- .../class/modifiers-accessors/output.json | 476 +- .../class/modifiers-methods-async/output.json | 346 +- .../class/modifiers-properties/output.json | 528 +- .../output.json | 132 +- .../output.json | 186 +- .../class/parameter-properties/output.json | 451 +- .../class/predicate-types/output.json | 289 +- .../output.json | 106 +- .../output.json | 106 +- .../output.json | 106 +- .../output.json | 106 +- .../output.json | 172 +- .../class/private-fields-static/output.json | 172 +- .../class/private-fields/output.json | 344 +- .../typescript/class/properties/output.json | 319 +- .../class/property-computed/output.json | 226 +- .../typescript/class/static/output.json | 174 +- .../const/no-initializer/output.json | 92 +- .../declare/const-new-line/output.json | 172 +- .../typescript/declare/const/output.json | 145 +- .../declare/destructure-new-line/output.json | 306 +- .../declare/destructure/output.json | 279 +- .../declare/interface-new-line/output.json | 93 +- .../typescript/declare/interface/output.json | 66 +- .../declare/let-new-line/output.json | 93 +- .../typescript/declare/let/output.json | 66 +- .../declare/var-new-line/output.json | 186 +- .../typescript/declare/var/output.json | 132 +- .../decorators/type-arguments/output.json | 132 +- .../typescript/enum/const/output.json | 53 +- .../typescript/enum/declare-const/output.json | 53 +- .../typescript/enum/declare/output.json | 53 +- .../typescript/enum/export-const/output.json | 66 +- .../enum/export-declare-const/output.json | 66 +- .../typescript/enum/export/output.json | 66 +- .../enum/members-reserved-words/output.json | 107 +- .../enum/members-strings/output.json | 118 +- .../output.json | 93 +- .../enum/members-trailing-comma/output.json | 80 +- .../typescript/enum/members/output.json | 120 +- .../shorthand-ambient-module/output.json | 52 +- .../export/as-namespace/output.json | 53 +- .../typescript/export/declare/output.json | 476 +- .../typescript/export/equals/output.json | 53 +- .../export-type-declaration/output.json | 290 +- .../export/export-type-from/output.json | 93 +- .../typescript/export/export-type/output.json | 133 +- .../export-value-declaration/output.json | 278 +- .../export/nested-same-name/output.json | 211 +- .../typescript/function/annotated/output.json | 186 +- .../typescript/function/anonymous/output.json | 212 +- .../typescript/function/declare/output.json | 172 +- .../function/export-default/output.json | 118 +- .../function/getter-setter/output.json | 306 +- .../typescript/function/overloads/output.json | 238 +- .../function/pattern-parameters/output.json | 92 +- .../function/predicate-types/output.json | 317 +- .../import/equals-require/output.json | 79 +- .../typescript/import/equals/output.json | 94 +- .../import/export-import-require/output.json | 79 +- .../import/export-import/output.json | 94 +- .../export-named-import-require/output.json | 133 +- .../output.json | 120 +- .../import/import-default-id-type/output.json | 79 +- .../import/import-named/output.json | 93 +- .../import/import-star-as/output.json | 79 +- .../import/not-top-level/output.json | 118 +- .../interface/call-signature/output.json | 145 +- .../interface/construct-signature/output.json | 145 +- .../typescript/interface/export/output.json | 132 +- .../typescript/interface/extends/output.json | 160 +- .../typescript/interface/generic/output.json | 171 +- .../interface/index-signature/output.json | 145 +- .../interface/method-computed/output.json | 226 +- .../interface/method-generic/output.json | 238 +- .../interface/method-optional/output.json | 119 +- .../interface/method-plain/output.json | 252 +- .../interface/modifiers/output.json | 119 +- .../typescript/interface/new-line/output.json | 93 +- .../interface/properties/output.json | 199 +- .../interface/property-computed/output.json | 226 +- .../property-named-public/output.json | 119 +- .../reserved-method-name/output.json | 119 +- .../interface/separators/output.json | 464 +- .../abstract-class/output.json | 199 +- .../type-arguments/output.json | 132 +- .../module-namespace/body-declare/output.json | 132 +- .../body-nested-declare/output.json | 172 +- .../module-namespace/body-nested/output.json | 106 +- .../module-namespace/body/output.json | 119 +- .../declare-shorthand/output.json | 52 +- .../global-in-module/output.json | 171 +- .../module-namespace/head-declare/output.json | 212 +- .../module-namespace/head-export/output.json | 159 +- .../module-namespace/head/output.json | 239 +- .../module-new-line/output.json | 93 +- .../namespace-new-line/output.json | 93 +- .../type-arguments/output.json | 146 +- .../async-arrow-generic-9560/output.json | 263 +- .../comments-disappearing/output.json | 196 +- .../output.json | 291 +- .../regression/is-default-export/output.json | 172 +- .../regression/issue-7742/output.json | 225 +- .../less-than-edge-case/output.json | 280 +- .../scope/callable-class-ambient/output.json | 123 +- .../scope/callable-class/output.json | 106 +- .../scope/enum-block-scoped/output.json | 106 +- .../export-declare-function-after/output.json | 133 +- .../output.json | 133 +- .../scope/export-enum-after/output.json | 133 +- .../scope/export-enum-before/output.json | 107 +- .../scope/export-interface-after/output.json | 120 +- .../scope/export-interface-before/output.json | 120 +- .../scope/export-namespace/output.json | 120 +- .../scope/export-type-after/output.json | 120 +- .../scope/export-type-before/output.json | 120 +- .../output.json | 173 +- .../module-declaration-var-2/output.json | 185 +- .../scope/module-declaration-var/output.json | 184 +- .../redeclaration-class-class/output.json | 106 +- .../redeclaration-class-enum/output.json | 93 +- .../redeclaration-class-interface/output.json | 106 +- .../redeclaration-class-type/output.json | 106 +- .../redeclaration-const-type/output.json | 119 +- .../output.json | 80 +- .../redeclaration-constenum-enum/output.json | 80 +- .../redeclaration-enum-class/output.json | 93 +- .../redeclaration-enum-constenum/output.json | 80 +- .../scope/redeclaration-enum-enum/output.json | 80 +- .../redeclaration-enum-function/output.json | 93 +- .../redeclaration-enum-interface/output.json | 93 +- .../scope/redeclaration-enum-let/output.json | 93 +- .../scope/redeclaration-enum-type/output.json | 93 +- .../scope/redeclaration-enum-var/output.json | 93 +- .../redeclaration-function-enum/output.json | 93 +- .../output.json | 106 +- .../redeclaration-function-type/output.json | 106 +- .../output.json | 119 +- .../redeclaration-interface-class/output.json | 106 +- .../redeclaration-interface-enum/output.json | 93 +- .../output.json | 106 +- .../output.json | 106 +- .../redeclaration-interface-let/output.json | 106 +- .../redeclaration-interface-var/output.json | 106 +- .../scope/redeclaration-let-enum/output.json | 93 +- .../redeclaration-let-interface/output.json | 106 +- .../scope/redeclaration-let-type/output.json | 119 +- .../redeclaration-type-class/output.json | 106 +- .../scope/redeclaration-type-enum/output.json | 93 +- .../redeclaration-type-function/output.json | 106 +- .../redeclaration-type-interface/output.json | 106 +- .../scope/redeclaration-type-let/output.json | 106 +- .../scope/redeclaration-type-type/output.json | 106 +- .../scope/redeclaration-type-var/output.json | 106 +- .../scope/redeclaration-var-enum/output.json | 93 +- .../redeclaration-var-interface/output.json | 106 +- .../scope/redeclaration-var-type/output.json | 119 +- .../typescript/tsx/brace-is-block/output.json | 200 +- .../typescript/tsx/type-arguments/output.json | 280 +- .../tsx/type-parameters/output.json | 144 +- .../typescript/type-alias/declare/output.json | 66 +- .../typescript/type-alias/export/output.json | 105 +- .../generic-complex-tokens-true/output.json | 487 +- .../typescript/type-alias/generic/output.json | 106 +- .../typescript/type-alias/plain/output.json | 66 +- .../type-arguments/call/output.json | 213 +- .../type-arguments/empty/output.json | 79 +- .../new-false-positive/output.json | 93 +- .../typescript/type-arguments/new/output.json | 213 +- .../tagged-template-no-asi/output.json | 145 +- .../tagged-template/output.json | 132 +- .../typescript/type-arguments/tsx/output.json | 208 +- .../type-arguments/whitespace/output.json | 92 +- .../typescript/types/array/output.json | 118 +- .../types/conditional-infer/output.json | 225 +- .../typescript/types/conditional/output.json | 144 +- .../types/function-generic/output.json | 212 +- .../types/function-in-generic/output.json | 158 +- .../types/function-with-this/output.json | 158 +- .../typescript/types/function/output.json | 264 +- .../import-type-declaration-error/output.json | 161 +- .../types/import-type-declaration/output.json | 240 +- .../types/import-type-dynamic/output.json | 357 +- .../typescript/types/indexed/output.json | 146 +- .../typescript/types/keywords/output.json | 818 +-- .../types/literal-boolean/output.json | 184 +- .../types/literal-number-negative/output.json | 118 +- .../types/literal-number/output.json | 105 +- .../types/literal-string-1/output.json | 118 +- .../types/literal-string-2/output.json | 145 +- .../types/literal-string/output.json | 105 +- .../typescript/types/mapped/output.json | 446 +- .../typescript/types/new-line/output.json | 107 +- .../types/object-shorthand/output.json | 291 +- .../types/parenthesized/output.json | 79 +- .../typescript/types/read-only-1/output.json | 105 +- .../typescript/types/read-only-2/output.json | 119 +- .../typescript/types/read-only-3/output.json | 131 +- .../typescript/types/read-only-4/output.json | 145 +- .../reference-generic-nested/output.json | 172 +- .../types/reference-generic/output.json | 132 +- .../typescript/types/reference/output.json | 106 +- .../typescript/types/tuple-empty/output.json | 92 +- .../types/tuple-optional-invalid/output.json | 131 +- .../types/tuple-optional/output.json | 198 +- .../tuple-rest-after-optional/output.json | 197 +- .../tuple-rest-trailing-comma/output.json | 144 +- .../typescript/types/tuple-rest/output.json | 146 +- .../typescript/types/tuple/output.json | 131 +- .../typescript/types/type-literal/output.json | 171 +- .../types/type-operator/output.json | 395 +- .../typescript/types/typeof/output.json | 133 +- .../types/union-intersection/output.json | 459 +- .../definite-assignment/output.json | 92 +- .../expression/await-expression/output.json | 144 +- .../expression/call-expression/output.json | 80 +- .../expression/in-new-expression/output.json | 79 +- .../expression/multiple-arguments/output.json | 92 +- .../expression/yield-expression/output.json | 145 +- .../v8intrinsic/modulo/01/output.json | 93 +- 3792 files changed, 38850 insertions(+), 472316 deletions(-) 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 a1a531180079..fc95a0db2814 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 124041c4bb99..9059e207d2f6 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 552cdc20f256..26b2c0163d14 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 a04f1d2886a1..48d502ae192e 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 4c435cd1a595..77c33f844e05 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 761463790803..d8c108f4bfdb 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 d70b2aedbf3c..4c1fc96c2f9b 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 b27cadb955a0..d26cffc23ca4 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 a224e1810b5d..cdd785a4ab82 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 8cf9693cb683..e016e28ae97c 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 1ab0eaed8cb3..2455490bd610 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 987906b2aded..ba6cb1038be8 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 1ef29ee9df41..0bb60fc14ce5 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 cae6a8fb2da6..2aabdd7f5b83 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 8be69c3aa8f5..6a9003378e41 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 58347c10e781..d122849e3349 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 7d9c9d9b4ac4..208916dfa2ed 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 620771ddcd6c..fb5538434aac 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 0bbd83f2fc21..9912ec343414 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 f732250d6daa..5941def92e3a 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 dded99c82fa6..cab3b14128eb 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 926146f69d85..3255fbd32dcd 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 5a8fc7b6fa1c..7e06280b4919 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 d42874927c64..521b8cf49c20 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 2967587b808d..722c14c6842e 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 43dd91cf3103..2a5e1faa5565 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 fac57ee10213..91107fa6e82e 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 075deef7bf64..c0e2eb4b67c0 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 ab6d764cc245..69a7bde87a4c 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 1ca2d06ab94e..efa9a47df667 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 7b20bc5bd4bb..f1ac27f9f2d2 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 1a247a92573c..08d6fd2f0fa0 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 cc036d7a803f..a8f8ff1f10d4 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 f8ffa275c878..b45e3336f48a 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 7a2e654f2829..556ea3afcc6b 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 a17df4edc69f..16e46725aa29 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 28c34291a938..349455002836 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 aea211ae092d..6bc1d79698b9 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 064381b180f6..64125f64db72 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 f606fc8063af..340a0dcdbce9 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 dc0122606f36..74aeb35dac49 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 caf293552bc5..7b5829535204 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 8eaa162030cd..22e32af6ebf5 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 7ad34b6ae910..c2f51bff4fbd 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 64064c04c2b9..f39f3fcea78e 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 7da940320363..2ac4e66efbeb 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 2ada86e94d1f..507489c6bcba 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 23d47e802bd1..e1770c6a4c76 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 586292ca2455..891dfcf410e9 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 d0db9dd2f9f2..1285d54959ad 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 96d91c3d80d7..f4b1a1782cd5 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 ec252128aaf2..36a3fb0ada88 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 f30a6c123cb2..a71d68fda717 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 6cd38c81eda0..27220d222a07 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 52e007997957..7f0500a929df 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 2a57774bc903..bec89d06786c 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 c59930c19e03..49fc67ea3f47 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 fe203d04bcc6..3d1d9274415d 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 a6fd50b79053..342a51f0b192 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 2e4db8c547f6..c11287a7b231 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 19de7b03868d..53782f982cbe 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 a3ddc206db84..a655ee4c1fcb 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 689a18f8031f..1318e397e397 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 b1f49f00e99f..c765cfd25e75 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 e220d3207f6b..fb945ca37c11 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 742ca4b45728..20ba00fd6d9c 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 894aebee85f1..945e5d3ad170 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 20b84ecf03fa..97c5ce5eb36d 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 9e0985f69a92..98905e40ab03 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 6f4e90ee1d7b..a3fd8b4143c8 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 9da6d1356be6..11c1977bfa81 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 7b1a47d91e7a..00cb9573c024 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 259b3ffcf47c..b127e470165f 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 a454ef5bbdb2..6cafe7e41c7e 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 74684515ddeb..eb51e1bb0421 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 3983b0f1997d..9442328131d0 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 74684515ddeb..eb51e1bb0421 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 47117344de0f..5c0640afffe2 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 2f34027dcd75..270017fdd9a6 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 c32f37d64bc1..75e686beb7d2 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 2aa1a971decd..2eeced4be950 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 136553fe54ec..f4d5ed29410f 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 99253558c815..7cc466fa1ded 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 f48f7a786775..922adbe94650 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 694c18f640d7..3b6ea25634f9 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 f017f0fa5f00..bf01e24b493d 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 758528386efb..dd515037db96 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 0444f665d33d..26e7aee9b70c 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 76f48823dd81..9d5f3660774e 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 899412645531..294f5fbc9c7f 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 cddf0493cba9..532647600b3c 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 ab1db27cf0a8..680f5225864d 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 a465e0c09fb0..814efb6b1328 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 8c0ce7e4c006..65c88c1b7f7f 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 e759f28d0434..b1c8e29872ae 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 5a4c9d365dbe..01f965585c34 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 40bb3df74915..8f5d30047039 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 1baae9250df9..e69000f54df0 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 5cd4c6abd102..df5372c2f51e 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 f9626718bb97..80f8d1c3c584 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 54bc80b8062d..26b9977bfcf6 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 6d2e82b586ae..9668ddd49b8c 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 a23d95cfc217..fcb6f91989b7 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 a6bf56aa7623..251519a88b9e 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 49daeec3aef6..40ac7749d89c 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 205470069b5d..7e9448c87dd3 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 b6f764fce7a5..c35c68c75903 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 ebd20401ed0f..ae3ed9341b75 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 c1b2c1a85a29..71081aa3160a 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 eadbdeeb68f8..f4d8dbbf8917 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 94ae24d249a9..1da2a0b7558a 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 af377ce80461..b5bdce171b81 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 454a440c3426..7840aedc9085 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 d2a2c6f9982d..81976e9bfc97 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 fdad445b5deb..209a1e02c0b6 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 e5bce9fb21da..5b9ae21d2be2 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 e28bf9f399b0..942dccb6e671 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 f925321aef98..047bfbf77f03 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 239db26973c2..07b40a61bf02 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 0be8a0eea29f..3a0cc9ec482f 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 8af98b16aa63..152ece9b2f9a 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 bfd483ec7fb4..eb373fff2969 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 508af9fc85d2..dfec1320529b 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 996bc32d815d..40f3335e7eb5 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 11a778f34809..120ad6bc705e 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 a660653865e5..cedcbba92a8b 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 ce100047f2fe..a40f509053a3 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 22aa25d45da7..faad719a5d09 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 e59b53b2e0ed..f4e80f2ef2db 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 16b50c7b3875..bd90c16b5dc1 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 dbff016172cc..783a60a237c9 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 91e34252dbc5..95c7c7580f87 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 6293e83f540f..d83b949cce1f 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 1fb0ddca3246..91a67c0b14ce 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 970a82515bc0..69c62635c89e 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 bec71854b068..6b9a913d2dd1 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 2ab38b87e88f..c45fef74fd3c 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 ed6720762308..f97a48e3ef0f 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 d3f3d5769276..3aa29e11dfbd 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 329db7b04655..95736fdee6c1 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 1cf6441fffc6..066e56384368 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 d2f456d828ab..021db7e307b2 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 69ff486c62d9..8bbf441a1bd2 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 e95ac9779c07..b34917f7e658 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 edf979f658a8..b0e0b89e8fd3 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 4ec3778aaff6..73308081041b 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 7c5bfd0d7d4b..60a5a8fea2af 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 c79985fcb2bb..1eea2fed3a3c 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 abec94d30ee3..2e5490d094d9 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 311090fd6ab9..a9e8ee6e33e1 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 65ac2b95f145..287f2a053320 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 832564eca470..d0e31b332f44 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 b0025ea3388c..207c5b961330 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 7bd85bcc02e7..31c748c495c7 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 8890dbc0a524..b700e71957e6 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 74dfc01529a3..2a305b55c4bb 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 9a7b0d5681d2..6b3dccf75cd9 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 aed252faf17d..2a3507d72d53 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 0177eead6074..3a2644e84250 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 2e5825aecfbb..6dfef381edf5 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 38dadd707806..0bbb304c6e3d 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 f8bf7daf5bd2..b86053f12aa9 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 82d3e1035a29..d55ddd1b61ea 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 0c39b167df03..4bc8d58ff2be 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 a446cdb8fba9..90f241ea29b9 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 cb1cbf606f18..6ebb1a398b70 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 fbb61eb44b1f..35c3eaa5e2ba 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 4d221db72d8c..5ccfa4a76dee 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 f3ec5d8857d3..5fa10d856cd3 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 a0d7dd658252..5fe9e49343b7 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 3d93d997f972..e7068fd5cac3 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 bc3d887ec081..645ac82f5566 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 8e2550dfe5dd..96d56d51f44b 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 88fce0c71325..834a12a4ebaf 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 c2fec5bfcf25..48a925190076 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 c40e59d22d69..e7664cfc936c 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 9739e7a6f375..d9b4c0dd9e6a 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 603d0ca75c7e..798e7f2d3c09 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 0c86ed9cfa68..2470e7fd781b 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 acdf9d06a913..87c3e0871fce 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 16a8b4d99781..1798f7e29651 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 1ae88c0512af..6237a6d3dda1 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 f9aca6bfaa5e..31b78a3ccbd9 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 620fca404822..2b55f4dc54ce 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 2179523b38b9..e9b595563644 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 4a76c9ff3935..a51e468a580c 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 82b23bcc25bd..334ceaff24f8 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 88d60f45c549..d2960c20fba4 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 15827d111508..00218c0e04b4 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 e9f55cbe3989..f83d741ef5f7 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 fd8b54221703..f8707b901884 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 00936f4b0f7e..cee848a92aed 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 533a669dfc98..38ba1fbd5d15 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 b017ac4d4b08..37e26f32fe28 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 4a0bf74a8a4f..eb5d31ccb83e 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 add0b1fc84de..96c7f5c02425 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 e0b6f1f741b8..0598d0ee00d5 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 db311ef3bbf3..b42af7e2ffa1 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 d6c2f9a3e0dc..f90dba3c9ca5 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 edeb7a67b95e..8a3977855df0 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 65b21159bd92..7d67196d62ad 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 c2adfba4b5b5..7d87c8fc6e14 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 13cc3bbdfcd9..5226c2ebfb78 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 a73cf0cf3f64..967c39273de2 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 8a2005065f87..71da5f24f236 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 79e6ab49f074..37f18c8f1c3b 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 da4b728c5eea..85ab5afc448b 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 fcbcba00f535..62eafe1037a0 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 7e1b9c51b14f..b6ecda2e0a59 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 0fb742510be3..75141bc2be24 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 ad8dec06b08e..8276ce96fcd7 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 bb04fff52615..bd09306d3cbe 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 6dc11018bc6b..e636283e423e 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 03f750d1dffe..726d741dfc72 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 1be43c5d3ea3..f9d37f650fdf 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 7fdf6f8aa3eb..509a2fa878b7 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 4e3733ed6b77..910c4ace54af 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 d439d193a709..b84db6eff743 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 aa17794200f6..a9cc99268998 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 0782650869ea..f2ef76b6efc1 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 a036d7feee03..d1cc74acf793 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 3f0401d051f8..793dc10c6cdc 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 12c80600d855..94fc52925207 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 7a4cb9d5bdbb..12de61e60e78 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 d95f951f8eee..68a6d08d7290 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 4449ac1fc386..cdaf1460cf29 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 11b4c83b84f4..5d60fa9a4fc9 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 33ebd32af2c5..cfb1d7d325fa 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 c6716f6d5b6c..e4ad518b4942 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 77ed83cfe580..ca44a6f181d3 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 d7d6a0eb4c0b..c9172b4c0ee0 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 55536bf01e31..928ebf4c4cc3 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 b0249f734e45..b2def55e6015 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 42134f8776e6..f135242de7eb 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 64aa2ad30132..ad23fc9dbb1d 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 8a205f26f6e5..299c2101fd33 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 76106e9d4fe9..8450ad8b9769 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 19599c7b1c08..fb85cecd3e35 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 9e8b8d3fa8fc..3565086f710d 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 c7661fa85d28..9d88d7ba1cc3 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 77ed83cfe580..ca44a6f181d3 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 fcccd1684f80..ba82d25b8771 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 ab60eb5ab717..b9a75b550b6f 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 beb961a6f029..156e6398fd75 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 c2de2c5ec37c..0ece3ff33ff3 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 8ef39b3fcd2e..ea8daaf85fb0 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 c75389bc6cc9..776f47eea15c 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 0d49dfa5a763..29d1920ab76c 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 9256d55782d5..6bd9c8a48889 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 78cba5d9924b..73ed52c6a7f5 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 a5a52c1e2db0..53a8bda384b8 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 3d18314470cd..4bb0f76377fd 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 ace60cd560f2..b3d6b552a8ff 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 e1363b4f98c6..09238f85c9f7 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 9ced89e22512..45ca46801c09 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 4c6da633f927..4305f9c34d31 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 2ae61364283d..ed4728f171eb 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 62a87b6a4927..c3f3df7e5f5b 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 987e2eb78524..2ccf078c9d9f 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 077c01c70177..2ba631424d4b 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 9fc98d2128b3..5d0d19837127 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 6cefd83e3214..320ab232013c 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 c12350d6a4bf..9c04a76a8e7b 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 475c1afc13f2..dd1feb7b3371 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 f97a88dd993a..b35bbd4d76be 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 f12219cdff51..cf0974cabc31 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 d29652f48f6c..61416582674e 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 598c96a56b18..c606339577fd 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 9eed13dbf1f6..61bba56429a6 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 9c65b7b8cb98..b2560defc565 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 c2d1aa9e8258..1fad75e9a989 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 2292f444ff6d..765527f7771e 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 338b1ef14f8b..26d684ab89aa 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 64faa9a0c09c..46dc4683a1c6 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 245feff142cc..e7d5402c9273 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 cb147f686b55..bdc2834bafdc 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 d6d6794fe5b6..1c191ef723d7 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 4b8305ce1e0f..8a4c16c4b1cf 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 1c109c350cb6..1056212c976e 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 46cd57504eba..8bb741bae2e4 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 769e912a7e65..c6a529bc13c7 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 db7aee01cc0c..54266dae6d5b 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 8f9a8687f6db..9636de19413e 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 078b39d33a01..7dcb2358b5cc 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 46b9ab0f4ad1..cfe4ca1e2622 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 87c6c0164063..934336937dcf 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 d2e4bb70135c..3fb7587ba6e7 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 3a5f512ccc9e..37986cf13198 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 ea8f8f1ee102..17cddefa31e3 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 58dc5fcc7b7d..8328102958a2 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 2dc7a4b042c4..0d0752b80600 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 78775d7e092e..e9a09cf01ba9 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 4f0b42bf91b2..14379aca37aa 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 cab2b6c2898a..855a078a1e41 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 ef81cf2ef043..2e3d9f6a4377 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 eca6e822f6e2..4b8a7f23f0ca 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 3a19ed468dc6..923dff08f3d6 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 087317911d2f..dbc5316223f1 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 aa78dd8a115f..c66442c43c18 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 02714a4af3c8..2fd8f619a838 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 ae77e9c9c0b4..d4c5c67c9404 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 8cae09284390..cd2ea8ed46f5 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 0623e2624bc9..35c53b58e73a 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 4ce81575447f..0dcc76e29bfb 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 d418bc0ac898..b132a32e5e5a 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 dbb1747c7888..024dcc1726ee 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 976ebcc7150e..797c741a6e74 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 b14a15b253be..320fd8e86994 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 618cec22e8a6..d69535cf3576 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 1ae8f40f9740..3036808c3c47 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 f719006e5af9..bdda42876a8f 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 09cd88be36e1..12f3b1a77a2e 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 612f1abd2b91..856e2d676e20 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 43f74a614620..da1bb68d7165 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 fabfd48570db..fb3e701b7455 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 34df72d1dd54..12be6ac78804 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 2918b16e85cb..5ee065601ed2 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 ea1e209f24bf..23e0a043e22b 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 c0cd7f551693..b6cb58fdb09b 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 dc6bc1917edf..129603ce64aa 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 738083370c5c..ccc3410c913f 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 3ff3f82cfe2e..10bfd0ed118e 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 de556d585469..4e092c03ea2f 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 b8b637790518..4f5b295c2b96 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 67715145c740..7675a5829970 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 2676e600764f..191390407c53 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 26eb0ec7e251..34304235c8c8 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 367eac531099..e5cdd1426df6 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 1295bdfcf9c2..e91e6f437f78 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 acbeba45c5e9..9a1c53c8531f 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 5251cd078d22..758f4d4bd8dc 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 4d485ddd9600..16e82da75c18 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 0099a2d97eaf..2835e746897a 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 ef879544f9bf..5caef91e52b6 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 7124a7ba6fff..cb43070c2777 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 0f104da5ae82..bca060357b6c 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 8721f9d98403..d1a65bb67c2b 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 49094bb0e6bd..fb80b314fa31 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 81194dadc77a..b8f82071b213 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 b1589f69dcee..a079acf84911 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 7bb5acfbedbb..0453b860b1e1 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 91b008540089..bddc435c75dc 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 86fbfde778b7..a0ef6bdc2f5b 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 d5cdac1d3659..352ffb6fc1d5 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 3104ab9ccf37..91afc6eae077 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 d26abaf0e394..e14cc06b048c 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 db77094d7822..02b469112a4e 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 1d7e31b52684..518d4ff517eb 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 77acd2e88e34..68368affc159 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 ea4245152521..834b20a1ebcd 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 a0915a8bde84..058bf6f3e4a8 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 4a6668b95a21..2c224fe25348 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 a110a24d4331..fded91217c51 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 9750c148e9bc..3cacc47f31a2 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 ad99f992e1de..834ffa769d2b 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 bc58b1136578..843a9d4db0b2 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 c6c506d5446a..902977b89965 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 2c6c0d75a8da..695e91aedd01 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 7f0a025696fd..26b3458197ef 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 aefb638ad9fc..cbd2d18d221d 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 bf57e074ccea..ab48d0f9efad 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 9392a4586df7..67a3af336f2c 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 110a8a000bfa..2b437f12048b 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 867fc3fc002c..c289ddae854b 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 412ba4db54fc..6ee561c3d41d 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 d4e339d66f8b..fb37cb7dd911 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 ccd2a5557c69..50691134a049 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 3fcb48aa328a..79fce2dd496e 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 395230285f43..a496fcfd3a10 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 40442d2489fb..8e6358875358 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 074c0c8bb638..db5aabc02b2b 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 f58cfb077883..07e673f84ee2 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 96fd3b7e93cb..0bd7432907df 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 a6f087d5e25f..90a7b471fe11 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 205e7e5731fe..636d44f1cad8 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 98570e79f91b..a7c128bbeb82 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 aed9954aa3f8..e6e9eaa784ec 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 ab8810f09c9b..5929da115ce5 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 183a587ddc76..97e46379c3fa 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 145f80b57b91..6146b7973972 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 6ff0a1889e20..91415c46c88b 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 c9d958dcaab5..07b0ebfb1a3c 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 5f9a3670055e..0652e0f83066 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 b3ef7da7cabf..dea4eee607a9 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 1b6d860e3cc0..c4cf365f6234 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 adac14cf8876..1f23cac3b631 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 511f68de826a..86a454183f22 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 91c5a480cfef..1f2858e789f1 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 db94d9b88a62..e0a04f74bd22 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 74d07f2d4c0a..58ddd297b509 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 3c7e8925fac6..f86ce18fe58a 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 e99a33b544eb..53c2b7304b97 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 d3904d2ba2e8..7e3261f57e9e 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 0625ca759796..6601db05807a 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 e055a31d0008..17909837b80f 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 219acad00806..8b551d3126ba 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 5d71c2b58f20..afb15fd5fb13 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 3ca6c097e9e6..feba7e6eac1e 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 887b2e1ad18e..256b8c05aef9 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 781d5a1bada4..b2ddf7c3cc14 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 56da6db3637d..3d544b67bdda 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 6687dfac3aea..0f449dfd9739 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 da4ac2be40ae..4f667276435b 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 77346f390920..9d16601e5669 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 62ef9146ea51..1189e9273727 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 2ba79ca36077..ac45a4338b73 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 7ccd83051b71..57a5959b416f 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 395326a8c644..856912990e3e 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 8db37405c8f9..d6ad31a3e965 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 8332cec4ebfb..c4d3d78908c8 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 54af5b6d0b16..faed8b50200a 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 284fac8c4357..b2d2e40318a4 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 ea3146a858b9..4e52a2f94326 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 6b6e666b00ca..1591ec979e44 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 b52b27d1ef37..42c6c5a67aff 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 ffcb3680fd0b..9a1a7ea60803 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 22fa47db887b..3e85623558cf 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 5be4b4f8c146..03afc3896cd0 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 c02bf897d3a7..620c3d2cc9b8 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 fbb1d3b5d554..5dd7b5d3fcd6 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 fae32b78cde4..d9a89994f01f 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 37312f42ce97..32180fcde928 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 68d637a98170..d42d61f8a543 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 99a3e74a04af..d4d2cf5dfe67 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 8770df4abba7..edc325840380 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 ec3792255a15..46112c6c8828 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 a15882b52dae..6854d518cf5c 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 ce2cb3d23d67..89b9c579fa1c 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 57d55fec0b5d..b0387fd4ff59 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 9a7a240c5b4a..e86e86ca2246 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 85107220dae5..de49f7815bd2 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 6cbd0876600e..609aed8d6228 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 d672770fbcdf..c1d2713e76da 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 ac910291b748..71a10a5324e9 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 56547ff7be13..62e99551071a 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 ece139488ea0..ba27c1c609ba 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 3322d7a98a38..daf210e071a3 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 0e5a7503ecdd..e005c14c8e87 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 9da054e4ab90..6ec5cbae6e42 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 f4f5b906e9c7..52f3a5538421 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 812d26fa77ee..7f6c378d08bd 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 a26b8b4009e1..c04c402e277f 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 b8eaca925ad4..501517e632d1 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 3fea78461b66..9ac27929ac37 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 fc0c10f2f765..4d6a82553f05 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 7e708faf3684..9939c1143924 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 813c4e9b903a..18e0bcd2fc99 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 d3a105c584dd..8ce94b960543 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 96e1bccd5184..cb6827eebf81 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 c32c5b089115..6d89822f1568 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 3844a4d151a7..d3af5238b363 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 9d008175f644..a68f97021f5d 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 2fa4b803dd1d..185c7ceda3e8 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 3d2ee0555b85..a0bb1f5c08a4 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 c90c4eefdc6f..322359217c2d 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 21dd434a7ad0..c7e5a73217d8 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 1a0a1b954720..3ae13a3f41fd 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 1db488318bdf..f0be819b2d86 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 d44909ca998a..6c34e22a0044 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 38cc0c05b021..cc7b3b44d69e 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 380e6ec698ef..3af7d55ae127 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 8caddf6f2a1e..26fa046a1204 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 e43da2374537..5875cb58be47 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 d3a105c584dd..8ce94b960543 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 c32c5b089115..6d89822f1568 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 b83145faf5ab..37451db0ed1b 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 a7c8d4f9a0ca..ae9cb401dddc 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 0a8172ce68fc..9dfe7b1c37fb 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 2f1c8737b22e..39c5663443fe 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 7337acd3e8fd..3939133b3b8a 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 18bc9b977ca7..d65c7f7da91a 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 59ae007d6fba..336add4fe32c 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 d26e37b08031..ac86039c659b 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 3025d6bfbf72..815a430cb2b7 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 f22f0efb0609..392c525509d1 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 1567b18881d6..62cf67d34e04 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 7598b7431e9f..fcd0ab9858ca 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 7101109189a2..d557326e9973 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 ea571b1b6b0c..8b919bca3185 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 dd5fca85f2e5..3040718fd546 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 3b89f63424e2..429d686ed48c 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 2973f3517639..79c71ebb542f 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 e328a1e98ef9..ec34fa9d5ce8 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 95091e65367d..2ad942222305 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 8473055a411c..c85c53c215da 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 c9974932443e..8635017ed5c5 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 cf31420c53a0..0090b6011203 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 59618c91e2ca..439436ef7e82 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 0b6b047c7b58..b68c731a58a7 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 7def54a91b1e..06e1564e760d 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 64f2c09fd91e..52dbdc3d5ca5 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 34c1b59c4e79..48c2df5468eb 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 35af060b7c6e..3c4ac7fd38dd 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 7419ba446dc9..e183294a232f 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 ede15490b692..c252adad5c36 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 aeccd1a07ed9..2c691b4f70f1 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 4e8af9c85d04..9e3046fe279b 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 49a2e0086f28..2502c52e184c 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 6d1387258a3e..887c41149531 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 d3b5c3628386..250afef7d81d 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 5523233f4763..fe7e90ef9417 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 d0eb8e29b2a1..03985eff0b57 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 d6510094936e..29ce013f0b8b 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 98e096877880..60d4df26f9f4 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 f974d83f5a98..4ee83b14028e 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 2993cf648835..0c8905156ab1 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 4534376b270a..3ccaace1b183 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 cb41c2783446..dc142e76101d 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 d8df2c1c2d07..d887db53f5e6 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 a2fc6cb4db0e..ded181413784 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 4f1229be25b8..a7ce0eaeba38 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 b192978c9ffd..96df76bb0e55 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 666876f21a68..fd256c8b41a4 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 343c7244d1d0..f4096149d8ed 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 6d3d9feff343..2c29a7df14b9 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 5eb3bcef0b18..8caf22da60fa 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 81ea6460e38d..d559db4b5683 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 2201ea3de8c6..a3eee1ca1117 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 be76deabc7a1..cffcb241d435 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 414e229fac38..3d7bd0ac8ee4 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 32efcd46a632..4c1f2d2844f0 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 e3d3f255c253..dcf994402ae1 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 2e801038c78d..c7306ecdb68b 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 60bb34d552c3..0bcd7848fe1d 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 4ed420518d6d..41fd57994528 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 ab669586dc27..160544579047 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 be76a2099b54..b184d5881724 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 c249f39209bf..07cfc9324623 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 f945eeb57491..3b77c9170b54 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 f2ff5d38de33..0581517d990a 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 2f734055a47a..aafa09421ccc 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 60ac3ce8c98c..df3094e728a8 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 766ec14c5a33..bcaf874206cd 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 0f2e3c5dce01..65f5a908f019 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 666876f21a68..fd256c8b41a4 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 7945e482ca86..a1ab8b4653ea 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 304b4237e9e7..7caed97929d9 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 98d2e052715b..a53f5cb5d29e 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 90808a26c8be..98b811bf5fd6 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 55552e2994ca..4323a83f4c23 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 d1a07b1d64a3..b68ff2e27c8f 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 75ffb7751c69..1d8ef585d5da 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 7316afbc421b..baaa39d495cf 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 d552a2e28574..3b7901439092 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 69ce880368fd..75cbded09480 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 f7a4ee21f42e..1e7689710f10 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 8cee92a6a4bd..333c5c39498b 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 5f71cebfc7e6..90d05b8eaa65 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 3cfd26fb69e7..65791b99b872 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 db86a852e1e6..396a6c89cbf9 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 8c262ae27f29..2f9c843e403a 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 8239aac13da5..2b827120af68 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 318e474d79f3..25ba7b001530 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 0859973b9dec..b2a7aba814d9 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 a5c684bd18e6..09dfa5319597 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 2c263698dcaf..719c0b3bcd48 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 702cd2b59f56..6d43f8fc49f5 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 30281e1958c0..e3a3e3b9017d 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 c6d8d429fa71..9cbc40e7c5f8 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 befe2fa25a55..0a2344038956 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 d3b1ca7ae09c..87e0021bd4bb 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 34af0a196c39..d0a88458d8f9 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 21d7b12022aa..5b80a70f2a7a 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 39ef331a20b1..c2e81901a1f2 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 132483692bbd..6065ead49801 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 c49b14fdab31..50c48c3446b4 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 7afc0a671971..c845e6ff49a3 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 9b383cded8fd..e73c9a97f508 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 d52ff8418d12..2aaa38345fac 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 a7d3e10860a2..765b5e13a1e5 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 690fd47a348f..a754dc4717cc 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 d20fe505db8e..ec6c58c4a7e2 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 9618821b33ab..ec09f363c448 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 28d7a52866c7..2e92cc04b615 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 ec6cf78bf96d..3bbd6360e89d 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 e05c37f12629..230f98af8a2e 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 f9e7a22c6b08..f156dd8eff1d 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 f9e7a22c6b08..f156dd8eff1d 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 30f3c2d9c3fc..26e4bb1d5e9f 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 4239fdfb2b04..aeae1aa8a71f 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 770f5ef71821..d561fe3125e1 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 75e2c8416701..c6e1f8bf31b5 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 3b0df6852fce..a1b891f67787 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 b21e99bf2e8a..5ad0d7459559 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 a10e4151e34b..aaeac684c1f4 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 20849b383b65..db9c867205f3 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 9446cbbae1c5..86fa33c5b8af 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 a5255d5fce90..ac4cc54d118e 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 bcb0e150eda3..8f33cfd60630 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 85fdb9eb27f1..34d1f995b463 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 570feb3f99a8..782f9c962a58 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 5dab1af37b3e..2cbe6c5f228f 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 4d36c6d5cebb..10e5ffff0ec4 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 ffa4e3f03d34..615599921350 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 ca378cfb321e..e713c6daf609 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 e88d6a6431f2..273d62967486 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 da0f5a5a077e..b8debd493dbd 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 138fcb2e6263..07143b67c9a1 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 3aeb059890fd..d269de6f532d 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 508faca10fbb..9bfb038fdbe3 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 32add9ef9dc3..3e157b067a91 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 25cd08d3e7e6..b173873622d5 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 3c9b2c223f85..ef45bffe3959 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 decc68148f95..06adbec3fdb4 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 13ba3c4eb97c..85beda94d481 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 a6f1a992df51..eaa53e603013 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 2b81d94ea76b..fb5e0996bf7b 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 166849449336..2bc5cf54b227 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 ef826212c27b..ffa484a7df17 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 69ff486c62d9..8bbf441a1bd2 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 f3046102c20f..7ba45ecc53a6 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 5f31b1a576f3..6ff8b0773cc8 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 9656f26c45a8..43e794894ee1 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 5a8ab1f21115..e51d6f3e5110 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 e3470fcb4ec5..4dfa59a362d9 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 04f8c8c1df7b..f7c0c7ae2f1c 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 fdc28b5e16ef..dc27abbc374a 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 88a3f339c132..7ceb0644f6ce 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 d73cfa2bd010..1a8fc198f200 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 3d5c2a07c806..2770669d1421 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 f97d7f0db889..e854b9c5e72e 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 4cbc33abae7e..9d70fca940ae 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 0a80d6e9f99b..cb05858a6f27 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 00177fa4ac08..9b316c6cf608 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 09568c70bbb9..4ead80d69a56 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 9eda4fb8ae56..a7556bef8901 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 1ab735185892..5207b62072a7 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 6a343317ea61..a7fb3e572421 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 65fe6001d2c6..8813fbf71961 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 328e55a13f5d..4fa31326d388 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 0ffcd2fd0520..d5de1e2c20d6 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 f78f786f6aa9..c4d1636033ce 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 1f5262e935f3..a135021f7ae8 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 c8f7cb8d1c12..db62df91f9cd 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 6ecafb90e3ab..8fa6cbb49774 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 7c4b9b67d199..05b7dbe0ca80 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 0a4a21ad4d20..76937cc4f1a5 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 efd21a8e7118..5b9c55e234a8 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 8f7759b25af0..2e79028e2853 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 7d830d569103..0c6596304a0d 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 f82a656eae43..0a076f1f941d 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 3646ce22df38..7b4bfce9c84d 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 27df8bb4401e..405f42004ab4 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 7b98cc79a762..ef78a8daa03e 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 5a29fd6b5f7b..9c735221c5fd 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 16f7d7f8e50f..f0bbee72ab6c 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 b84a7826945b..2519d3595ff6 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 8b1e9a9a780d..41eade104e2b 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 bde13b8bdbda..838c1aea7fd3 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 b85f54f50027..4e70874d2735 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 d890ea49e1da..c3c20c0a10f3 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 155cc10f02a0..b97f056fd199 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 556eea44650d..26b3ee955998 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 fbffb7c6994a..32755b31ea17 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 0afdc7b4d271..9bde6c44ee0c 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 936a7b0183e3..40500649a6b4 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 e6724bdbc964..5a6b9c5fb01e 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 6c74fa327abb..553575d2fb39 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 507f3b6495e3..eff35b30466a 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 e3f8d57824b6..c03c0eeb2cbc 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 6d1a2d6c3fce..f6604179cee6 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 0059c885f4d8..27beba5b2e65 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 f5d632c23ace..425fd47bc027 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 236b7dc15afa..9aa7fd43bbb8 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 d95df678e8c4..a9fc063b1be8 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 8842ac412ce6..0533a2a4de2a 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 17c1ae03468e..1205de6403ef 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 609a782c235a..13d4895854d3 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 d5896aa4d598..58f5ce51ab69 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 dc261c3dcbfb..4b446a0ba9fe 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 b0f5399086e7..ac17d0535968 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 96851ba7aa04..7b98d28e08c6 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 ade78031a623..aa5c55bce7bd 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 c51c3538f169..c1d3f4cf73f9 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 721e29212ee3..bd3f171f6164 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 85fa32674b37..c45edc3f9592 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 e6e2ced3bb0c..12a2c9548cf4 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 2c3d3871ec80..978664b05799 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 4354932c617c..5b853db406eb 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 720c37df7a15..908c57bb93e5 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 93d70aa80f8b..b2f6cfd13568 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 77846750f6ed..1cd48f97ea7b 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 ecd45f67f5c5..22e958dfc7ad 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 c2a68fccc8ec..d3971492101a 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 f21958466322..e6e46b39044b 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 3b6eb431c234..7b0cbae5415a 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 53f9ebb8102c..32383a0760e1 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 3d714b032e34..88d6a935b3d6 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 f5f3e41b514d..07be4bef8b99 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 64d4a8d35758..eee1bada9870 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 447bc2741c32..55524234b199 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 214b3e5417fe..525e9f0ba047 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 7fc8d24d386d..bff0e74c85c6 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 1394b19bdb01..95fcf34a01ab 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 2fa8e1dd5500..6524f1e405ef 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 4283f53e7dea..eac0709d91ee 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 84732b39dacd..6e00a6fc7d62 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 80af5ec9a8db..3cee11c8d0e0 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 019d83e37ab4..c2f48e113192 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 d8e83bc56d6e..59fd6339b34e 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 7d37c8dcb67b..2b03656372c1 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 cf1a59d2669e..2c706885c52f 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 ae3e358fbe8c..254af5e59656 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 87964bf52560..bf1259afc4a9 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 ba018d66dfd9..119ea1be6c04 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 853a21053688..933af6bc6d6d 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 9100976f570c..c5c74319fb0f 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 63e32c488670..2e17d443f69c 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 1d699b58133a..c0baf34cf9a6 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 140798f03a2d..3d24d4832079 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 d51c3a34e349..02547f2eee7d 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 5d56b3c37e96..df81eb4ac1a5 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 0378d078ec4f..23ff7e9f4422 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 e185b7f4186f..2c99a1b1d6ae 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 8e8c195325fc..4673f3337235 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 f862a6a420c6..300af91efc82 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 401baa93a85a..54ca454dbed6 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 39b035aada97..f8265d2b7780 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 d4856c9023d7..74dc3d4b6e5f 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 3bfd361f5286..90a9d8e8df78 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 5826aac519d7..b09cb52efb83 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 4ee921df359a..db65b77d4d43 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 ac8f210f8ba9..411c0c758dce 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 981050ec6112..65c91019ea3a 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 b6476d620353..86c07bcfa5b0 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 a663fd513d11..bbffebd77d3d 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 72680f1b3a62..d10c09f162fa 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 8302a22fd1c0..dd3e6ac4aac3 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 ac69f354fda6..87fa5a3be34f 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 bc8661b66b11..60073329efc7 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 57681450d57c..fed40d5b6a9e 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 5455a5287944..bc477ba5e0c9 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 a5ebc224c99b..a968e0267d23 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 d1f169eb7647..ab2ca9601162 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 62e2b403628d..d4df45baefea 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 cd60a3c49fe9..95070d9dab76 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 40242124c0c4..a627dce5e719 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 fa8998be649b..3211da07b691 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 f9ebe108990d..8f86ccd96e9f 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 b9fa1b56ec84..2d66299daa51 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 86ec306e13d1..397423695084 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 5589443444b8..ca80235e39d2 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 b9f339743802..6bd7cb71dd2e 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 712caaafe1a1..7514d1429f5f 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 c91daf2f66d8..4ca2311d88fe 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 b0dd4fe9c6d0..4c65f3b1133e 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 31af7aa06caf..4ceffd86de0f 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 5dd39402a92b..f71d506d0042 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 782989ece4c8..47915b8c2b34 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 faacd4929881..9495944b51fb 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 65b268ccfc9d..309f477ad78d 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 f3a6cff403e7..024e4088a094 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 3ea62bea3f9f..234aaa541640 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 ea40f2c7ccb5..676cf6fc0841 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 6b99a2c67e6f..4f612f17058e 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 737dba8a6e49..487ebb8d252f 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 1bc303096308..a3d47c9c212e 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 ab48cf7c9e15..374e200bf622 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 651a5c2d4e1e..b0a940cae667 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 dcd4ea525f57..d4676622f8a1 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 b8e2a44c5342..d535de366526 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 305d2691fc1a..76746368ca82 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 0c66d3d9d4cd..9b7fc3e24f8a 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 42b7e94f5611..d714cbf30a45 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 50381b6fe9c7..de6fccf7752c 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 9b82de2a1460..981f70fabb94 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 0fbb2f9cf430..e19c02232bb8 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 b05ad1e2e5c7..e86ffdd1b9c6 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 c252371102a6..3190f75a5f5f 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 ef265edfeaee..9ce643512b7f 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 00ffd8259668..ed60c0b1ec2c 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 478423b1ad3f..0ee4c5a36b04 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 fcaa1ad31779..9bf15e6a3a03 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 8a4bd53524fb..edecd60c9349 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 d4cca9c08ac4..2d6cbfab112a 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 7a8ca4a874a3..ccd3aa3f3e7c 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 8eb2f5bd2f58..8650fd6a5dc4 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 b186e4ed4d20..b203be1a09be 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 2bd265802fa5..e6f1a12cab4a 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 4cf5cc60dfe5..ce6d2c2cf9dc 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 4a7592078963..8710090194f9 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 fe2ecee74089..9ff0fad861c4 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 a1006607988a..fdc9d9a42d0f 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 c052ee5949a2..4dc864ad64da 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 41cd92a65266..5162de5b21c8 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 8863ca591f3c..619d1cf63a87 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 4dccee7ed98a..305175032f08 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 0b980b14e0e4..1b2c1116b090 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 d81c5e5c9559..4aefcee20c22 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 9a7364a78aaf..2b17ce385b89 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 f32fb5ab8d41..2e31b3da9007 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 11e3e3f5c2de..49f4e9d40f1f 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 a85e52a0611b..ebd88cbcd668 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 d52f3bfa4c5a..a524c0e5932f 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 1d76139cb920..1806c83539e0 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 df2977284680..6c28b86b54e9 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 7b3e26462d3e..ee51fe8a0298 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 7a5ceef8c8df..5fce016d67af 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 59be505f04fd..6f72333a547c 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 b54c65ada22c..6db491d5acf7 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 33bb1b2a0ac0..c0f3390f5c0c 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 d7a927cede6a..58d5bb9a8ba4 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 96cf9360b24c..9466f0d309b4 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 60c6b34a6676..9bf1d8cfb2b3 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 c7da2eed48b1..a640ee0536bc 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 2154870b9e4b..cf8edbb06db9 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 57250abd107f..292d5f06f2a6 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 475447096899..ce79c1d30a3a 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 60d196d4787d..38adf7077246 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 14f737f82bca..9f560c227fa0 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 39761f3e94b0..cba05164a592 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 bd6597aab1ca..4e22aa2182c6 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 9f5973150fa8..ecbb4f3fafe7 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 7c18539ce443..f761e901a6c0 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 6d5be9476898..572ab04a242e 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 b53938a9d755..e598fc11e12a 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 8e8029853734..b6aadc9694af 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 62466668edcb..e1a64571a1b8 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 593610a3989c..3432decb8b3f 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 fe88d43c2a5c..7e2ba23e766c 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 c7d49e9dc570..23d5c7769942 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 ea337678ef18..db98ac55e253 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 55a821f84297..4f0552859713 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 223612d50266..bc538e58960f 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 ba67fbfd01cc..4c2b384fa3fe 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 27064ddfcabe..4dd0a32eff23 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 43133cf25b45..e81ab2766a2e 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 f88209a1ad30..d9d68b9d017d 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 348cddf040b9..4cfa553fc2b8 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 1a388a201ffe..9225b9f7ca8a 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 6163701c2356..925f80444dfa 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 a2d079fcb4a9..c3abc460e573 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 1709e7f7bee0..29c7dc50af2f 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 990ec4b16356..9a0765520359 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 1836eebfe418..9c2a505e9a5c 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 95c3a50ee46f..d8d3880a8779 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 0edcc63a308b..3a98d3e00373 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 c1d861aac73f..6f95d14f2ee5 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 8f828764a31d..7bc14d3a6410 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 2165bb6ae23a..13b1c5aa3aea 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 26fa0672023b..b92de7b87d97 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 af971d4820b2..76262d60711a 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 1d8b8c08364c..f7d82279e8eb 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 9ea44c8e0cc6..afff23398ccc 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 51ab81d96503..99fd55d344ef 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 d0824afb0cb9..48f8c8c02137 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 aad9532c5763..fb33ef71f83d 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 baffe722f9d3..a126e05e6ca6 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 367d87eb14c7..3ecd5ce6796b 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 2c839b2044a8..5a84a2b4e0bf 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 cc0833f45ca0..4d24a6690e9b 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 12a024fb2c03..a880531bce85 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 609d51885478..ba8837d8ed26 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 a036ba998f5a..d54c1eadf69e 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 4b91f320f950..42696d4924d6 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 9978c5342ef3..9ed93409bc00 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 5d2ed2d91388..91dec1a23074 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 af4105738ef8..2fbc3ece3140 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 617cc13b6615..4978bcf4e51b 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 0688a297c669..bd3bd49916b3 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 7281fb745a17..fabbead51492 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 25d711669b8b..c90afe1734e6 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 4e9b217cb08f..9b2b86cb1b28 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 379e9db894c0..2b8e4f22be33 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 c87719ade97e..6cfde9edb3b5 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 e82ab6ace61a..6e3728ace39b 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 3726afdc10d4..d5ba308d5906 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 402fcffc9e54..af38f05f89fa 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 6052cbe571f5..8169a2831084 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 781e807d0c94..a5b7bb95f356 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 fcf4254c7a65..5c0123d27a42 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 0dff1ff533a1..af22fdb927d0 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 51d63380296a..146edec02ca3 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 58fa4ffd7fb9..6e2bf85797f6 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 e758dffee7fa..c220984197b1 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 d5fe95dd82c4..475564c6683c 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 c725f1875b33..dfaa426cebd5 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 2a794ddc885e..ddf1b38b6ab3 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 73e7c59a8b68..54c485732104 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 c129c3fce1d1..d30f2d17c2b5 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 df40feaba7b7..29d1067d3fb1 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 e901e11e9473..1a676c59c021 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 635346ad81de..0e0111a35a2f 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 760cb15ffdeb..154ac5251e77 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 bd58e38aa176..115652eea1e5 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 60d3496c8663..5521e0e9a34f 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 f42607bf0849..ae24a82b749c 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 1679566d43da..70e5c2df0d16 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 47aff076cf80..5a206c9a3cd4 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 3731ec6d7b75..cca401d0d14b 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 dbffe6547ab5..8e8d8419af7a 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 1b3ed15f002e..5a18ea14d881 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 6b7ae83c0ad2..c5a150d343ad 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 c681755fb108..402704e9deb8 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 b8b375182e2c..db4f4a90fe06 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 3a5f60bdddea..e552560189df 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 18c0889f74b8..70812a59cc6a 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 646a2349df2e..0189e907f5ea 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 a7c444dfbcdc..6b624a3ee404 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 2d80f047d283..06d87dffa42f 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 09b757b7e04c..07eb105001dd 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 0d2a9ed4dc15..4af86db4bc03 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 081fe15730f0..cfcf370f5c8a 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 c59ac797ad5e..c14b141b098f 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 299c0dabdaa1..bdb28643723e 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 50b6eca3fddd..f2543aba9796 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 68f6ccb7cefc..dba83d09de2a 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 1c442ac1c6b8..b10e8612e212 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 db0bdfa5417b..38f67c246355 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 728dfb405136..9618fdfb2c40 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 34fe89ec4c5a..2eb965567548 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 42655f4b978c..c87a88a757b7 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 49e0835c1bfc..8515329a04e1 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 85866aeddd23..16f6411a562b 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 fd0a014544e3..86c9ce21554e 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 0cd40feef9eb..fffbe0878a53 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 b1465d1f5423..fbed9f8857d5 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 c2375ef25d9f..0d0d28d7f1bf 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 053896a5a9a4..e57a1ec0b95f 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 bf47299eba50..fc986dc29395 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 623d4ad5b470..1499ee54d392 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 7c5da8e4fa4b..c0512f40932c 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 87af851a91ba..3130f6cb9f76 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 219d24cef1ba..ac7f792906dd 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 0ebadb028b05..b992a269a4db 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 cd6133289da8..735b339ca7cf 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 217356d377c3..23a12f79ff19 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 f2e1c3bfd494..4da91987fb78 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 dda35332152b..dfe12266a2cd 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 daf39840598a..ff2f7de3f1be 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 1714f8b7d8a3..e1a0121f3088 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 ad7fb88fb62e..d83d3d34f4c7 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 c70a86da7178..fcc33f37429c 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 e82aed2b8ad8..a50a075e2955 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 7fef6fe7c809..28f11eec4638 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 3f69bd915879..0d1ed1d7d8d0 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 52de80ad5ef1..7a875c41bef5 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 1c6e09f83bb3..b16741cd695c 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 6a08a2afa851..9bfbdf26ff64 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 f581d7e8cca7..4a82688197fb 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 68286e968b5c..56fad205b1d8 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 b02eeda56940..6906bdb578c5 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 09ca9d8754be..95055f68cba7 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 6d0d7ab1d050..357a7e282e79 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 9b5c4b8b1857..7e613e65e9f4 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 b38e5d2c1b6e..d62ccc489695 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 cc9bdf3e164e..c604d5892ae5 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 5d9acaecea9b..df2a6a81e4b1 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 a1414d86bbf6..56ed13d09fb8 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 d10dfda13c98..3659ff0539f2 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 86383c01feb1..0f3359c66524 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 aeaacfb4d40d..00e4c4cd68bc 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 ee3b4cb3552b..7cde5ed76296 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 31975621dcf1..875ae6923bec 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 49d20172fcc8..e976347b716a 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 ba254dda4d93..f3676a82d6ff 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 3283c962d68c..e9089f70a568 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 6c41f74ec2ea..be737302aead 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 72ac1d371e76..a9591c9cb84e 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 2a28996931e1..0d849579ce18 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 9e25d9da5dab..3b7cf678f8d6 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 cb43f63dc39a..d95563f2b97f 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 8555ebc47671..1f426037330d 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 b5f573a72f13..7c4008d329ad 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 7ff3c49080ef..5d77657d82d1 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 cc297fab6b9f..290e89d5fcda 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 4e41014ff676..fa7e54bcd46f 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 dc5c92e48a9b..3182e3f3578a 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 1bbb6a10ec2c..8b0aa3cdb23c 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 400d7abe654d..f220a5016ad3 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 8734398fed74..1ab8abb19099 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 c3b382f1948d..c0242adce5bf 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 9f69841ee631..f09a6f2813ce 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 94fce7f2c8dc..399cf3cbb633 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 12f2a4f35608..8b3ca71abc97 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 db0bfd7b2d15..600dd2bbb964 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 7f7235704637..5dcad3446852 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 074d84652acc..58ec7c24759d 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 6f19d31ea58f..d702eecd622a 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 c6e70262550d..4333b93e5890 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 7da63dd7a987..6521ee477c9a 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 f906a9f99eba..dfeea9b4cd37 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 339a9b1d9aef..19654730cb8b 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 9ad60d6cf403..f01eb7211de7 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 ed7ac1e2953c..322f8bc8c738 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 7a06864215ea..4b207d606d1a 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 04f287aef702..c7c70afe77b1 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 0619ba17f596..168f8d9cc006 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 cb95fa84a121..d59a3ac4ccd3 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 99ed085c7128..718eae62c7e3 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 d6ca5e1061cd..53d9b742e142 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 1f6fd124cdac..fc4874aa2fc1 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 f76dab287f78..83ea4a2e0e02 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 5432ec7cac57..a4b4f875f126 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 e60231ec6c36..b2f75a4c1c78 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 643d6046807d..447c3d253302 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 beaa3b4c55c9..e09222b115c1 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 3eccd63cbd63..611110b17d2f 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 074d84652acc..58ec7c24759d 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 ba347ead99ce..69b1fc0dba64 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 8f40c2b9e5c3..8f63cdd60d01 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 13a6a64d0306..d33e35056af2 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 6ae12c62e3e2..72ab3ece3629 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 fd7a891d8c4d..ed7c52c2993e 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 a51e793b44a2..d13b2732673e 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 114403aa5ed5..d3c143b18e69 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 cd821a586b61..245d1b011abf 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 9250f449ee17..c513497671ef 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 cdd0d45ecea5..91ad2d7f7a3e 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 fb2194b635f5..1d6b874fa0e3 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 d5fe344096cb..61be53c7f1b1 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 c075ce9f9170..d8574a83a95b 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 f21c6941d4bc..5a3a57f142ee 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 c81975172df7..69bfad8eae51 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 1b04fa1a9e0d..9458f1abaebd 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 b741ed8e8cc8..e4fe6bae92ef 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 dcc857d36a87..501eec0d1df1 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 83bb02767b09..8e667f20e78c 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 4d782bacf314..d3c16c2f9e79 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 c26d3df644c3..8f81c662bb53 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 4f02fd1fd088..bfffdb8bfb6a 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 22e50c8fddb6..858f2811a828 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 58770afcb58a..78253742ef87 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 4b9e1e2f8f37..ce4e71a130fa 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 389812ee6da3..8b63047c199c 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 b51f000a64d4..3ba59fcb3ece 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 0255b7eed528..b10331a51b00 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 b6a8fbeae786..cb18be592388 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 cdc69cac50d0..18020adbe1ec 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 9340538d885e..d8a1fcb10627 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 42877b9e2901..653a4a71e636 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 666b9568c377..09f7482c16e7 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 2a9c973e47f5..ccd72eb65d02 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 9d7617c35873..b1d90d76c4fc 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 7262e926c7cc..421458d255eb 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 39d4d490b593..7618cbb48f03 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 8af62b1cae62..3c3cbd026ac7 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 cfbfd26932f8..2f511ea7f4e6 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 28ed79418715..88aa9ec11b21 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 52f9f4e1dcfe..1689c32a0d00 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 a8d8b98ed57d..7afc284a4718 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 a6431fd6f6c4..502e479af681 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 55d9497f893c..67706de2fd52 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 8f3f16accc2b..24822f85f3c9 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 7e4ade49890c..bbaa0eac1877 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 28e7320743b9..34836ef130fd 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 25b0fd97418a..bbc9bf9f48c8 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 6e52c6fd4d1f..0057ceda7c2f 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 c8c90942d52b..055a0e3f115c 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 2c1db06fce86..801c6010cd33 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 12c4be422437..7a55897d48e9 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 30cae98f649b..3e36b1ca7765 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 4591fadf23df..6f8d6a652542 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 f2cd05d58507..e36df8cbfd12 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 4d1f5f67a529..a391944e5ad3 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 d589597abfc8..0c902bf05c85 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 6e021038f2b9..628f749c47c5 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 1082894c21d5..f2e281db8d75 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 ca699a63639c..3f78b0f9d2cc 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 2d86b5998e19..de3e5e33b03a 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 2a22f3aa8fd8..00ab717c3abf 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 20b6ee4b6a37..585d9f7a1a51 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 c646340e65e3..fc0de38bd916 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 a545b4a024b1..ced2dbfb6771 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 de221659f026..f339b4a15f10 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 0b39f18573dc..76ba81501be7 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 bffc0911fd54..23b3d59c7d01 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 e30fc7f279d1..e6390c43b05e 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 8bbaf7205594..de589f46ac33 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 39554296d4c3..0026ac0e9383 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 fa4df3c82ae5..b5a527721e66 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 6856b64eb17a..27e8f94561be 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 b70dd7de3919..096d8e327261 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 1a8500a416fb..8b8e3b1ff8ae 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 19d96b67a349..bd1a0267017c 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 7b6b61f8c0b8..3aed36c563e3 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 389fa52e3a16..10e73e0e5628 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 ff8ef778733e..3ae9600e1700 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 6639d749ab68..7fb0d2ac2cda 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 b029ca9f0ce9..f526c3252076 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 7ce61876e0a8..f6e29bf0fdb1 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 e88af5b40a30..427ec4363f69 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 30bb59f8c609..4f2ee50da949 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 ce92441a5734..b78292c7993d 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 69a580ede4f0..6b7cee11c5de 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 9e2b85b224d1..85fdc2e087da 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 7db0a927b58a..e4dbca6d9975 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 a2234a6938db..b26aaee3a5a3 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 b21c88bc4f9f..4d69a77ac29d 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 e051b9ac1378..edd07f81cc72 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 e8b351c39398..8c9639d859e4 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 1bec942c71ac..ff99d56fa462 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 3c16beba8cdf..fae1c616f040 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 18209649f3a6..6e589aab512a 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 129088f1e55b..1f57152ef87b 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 b92e9f00f48c..afc2aa68b0d7 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 38dba1c20014..7ad59c55b47a 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 2a15b906e992..94529c93e1bf 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 a8a1424ee419..e26adaef5ce4 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 ad17fc3ec47d..a5d721d8ece0 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 ac0ac6a92f89..e6116f716d19 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 e4526ece7675..e7a96f2b27d8 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 b0139b0da807..9af89ad88fab 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 e1dae05be965..7d44ac03c66e 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 6615c691c1a6..bd97db980359 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 61f2ea2b0990..660626e6a893 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 91b236468d0b..7e991ebad19c 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 99d39defc2d9..f1770f76ce26 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 a551957cda4b..4b14fc797d57 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 d9481780b188..fec2cae5e5ab 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 77a0a58b8e3b..0e6599694fe5 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 bce2a8a321cb..05b87b7f5374 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 192bbad20bb7..c164041f972a 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 99a1c0eac6e6..c0305a64da32 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 8bfc60ddbdbc..b71f64505f0f 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 1a7be0b48b55..510475c7e450 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 56e0b17f480e..d0582d584014 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 5fd8ad0e4fbd..33d3d6fe7f0c 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 e840aecbd18a..9083e2542f5c 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 3b0d6f0acc6b..c4c070e89afa 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 5c99d2fccba8..3ab4831dddea 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 b30c8ca4947c..2cadfcee1388 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 cb363b79da74..043af14c0bf0 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 2fb85f363b06..bdd1d891d655 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 56c71d7d2533..294544806c7b 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 2691c6433738..b01a64d1df48 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 5c66e79b6581..d034afbc9b42 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 21f903177a3d..35fd2a0adb9e 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 132794e78364..ef61ee97f3d1 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 c63422a6be79..e10dbf8aa28a 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 c31ea27b02dd..12dd6b193f53 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 6183a084c384..2b90608b4c2a 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 324b53bc26ec..7e82b95fea8c 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 f40df83751ba..f07a72ed5d2f 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 4d433d4b0bc1..a75e2062efad 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 393540b1fa01..2838eba94dbe 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 99d18df924f2..496683da2364 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 f6c0442d811a..ce4565e35ae4 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 2089ba375f3e..c51370c9d607 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 9c23ba0225c7..6287e339526c 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 597fa90b29cb..e6c4610e6d25 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 50562955365c..441aa474112e 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 56efca553c6a..f6a637bb56b6 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 dca847dd4673..c0d40ca4f455 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 7105d5ba25b9..edb18cfcdfc1 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 429d56963cb7..adaa351c6cd1 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 3cc1f0503cbf..2c00d1043906 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 5f917cbbc080..c80804bc9eae 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 26729dfbbe24..129b29306dce 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 11f837c1d2a8..715c8131b5b6 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 d6708279fdcb..78391ab5a0e9 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 7493b94dd090..57d50fd7b865 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 5f3d3227166b..528d37a079de 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 762d2fceec24..63432da84dcb 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 8f07a5227a24..ff53c76d8553 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 7867e7d8e758..befcd7055bc2 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 5432ec7cac57..a4b4f875f126 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 aa3160913c2d..59b59c8b5b9f 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 5768fef8a736..5f1b2eebf8fe 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 43dd8a794c51..dfcc899c1abc 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 e2487bab9782..4fd39cd12008 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 b1bef6eada66..c4992f473c62 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 fc0cb9d7f54a..0b5c81b4674d 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 0a1dd11478cd..b22103cb4461 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 eb5cabf9ced2..3626c5879af1 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 b3eb53b70e6b..3381a94ff2e4 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 f5c50075ec2b..1a3678ab7042 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 3f73e77b69e8..11e80fe9c0ee 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 0b7a650552d4..3d7b20d5c118 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 dee1edbd1520..0c972c1f69fd 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 1f1d637ff0b7..878b81ab502c 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 b264aa447eeb..f41c5e0fe4e6 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 ffa6e2942ae3..b99bac3df29d 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 2d128072e784..d98029d55094 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 34fa5d9a8d4f..db893c17265e 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 c9a8709666e7..c6a76429a103 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 3d543c665be5..1f579129c72b 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 701abef485a0..064e27566347 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 1ad9f719af7c..e7edf5e4bde1 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 281c41288873..fe9f611da097 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 39c5735ec936..316c54dd43e6 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 f6ca7cfa0d20..efe20a5c6b63 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 41946b0a2bcb..85fbbd7594c6 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 04024e014271..4466a94f87a5 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 2518cd543d0f..aacdba1de7c3 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 329e0670c59a..46e14510807e 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 39796387c784..da4bfb18b9e8 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 be635254c883..fcf89fb5daef 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 76cec56e0208..d15d303d4099 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 0d5a5b2fa589..22b6c9ddd0fe 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 9bd2028bf81f..790c225cc266 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 05504dd0734f..0e40e99acd88 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 acea8f1a29f9..ae0b862723ed 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 9179ea920b9e..0f8838870ace 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 25a3bfc7d1b8..91120752ac78 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 e4933140f380..139be62a2f65 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 4c44c118638d..fe6c0b495bb8 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 bed2c37da9e6..3f90482d93e4 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 8a46002d51c7..abbe3abb2682 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 15647855a395..eacde0dd2515 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 009f7252316f..630b3e12ebc1 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 40aa85102591..8fe4e28db025 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 b36b03f4095f..a09840875ef5 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 e04f346772e2..530e87408664 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 39f347e0431a..8c83452cddfb 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 daf37aab3af6..64027acd5b1b 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 14cc3bddeedc..3cddfe78deaf 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 d096f12b193c..74f0ff526dcb 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 0dedcfd42144..47180d5c7567 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 9e70bac9135b..6c5006b4fa10 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 6b852f78deea..aa56d0ec559b 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 8e0284f73c05..9107e6623d36 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 dd11a6812a7b..ff6a186270d8 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 a591bf90155e..4488d18649b4 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 d092e82a47c3..e3429dd5577b 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 a35595b31013..ebce9c22593d 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 9a9ef9274914..5f904177a72c 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 63ab7890b83a..e55b048ed3f0 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 09b6d303c4ac..53d79afbca84 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 2f80e2925775..95a5979a014e 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 5ecd8287f4c3..5e3c5f7d229a 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 3cd19d49408c..102243b3cb95 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 d3f66418df30..d02edb84bd14 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 66bdc45dc975..12c936bbd4ae 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 c7ff07e0d0df..507c8b34b2b7 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 2b3910bf3a5b..aa360d1055ed 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 503c5e4d17c2..cce89e8969d0 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 ac843e7faa2c..2c98f4193473 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 9ac309222fd1..66e271be1549 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 edf8712a70d2..2db0f44e8bc8 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 603b0c53b682..b0b26b4e1e72 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 d1d7e83639aa..b3e8de1e9b68 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 564ba035b454..4e4a9131154b 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 0948185b8e4e..e1a072d5ff43 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 0e89977f1977..38dbce72748a 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 6f4825b89b86..02c95be55bf7 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 26cbd0245288..65fe5c762cc1 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 527c53215960..ece9adc5b936 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 86220085cd71..c7ff73f0e76a 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 baa4133652f9..8f1e2836cd40 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 2af634126e98..ee97cc16205a 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 220e28950091..643986655140 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 0839fb9bb614..2f6c43363a73 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 626731276445..509af20126eb 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 1300d0c9314e..48429544d645 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 07f26c50d81d..c091e5986ab8 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 25391badd214..5c9dba006a29 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 6cbd42871d26..31948b66472d 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 d6eaecc7e5c0..11c9e8f7db62 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 a0b8467953bc..246d3d373cb5 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 fde34fb849ab..6e5fa8365696 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 f66dbbf22885..46409dca7a6b 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 9f50d0da240c..fe2978c702f4 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 2f8b72b91ff4..739eeadcdbfc 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 0d81d0ce2f2b..d6607373b77a 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 91a1706118a1..5fb7d58a8ea1 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 b28846ccce0f..af065bea07c6 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 db84eef97456..b631aff245b2 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 0c6d34007629..f4954b348fc1 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 3e9ebe6414f7..920b02e4e9b0 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 72403aff63d3..20dd04d14eb6 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 31a372d44df5..5a11d8ff2b9d 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 6400590cf5e5..a6503f5fad6f 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 a73a582cf290..653f62c77c35 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 c387800ff559..b164d4b5b60d 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 b01e3ccaf935..217d82a457d9 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 6947e6097892..50d17cbea2a0 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 f2e2798e4046..de4361349237 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 e17ba18882fb..3753b0798446 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 9f59d5d3c2a7..705c98e5d1fa 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 8ecf52133d5f..c5497bf4eb8d 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 537a8c44f703..3cdd7bc2cb5a 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 0d52f30d9af9..81a9ea975a85 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 b93dd4b235de..22f3e7a04fb6 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 9232427dda06..fcb6aa51b077 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 15435af4c4fb..64874e4b02fe 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 6c643fbdd8ab..5039bd06d927 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 1f9545412a7a..dc31af9de392 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 548b5c32d5a7..393e2fd7451f 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 9dff15f15eda..344f3d26b695 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 3c50e58ebc19..fc353364c2d1 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 b3c6c779d389..83b934aec188 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 890c6f2248d6..b0b4f5871fa7 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 110a8a000bfa..2b437f12048b 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 867fc3fc002c..c289ddae854b 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 412ba4db54fc..6ee561c3d41d 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 d4e339d66f8b..fb37cb7dd911 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 ccd2a5557c69..50691134a049 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 3fcb48aa328a..79fce2dd496e 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 395230285f43..a496fcfd3a10 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 40442d2489fb..8e6358875358 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 074c0c8bb638..db5aabc02b2b 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 f58cfb077883..07e673f84ee2 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 a6f087d5e25f..90a7b471fe11 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 205e7e5731fe..636d44f1cad8 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 98570e79f91b..a7c128bbeb82 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 aed9954aa3f8..e6e9eaa784ec 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 ab8810f09c9b..5929da115ce5 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 183a587ddc76..97e46379c3fa 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 db86a852e1e6..396a6c89cbf9 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 691def9334d3..656b96520ed0 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 41c281d3dc18..3c2375875863 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 aa4301697cf8..94ce8601abd3 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 d5cdac1d3659..352ffb6fc1d5 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 3104ab9ccf37..91afc6eae077 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 d26abaf0e394..e14cc06b048c 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 db77094d7822..02b469112a4e 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 1d7e31b52684..518d4ff517eb 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 77acd2e88e34..68368affc159 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 a0915a8bde84..058bf6f3e4a8 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 4a6668b95a21..2c224fe25348 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 ad99f992e1de..834ffa769d2b 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 c6c506d5446a..902977b89965 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 2c6c0d75a8da..695e91aedd01 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 7f0a025696fd..26b3458197ef 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 aefb638ad9fc..cbd2d18d221d 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 275ac41e936b..89092f952956 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 71f1b8bd187e..227aa8271943 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 d1a07b1d64a3..b68ff2e27c8f 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 b1b3dddbea30..fa8fbdd9633f 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 477b83093b51..744b22efd01e 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 532e5a2d6a4e..0c7546766c3d 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 69d467e3c9ee..d9f6fda13c07 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 fc292877c8a6..b2aee3e01fc8 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 b15acf390f65..9e31dda05942 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 189fe30109a1..a603fe1d0708 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 fca15c38d67e..5642bc19a157 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 49e718ed823e..fdba048fd702 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 2f49a3a77d71..4c9cd14a8d0b 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 09552b591b3f..cd41333b8b6a 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 57442d5cb4fd..2bcffbf3a427 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 4242da8e09f7..cc0e0ad645c9 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 00b0c28f58c6..22f0d1704663 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 0fc500c1c07f..04b0ddfa026a 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 91b847669991..cae989f54020 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 cfdc0f3edd87..2864855b5018 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 f4cd58a8536b..5ad2528dac93 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 4541489a9620..0e6ad4f2d22c 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 a8823231e514..d9f6ce38a04e 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 800161b9495f..fb9d0dae8a88 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 48dd0332f9cd..88ca34bec2dc 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 b454e3f7a1cf..ddaa8680e60d 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 09cb074e0ef3..ef60dd713e4e 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 3ea9eda80fdc..044fb5c7b408 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 a507e6b1af27..e4ab30e9fc55 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 f1dbff4cc84b..0f3b7a515f6a 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 05e544a731df..3254ae4d7acc 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 28ed0df0c339..e10f67b1df35 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 34fec649661b..dfab13123cb4 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 5456b40fe86d..54a0b8dc4637 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 1daa964b52b1..3dcc69133bee 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 c59ac797ad5e..c14b141b098f 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 728dfb405136..9618fdfb2c40 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 c2375ef25d9f..0d0d28d7f1bf 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 dda35332152b..dfe12266a2cd 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 1c6e09f83bb3..b16741cd695c 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 b38e5d2c1b6e..d62ccc489695 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 aeaacfb4d40d..00e4c4cd68bc 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 3283c962d68c..e9089f70a568 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 e60231ec6c36..b2f75a4c1c78 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 8f40c2b9e5c3..8f63cdd60d01 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 13a6a64d0306..d33e35056af2 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 6ae12c62e3e2..72ab3ece3629 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 fd7a891d8c4d..ed7c52c2993e 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 a51e793b44a2..d13b2732673e 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 114403aa5ed5..d3c143b18e69 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 cd821a586b61..245d1b011abf 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 9250f449ee17..c513497671ef 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 cdd0d45ecea5..91ad2d7f7a3e 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 fb2194b635f5..1d6b874fa0e3 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 c075ce9f9170..d8574a83a95b 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 089ace58b0a9..796d5e9f1fad 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 04622ffb5ea7..9e8e266f2db4 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 6a745736a149..3e49f877b65d 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 9e8858777646..2bdcc96c2d26 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 d391e09c2dfe..55af5740543d 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 a0f4f6168da6..cb2922c87ca7 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 7061f23c0fb3..eae114c7aece 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 81e10cda57c0..f61835740a29 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 c252371102a6..3190f75a5f5f 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 4cf5cc60dfe5..ce6d2c2cf9dc 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 9a7364a78aaf..2b17ce385b89 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 33bb1b2a0ac0..c0f3390f5c0c 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 39761f3e94b0..cba05164a592 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 ea337678ef18..db98ac55e253 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 e0a1cd35bf2d..60e9af204817 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 e9f7e48176cd..6b4cbe003a11 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 affcbae43094..7620949ebb40 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 c9662fc16e5d..a0317edfc83c 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 f8723468bd20..2bfde2ea57c6 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 d1b7ccb7f88a..4af9a181287b 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 05b83780ebe7..0d6a432ca731 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 ad258e950568..c8e915a8b062 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 cfe130ffbfb4..333db551c2a3 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 883a08030f79..174b9e59a078 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 29a9d118b412..d45546f7fa53 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 9e63dfdcd658..5f649b7d17a3 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 7f90fed606ce..986bcdfa2b8a 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 0d381454d56f..32100b8de396 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 99de476125cb..ac3916d37081 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 44b77f49f1fe..5914e8c3631a 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 ef8d19db2271..3accea13037a 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 b873f53f35af..7f4c674fde17 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 3d629ecba383..2f5ad3c90740 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 2f04a27ec7ad..450831a85d47 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 d9e0aedd6a8f..14b2ac281ff5 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 6467ddd1af26..88d0ad2a09fa 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 6eda12df85fd..3e4845f7a6a7 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 6d0f936901f7..583264386a4c 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 954a44205fff..1ac9ff2484a5 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 3a18f87634b4..7ce7952ccb88 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 14f737f82bca..9f560c227fa0 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 bd6597aab1ca..4e22aa2182c6 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 9f5973150fa8..ecbb4f3fafe7 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 957dd5070e58..dba74d3f06f1 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 6032e42c2b32..3ad3009e10af 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 512019e9c748..c22df6a3de5f 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 b80f1cb77fb1..6a8e67cf93fe 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 cbf81a2877ca..287266bfe577 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 18babe6d835b..952d1864c5c5 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 78326d2bf3d7..0d18228ad581 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 b71ec1a70153..41ad542d8b26 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 0282d2b2a59c..7c1957004b43 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 4f63aa8f3c12..9ad5276de4e3 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 cbc63e56e19f..a57907e16d7b 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 60b6c5f4b454..bc2ea2163609 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 02c910998853..7f8cd55c22f0 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 99ed085c7128..718eae62c7e3 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 ebdcfd3b6cb7..cbc61f434e31 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 a6431fd6f6c4..502e479af681 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 5a4e8daa8bf5..5cc2cc85e6f1 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 52f9f4e1dcfe..1689c32a0d00 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 66eb1ea4c6d8..3409ea6ea2fe 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 7f633802f8ba..bc86254ee3ae 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 5161d7a26eb2..7957d21d96f6 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 3793b0720164..cb666228836c 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 2ab38b87e88f..c45fef74fd3c 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 7d6db627a47f..c6a98d9941cc 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 fef0983ec607..c99efd2f174c 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 16bafeb6e9d4..471a4c152d20 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 6e865059d6ee..fd31ae512c88 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 6a4e6615ad3c..eb3aad57255d 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 4f1af1fb8a82..003667938889 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 17164deb23bc..c119a1a11bea 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 7ff223f9b3d0..987044663f0a 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 d6ca5e1061cd..53d9b742e142 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 ab9dd47bd5f1..c9ca89ea27d0 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 0b8670ce2ef3..410a834f42a2 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 2a876f042ed1..25f7c6ea3082 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 192d9b03ac11..87c7c4544885 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 4faa60a28feb..52c7e7e5ec88 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 3616570c157d..1fba409df4b9 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 51d2d56a1f4d..e5ffeb5b049a 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 23fac0d03dc9..252bc32b2ef5 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 cb95fa84a121..d59a3ac4ccd3 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 ae44c6412927..bb61a86de494 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 0b3a95c25658..8d53b1d88989 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 c05eb9cca9a4..197b3818fcc6 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 4f401a2e09be..ff6db0c80887 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 8d59901e297f..c38f51d39c96 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 8bdd5bd10e81..663ab85c8f54 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 6e16548c21de..62a4545231d5 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 9d64e35ce8b8..a8974a6dfd01 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 c8b1fbfd9650..b338da14dbc9 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 11ce457a83b5..ea41120a3ed3 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 9addc13c958b..6ddebf209368 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 e7720b34974c..a98d3e9a56df 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 bdb80af26d26..e48c18d4d102 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 5c95e7b34186..9c90d03acc48 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 da544e66fa93..176eeaabd335 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 91ec774a75a0..c525c475d0c6 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 0436a729d413..222f1fe29391 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 0b14ec63ddcb..8dba9139bc31 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 8a6d8362f00a..b8d0ba2285b6 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 5b70bb51c5f9..eeb0e8d87a9d 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 3ef0daf02c91..90facc9d5c61 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 9d5919d1e5c8..4171fb619cd3 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 97e545959738..27892c16d301 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 866b55c382f0..c0bd452fc4e4 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 2da9d7230aeb..775e150a30b9 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 9ae0c2e522aa..11f4540942c4 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 977b214148fa..8e4f99d303d8 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 d1fc512f80f3..901a4601f9f5 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 b26adc4fcb5f..ced9d493b228 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 d05afab8aa66..f678eced09de 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 280504bbdf50..23c182d5329e 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 6bcafdb4a8ca..79238865f3ea 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 86d54a693de7..1660aced2c08 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 68f1fb8a062d..8c6994bb9ea6 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 e92dc30494a2..332fba83c5bf 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 6bdccdd72d7a..e011a9c04864 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 edb32771b7e7..dbf7415fa197 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 f724a3b10eb8..ac11e2a59f35 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 facd3e367daf..07fb3606dbfa 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 9570a48b5063..a680603d0e7f 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 9570a48b5063..a680603d0e7f 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 811527d5f48a..25f930eef347 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 26a11aeee6dc..4d508df917b6 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 111d8eb97b43..c59f2314f4c6 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 a6d558c93efe..3b41003b9891 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 514e8e0f0abe..8b141a65c33b 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 17c60d705ef3..9b4532561e0c 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 34b916d50e52..61e8ddec8d74 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 126731813b78..386c605c079f 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 17798e62e169..6377988b056f 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 76431bad3d25..be14db709b1f 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 0b5cfe9866a9..1205ffb67954 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 2388da9114eb..7463d2925bf9 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 76c4522a69ee..9c3c2c6b1ac4 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 13a5ef7f4abd..05f4b187ee88 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 0458b69aea73..9985ba0bfaed 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 347b3be44413..b14f5cdb95e0 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 5a75f863c506..22597cae7cae 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 30cae98f649b..3e36b1ca7765 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 329db7b04655..95736fdee6c1 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 7051af9018ad..cf9dd503a4c4 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 bad31cd6088a..6bcc40f19ba1 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 b149b8db92f9..b5f711497e31 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 3a62a458d615..a54a3104a79a 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 ec9898e4ef40..388349480ddf 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 cc54edc053cb..88915ea0223a 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 9c4d87ac49a4..3d082bcf7a65 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 d589597abfc8..0c902bf05c85 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 fe814362c2c8..a6a8254f883c 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 f2fe5561bb8d..8ed4dab050de 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 3a3a8f1230c5..4602d099aa90 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 0d2a9ed4dc15..4af86db4bc03 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 02f31aba69e6..6cab0ec83dc8 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 e02e90a31d33..d5f6e644d765 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 506e791dd0c4..3acee47b0cbe 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 6f4a4a11e94c..72fa8218caaf 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 0fc069591e3f..d3a7ed6fe7ee 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 0cfa3ce2b577..1f12694d2cda 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 ca5e20d82343..136a010baa85 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 4bcbca3b0d36..61fc62e13aca 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 f21c6941d4bc..5a3a57f142ee 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 c81975172df7..69bfad8eae51 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 1b04fa1a9e0d..9458f1abaebd 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 b741ed8e8cc8..e4fe6bae92ef 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 dcc857d36a87..501eec0d1df1 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 8316c5f97f85..ff24f919512d 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 5e3da9129e41..036a85e2ef45 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 f0884a922d47..cea3f4803586 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 7b8c0af8927c..f8a8b6f0e06f 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 a9e0e52b80af..6c50c95aa2f0 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 1a77efa6deef..9ee4dd7e6aab 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 f462e8df71fa..a8ceef6250f8 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 d628d7fbf939..2c7e4152b429 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 76754ed85da4..efdf56efcc27 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 2c2439583c55..c161a16c9d31 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 20867c4f1d25..5c58609e4bce 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 78db3aba0b3e..94da8534c5e2 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 6dc20f542bfa..bc0b2f3ecc47 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 cd0e7970cac6..7c3e91646b63 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 b9973f045030..786fd46e74fd 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 43f28e81ab32..f74df79bf831 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 28fc9127cd03..2dd25f658726 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 5bfefd1a3925..c667c59f9a30 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 23f3d43707e1..1b1324a6d487 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 4d782bacf314..d3c16c2f9e79 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 243668c0d0ad..05304c5be13a 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 528fb144b23c..c558c55697da 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 eff1ea1fd4be..1bca4ed97b3a 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 4a0563260817..44eb28b6aa3f 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 d154c58b0009..50c06e1b755b 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 ab870af50ec0..cf0391f09f1c 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 995c478e846a..3c7f97dae6bf 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 ee694093e22f..8a00d0c2d9ba 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 b1465d1f5423..fbed9f8857d5 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 ba347ead99ce..69b1fc0dba64 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 d5fe344096cb..61be53c7f1b1 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 83bb02767b09..8e667f20e78c 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 b6a8fbeae786..cb18be592388 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 28ed79418715..88aa9ec11b21 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 c8c90942d52b..055a0e3f115c 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 6d5be9476898..572ab04a242e 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 292e5947e006..efed9fb6b3fe 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 2a7cf3384295..b47cdbe229fc 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 2b0e6f95c3e3..0e1543e81b8b 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 7f2e414d39be..03a2baa18703 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 d184a8264914..7be40e58091b 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 dd7f63dd5914..843b7d41c97e 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 616ce67a709e..954d701bc5c7 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 da2f1ba24cf7..5db111120b8d 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 57dc83daf32a..ebd1a9ff4a57 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 5a8f135f2345..4d96ec0b3bec 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 caa4e829ed56..89a6fa716122 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 abac9752fcac..e2e970159f55 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 31dcf569b5ee..5461886da3e0 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 dd71fe58b840..6482545deec4 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 3e043c1b39b5..6cde1b39d6a9 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 94b7917cd389..581568e109df 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 539008280033..7f6068365fea 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 8489fd988638..948a5de3742c 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 cae838de0a89..1c2d10dbfcf9 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 4e9b217cb08f..9b2b86cb1b28 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 27c7864d3380..dd0d55ac7e1d 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 3f3cd6596907..6218e2b71584 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 3987e50bf77c..06a0ed65acbb 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 5aa224c4dff5..c88712741943 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 646a2349df2e..0189e907f5ea 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 a036ba998f5a..d54c1eadf69e 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 48aa72ea2dc0..812808de9f35 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 9ea44c8e0cc6..afff23398ccc 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 1709e7f7bee0..29c7dc50af2f 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 6cf40d966283..5e53dbc37a3d 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 3f3b3439082c..7f865efa666d 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 4331e2b8c367..f32f1372bdda 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 93f29667086b..4081ebee04bb 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 dfdc04d3c48b..2ef911f25615 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 6bf7ee0d6108..5656f98e9947 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 638788f4405b..02857ebe4be5 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 30846cf74293..bbdafe45b1f9 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 273c4fcdf066..03ac7846dcdc 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 0eca9154c92a..4824a8b5211c 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 dbee42bd9873..4ace3553e7e6 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 74eaaceb9832..2f778cc2fe3b 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 ec55ac771815..81b4ea1bb52c 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 e07b84fedd4d..7f30d1206584 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 91b76a6f9351..5746a0c95c79 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 0b1e59c7ab58..aabcbd49fd0c 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 b1b8b4f0880d..6e1c91ec0ff4 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 40d206249a26..84e6c9206347 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 770c2246fabb..0dd81b4d0dad 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 4a0cd5664566..a662f4e01bbc 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 b6b507c9e6cb..c6814edc8a57 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 3c5b82bd6c7b..bf2fe8474748 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 06d787bb4992..c1253768e7a1 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 2b7952b2afe7..dda9f41982b5 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 f936dc48abf9..0d2aafc8542d 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 7f270919a446..5f2d921752e9 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 d65f41baceea..f9eae4038a76 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 0d4e30957667..6ea37fe80964 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 71c86eec827d..9a8eac94acf9 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 d246bfc86e6e..2aaef66deac6 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 0561e522bd7b..5554975e11c5 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 d999f3d55fed..6f8f572cb399 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 cd0cda43dee4..65930bc7e3db 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 0b9ab0f10aa8..b4b946f8533b 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 69a580ede4f0..6b7cee11c5de 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 9761a349a4a3..b08def12d45f 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 eb617eadfb7d..0709ed0ce7d6 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 46407c45500c..b352004bc7ea 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 bcf17d861f11..9bdfc1389496 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 1fad434f6ac5..231f24f3574c 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 49d3c999d40a..a298e396b5d2 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 572970e4d664..9c5fe29a0869 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 61394aecd8fa..4a5bbb8bddc6 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 70fedd18278c..efa054fe93fa 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 878904bed999..a58725e51e0d 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 5ad3fb767682..b372faa4e2fd 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 c26b779c0207..a560dd2c5e32 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 fb8baff364ea..f7986e071a95 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 90c754ee67d1..03908ae672a3 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 0a82a0249975..2ed9e26310d9 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 4179e6acc511..b20ac0b62208 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 33f0ac110101..714d9d2b8685 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 7819b0e506d9..f51023215026 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 2e898291cf6d..9edf66fdf058 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 d73ff4d58e66..9d9e642fdf7e 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 eeee1072cace..504479fdc219 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 289ebcbb1b09..2a587715caa4 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 39b07b258e08..72490114fdcf 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 643588f06514..f0e05e25a50b 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 2fca4d2661af..d5baf7a875eb 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 6e60912b666e..88ed22b68da5 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 ed44a5fcd01f..d66d1be6b30b 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 7d36e1025f48..674b069a64b2 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 aa219449eb62..8004ac04b6b3 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 c2adfba4b5b5..7d87c8fc6e14 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 13cc3bbdfcd9..5226c2ebfb78 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 6663391c9d77..48c90f6fdb0e 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 a5a52c1e2db0..53a8bda384b8 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 e1363b4f98c6..09238f85c9f7 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 9ced89e22512..45ca46801c09 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 4c6da633f927..4305f9c34d31 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 2ae61364283d..ed4728f171eb 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 62a87b6a4927..c3f3df7e5f5b 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 987e2eb78524..2ccf078c9d9f 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 077c01c70177..2ba631424d4b 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 9fc98d2128b3..5d0d19837127 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 6cefd83e3214..320ab232013c 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 c12350d6a4bf..9c04a76a8e7b 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 f97a88dd993a..b35bbd4d76be 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 f12219cdff51..cf0974cabc31 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 d29652f48f6c..61416582674e 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 0782650869ea..f2ef76b6efc1 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 a036d7feee03..d1cc74acf793 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 3f0401d051f8..793dc10c6cdc 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 ab60eb5ab717..b9a75b550b6f 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 beb961a6f029..156e6398fd75 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 c2de2c5ec37c..0ece3ff33ff3 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 8ef39b3fcd2e..ea8daaf85fb0 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 c75389bc6cc9..776f47eea15c 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 0d49dfa5a763..29d1920ab76c 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 12c80600d855..94fc52925207 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 7a4cb9d5bdbb..12de61e60e78 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 d95f951f8eee..68a6d08d7290 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 4449ac1fc386..cdaf1460cf29 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 11b4c83b84f4..5d60fa9a4fc9 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 33ebd32af2c5..cfb1d7d325fa 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 c6716f6d5b6c..e4ad518b4942 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 d7d6a0eb4c0b..c9172b4c0ee0 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 55536bf01e31..928ebf4c4cc3 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 b0249f734e45..b2def55e6015 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 42134f8776e6..f135242de7eb 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 64aa2ad30132..ad23fc9dbb1d 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 8a205f26f6e5..299c2101fd33 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 76106e9d4fe9..8450ad8b9769 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 19599c7b1c08..fb85cecd3e35 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 9e8b8d3fa8fc..3565086f710d 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 c7661fa85d28..9d88d7ba1cc3 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 fcccd1684f80..ba82d25b8771 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 a73cf0cf3f64..967c39273de2 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 8a2005065f87..71da5f24f236 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 79e6ab49f074..37f18c8f1c3b 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 fc67569d5be6..52f97b491566 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 9256d55782d5..6bd9c8a48889 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 78cba5d9924b..73ed52c6a7f5 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 e4d9c2138739..3701d003855f 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 1be43c5d3ea3..f9d37f650fdf 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 7fdf6f8aa3eb..509a2fa878b7 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 4e3733ed6b77..910c4ace54af 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 d439d193a709..b84db6eff743 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 d248e9f318c9..6911226652fb 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 02385c5aac11..5b219a39af43 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 832564eca470..d0e31b332f44 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 7bd85bcc02e7..31c748c495c7 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 8890dbc0a524..b700e71957e6 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 74dfc01529a3..2a305b55c4bb 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 9a7b0d5681d2..6b3dccf75cd9 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 aed252faf17d..2a3507d72d53 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 0177eead6074..3a2644e84250 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 2e5825aecfbb..6dfef381edf5 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 38dadd707806..0bbb304c6e3d 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 f8bf7daf5bd2..b86053f12aa9 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 82d3e1035a29..d55ddd1b61ea 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 a446cdb8fba9..90f241ea29b9 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 cb1cbf606f18..6ebb1a398b70 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 fbb61eb44b1f..35c3eaa5e2ba 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 4d221db72d8c..5ccfa4a76dee 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 f3ec5d8857d3..5fa10d856cd3 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 a0d7dd658252..5fe9e49343b7 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 3d93d997f972..e7068fd5cac3 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 bc3d887ec081..645ac82f5566 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 8e2550dfe5dd..96d56d51f44b 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 88fce0c71325..834a12a4ebaf 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 c40e59d22d69..e7664cfc936c 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 9739e7a6f375..d9b4c0dd9e6a 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 d6c2f9a3e0dc..f90dba3c9ca5 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 edeb7a67b95e..8a3977855df0 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 65b21159bd92..7d67196d62ad 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 603d0ca75c7e..798e7f2d3c09 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 0c86ed9cfa68..2470e7fd781b 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 acdf9d06a913..87c3e0871fce 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 16a8b4d99781..1798f7e29651 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 1ae88c0512af..6237a6d3dda1 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 f9aca6bfaa5e..31b78a3ccbd9 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 9446cbbae1c5..86fa33c5b8af 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 138fcb2e6263..07143b67c9a1 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 ef826212c27b..ffa484a7df17 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 d2f456d828ab..021db7e307b2 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 b0025ea3388c..207c5b961330 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 0c39b167df03..4bc8d58ff2be 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 c2fec5bfcf25..48a925190076 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 4a76c9ff3935..a51e468a580c 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 5aa9eb08425a..30fa8120728d 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 d6c768be8953..36dc80226613 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 ff1dbdcfacbe..dc4a4b78264b 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 d48fa35f8a00..53c0a13b7022 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 ea30bc6a3013..ba8f74f4e0f4 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 3b0df6852fce..a1b891f67787 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 20849b383b65..db9c867205f3 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 b21e99bf2e8a..5ad0d7459559 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 a10e4151e34b..aaeac684c1f4 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 a5255d5fce90..ac4cc54d118e 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 bcb0e150eda3..8f33cfd60630 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 85fdb9eb27f1..34d1f995b463 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 570feb3f99a8..782f9c962a58 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 5dab1af37b3e..2cbe6c5f228f 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 2c80770e1150..fdd2f3fa3c36 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 4d36c6d5cebb..10e5ffff0ec4 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 4d36c6d5cebb..10e5ffff0ec4 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 ffa4e3f03d34..615599921350 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 ca378cfb321e..e713c6daf609 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 e88d6a6431f2..273d62967486 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 da0f5a5a077e..b8debd493dbd 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 3aeb059890fd..d269de6f532d 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 508faca10fbb..9bfb038fdbe3 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 32add9ef9dc3..3e157b067a91 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 25cd08d3e7e6..b173873622d5 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 3c9b2c223f85..ef45bffe3959 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 877e589c1492..1d2b07a4bd55 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 cb6c2286193c..696c4989aabe 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 22fa47db887b..3e85623558cf 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 f48f7a786775..922adbe94650 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 a6d0d7facf75..d66077168e42 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 118076195367..b5a042c5d444 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 edf979f658a8..b0e0b89e8fd3 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 06f89a41d6c9..4668f70d8d2e 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 8c5d9482f12d..594b9d2a64fa 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 4ec3778aaff6..73308081041b 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 7c5bfd0d7d4b..60a5a8fea2af 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 c79985fcb2bb..1eea2fed3a3c 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 bc5ceb3e0e4b..c4e58bd99b7d 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 abec94d30ee3..2e5490d094d9 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 311090fd6ab9..a9e8ee6e33e1 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 1dc2cf3956e3..031ffabf4659 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 b94b022ea7c0..565162df3ccf 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 20d499776ad9..84dbe6b65f03 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 decc68148f95..06adbec3fdb4 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 13ba3c4eb97c..85beda94d481 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 d9fbb2b999e5..4e09c13fd6ed 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 2b81d94ea76b..fb5e0996bf7b 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 166849449336..2bc5cf54b227 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 69ff486c62d9..8bbf441a1bd2 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 f3046102c20f..7ba45ecc53a6 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 5f31b1a576f3..6ff8b0773cc8 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 9656f26c45a8..43e794894ee1 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 5a8ab1f21115..e51d6f3e5110 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 e3470fcb4ec5..4dfa59a362d9 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 04f8c8c1df7b..f7c0c7ae2f1c 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 88a3f339c132..7ceb0644f6ce 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 d73cfa2bd010..1a8fc198f200 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 69ff486c62d9..8bbf441a1bd2 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 e95ac9779c07..b34917f7e658 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 ace60cd560f2..b3d6b552a8ff 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 475c1afc13f2..dd1feb7b3371 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 245feff142cc..e7d5402c9273 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 87c6c0164063..934336937dcf 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 3a19ed468dc6..923dff08f3d6 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 dbb1747c7888..024dcc1726ee 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 2918b16e85cb..5ee065601ed2 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 367eac531099..e5cdd1426df6 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 81194dadc77a..b8f82071b213 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 ea4245152521..834b20a1ebcd 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 9392a4586df7..67a3af336f2c 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 96fd3b7e93cb..0bd7432907df 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 b3ef7da7cabf..dea4eee607a9 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 e055a31d0008..17909837b80f 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 2ba79ca36077..ac45a4338b73 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 ea3146a858b9..4e52a2f94326 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 c02bf897d3a7..620c3d2cc9b8 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 a15882b52dae..6854d518cf5c 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 d672770fbcdf..c1d2713e76da 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 3322d7a98a38..daf210e071a3 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 a26b8b4009e1..c04c402e277f 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 96e1bccd5184..cb6827eebf81 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 2fa4b803dd1d..185c7ceda3e8 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 21dd434a7ad0..c7e5a73217d8 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 1a0a1b954720..3ae13a3f41fd 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 8caddf6f2a1e..26fa046a1204 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 52ea78d41c51..568a99de6347 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 bf57bae53f88..e2a33949bad1 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 e68e602741d1..f0cd92951df9 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 157cf63a8362..aa4cb1e9c31e 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 9000ad963094..2e6287a36247 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 7754e9f31d1b..31e2398fac1a 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 d6a2610514cb..2a1ff4f91407 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 93bb4ad6958e..a912cee46623 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 1dc5a28897fa..bf72c40e96cf 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 2b50d0f0aea2..5b57ca24624e 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 8ecd159198d0..a5feee6475c2 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 5fcc5ff585f6..ae075f3bcd74 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 925deed2a00b..e7131fb94932 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 1cf6441fffc6..066e56384368 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 3d18314470cd..4bb0f76377fd 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 bf57e074ccea..ab48d0f9efad 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 e05c37f12629..230f98af8a2e 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 da4b728c5eea..85ab5afc448b 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 7e1b9c51b14f..b6ecda2e0a59 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 0fb742510be3..75141bc2be24 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 ad8dec06b08e..8276ce96fcd7 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 bb04fff52615..bd09306d3cbe 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 6dc11018bc6b..e636283e423e 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 03f750d1dffe..726d741dfc72 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 620fca404822..2b55f4dc54ce 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 2179523b38b9..e9b595563644 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 82b23bcc25bd..334ceaff24f8 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 88d60f45c549..d2960c20fba4 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 15827d111508..00218c0e04b4 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 e9f55cbe3989..f83d741ef5f7 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 fd8b54221703..f8707b901884 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 00936f4b0f7e..cee848a92aed 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 533a669dfc98..38ba1fbd5d15 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 b017ac4d4b08..37e26f32fe28 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 4a0bf74a8a4f..eb5d31ccb83e 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 add0b1fc84de..96c7f5c02425 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 db311ef3bbf3..b42af7e2ffa1 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 30ad8a2a0533..88942a742b03 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 91bb0ab97d98..f306e9f02374 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 422caf2f1ecf..c25ed8c8341b 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 a00ba8fc772c..a9e327e586d0 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 4158fada8f7f..93cf7ff8ffba 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 b36764ece66c..0964301530d5 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 b24d044db414..9d296488f002 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 eb3f631398dc..667e2055d9f2 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 284fac8c4357..b2d2e40318a4 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 6b6e666b00ca..1591ec979e44 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 b52b27d1ef37..42c6c5a67aff 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 ffcb3680fd0b..9a1a7ea60803 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 12a024fb2c03..a880531bce85 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 5d2ed2d91388..91dec1a23074 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 4b91f320f950..42696d4924d6 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 9978c5342ef3..9ed93409bc00 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 0688a297c669..bd3bd49916b3 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 7281fb745a17..fabbead51492 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 25d711669b8b..c90afe1734e6 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 379e9db894c0..2b8e4f22be33 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 c87719ade97e..6cfde9edb3b5 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 e82ab6ace61a..6e3728ace39b 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 3726afdc10d4..d5ba308d5906 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 402fcffc9e54..af38f05f89fa 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 af4105738ef8..2fbc3ece3140 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 617cc13b6615..4978bcf4e51b 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 fbb1d3b5d554..5dd7b5d3fcd6 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 fae32b78cde4..d9a89994f01f 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 37312f42ce97..32180fcde928 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 3fa5e0bfd57d..f676471df15f 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 be5c03381dd1..8bc86d6bda14 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 68d637a98170..d42d61f8a543 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 c4e889cefe20..1e07f7e127f8 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 76ef6d90fe84..471a965aa78c 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 430d18e24eac..c783115307d9 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 99a3e74a04af..d4d2cf5dfe67 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 8770df4abba7..edc325840380 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 ec3792255a15..46112c6c8828 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 9d206b4f8475..53070d6b82ec 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 252665de0e5e..b43e07489eca 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 2c27554ffa56..ff97ec8233c7 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 ce2cb3d23d67..89b9c579fa1c 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 57d55fec0b5d..b0387fd4ff59 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 9a7a240c5b4a..e86e86ca2246 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 85107220dae5..de49f7815bd2 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 6cbd0876600e..609aed8d6228 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 ac910291b748..71a10a5324e9 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 56547ff7be13..62e99551071a 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 ece139488ea0..ba27c1c609ba 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 b0ad15758245..d704a0cb48a6 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 3731ec6d7b75..cca401d0d14b 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 dbffe6547ab5..8e8d8419af7a 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 1b3ed15f002e..5a18ea14d881 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 6b7ae83c0ad2..c5a150d343ad 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 c681755fb108..402704e9deb8 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 78da40f6d8c7..4cfc4cd77e70 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 3a5f60bdddea..e552560189df 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 18c0889f74b8..70812a59cc6a 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 a7c444dfbcdc..6b624a3ee404 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 2d80f047d283..06d87dffa42f 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 49e0835c1bfc..8515329a04e1 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 85866aeddd23..16f6411a562b 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 d3a105c584dd..8ce94b960543 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 c32c5b089115..6d89822f1568 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 3844a4d151a7..d3af5238b363 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 9d008175f644..a68f97021f5d 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 3d2ee0555b85..a0bb1f5c08a4 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 237da8c03a78..8515bc8f1fb0 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 c273b86361e0..65a76ea528d1 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 c90c4eefdc6f..322359217c2d 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 8644ccf99c0e..4e21f3ee7b93 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 d44909ca998a..6c34e22a0044 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 38cc0c05b021..cc7b3b44d69e 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 380e6ec698ef..3af7d55ae127 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 d528d79e32d4..b79101954c7c 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 91544094b698..88eefa8ba7ab 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 e43da2374537..5875cb58be47 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 d3a105c584dd..8ce94b960543 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 c32c5b089115..6d89822f1568 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 b83145faf5ab..37451db0ed1b 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 a7c8d4f9a0ca..ae9cb401dddc 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 2f1c8737b22e..39c5663443fe 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 7337acd3e8fd..3939133b3b8a 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 18bc9b977ca7..d65c7f7da91a 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 59ae007d6fba..336add4fe32c 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 d26e37b08031..ac86039c659b 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 3025d6bfbf72..815a430cb2b7 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 f22f0efb0609..392c525509d1 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 1567b18881d6..62cf67d34e04 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 7598b7431e9f..fcd0ab9858ca 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 7101109189a2..d557326e9973 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 dd5fca85f2e5..3040718fd546 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 3b89f63424e2..429d686ed48c 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 2973f3517639..79c71ebb542f 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 e328a1e98ef9..ec34fa9d5ce8 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 95091e65367d..2ad942222305 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 8473055a411c..c85c53c215da 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 c9974932443e..8635017ed5c5 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 cf31420c53a0..0090b6011203 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 59618c91e2ca..439436ef7e82 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 0b6b047c7b58..b68c731a58a7 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 64f2c09fd91e..52dbdc3d5ca5 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 34c1b59c4e79..48c2df5468eb 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 35af060b7c6e..3c4ac7fd38dd 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 7419ba446dc9..e183294a232f 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 ede15490b692..c252adad5c36 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 aeccd1a07ed9..2c691b4f70f1 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 4e8af9c85d04..9e3046fe279b 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 49a2e0086f28..2502c52e184c 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 6d1387258a3e..887c41149531 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 d3b5c3628386..250afef7d81d 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 d0eb8e29b2a1..03985eff0b57 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 d6510094936e..29ce013f0b8b 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 98e096877880..60d4df26f9f4 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 f974d83f5a98..4ee83b14028e 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 2993cf648835..0c8905156ab1 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 4534376b270a..3ccaace1b183 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 cb41c2783446..dc142e76101d 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 d8df2c1c2d07..d887db53f5e6 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 a2fc6cb4db0e..ded181413784 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 f2a0068be6f2..7d00761d5560 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 4f1229be25b8..a7ce0eaeba38 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 343c7244d1d0..f4096149d8ed 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 6d3d9feff343..2c29a7df14b9 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 5eb3bcef0b18..8caf22da60fa 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 05630566bf8a..13226ad50009 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 abebf79057a8..43d10e291259 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 81ea6460e38d..d559db4b5683 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 2201ea3de8c6..a3eee1ca1117 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 be76deabc7a1..cffcb241d435 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 414e229fac38..3d7bd0ac8ee4 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 32efcd46a632..4c1f2d2844f0 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 e3d3f255c253..dcf994402ae1 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 2e801038c78d..c7306ecdb68b 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 4ed420518d6d..41fd57994528 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 55dc17f91beb..52018c7cba22 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 3b946aeb3223..d714b3e28e2e 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 ab669586dc27..160544579047 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 be76a2099b54..b184d5881724 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 df217b6af2bc..5704449178a7 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 0de7c6ba2ac0..4f8e8d897e7d 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 c249f39209bf..07cfc9324623 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 f945eeb57491..3b77c9170b54 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 f2ff5d38de33..0581517d990a 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 2f734055a47a..aafa09421ccc 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 60ac3ce8c98c..df3094e728a8 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 766ec14c5a33..bcaf874206cd 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 0f2e3c5dce01..65f5a908f019 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 7945e482ca86..a1ab8b4653ea 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 304b4237e9e7..7caed97929d9 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 2b1e638019cc..df42b7ac7db9 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 45d9e76d63b8..27c0fb2e3a31 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 6c9cf3db90bb..5b2a545950f5 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 3c3b792e5b9b..cedce7bc2cc8 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 0c00e7e06841..5d43814f1619 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 d74849d8def9..ab3b4e1d0f4b 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 5fe83a67359d..937104c770ac 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 4337adcf6eb6..ed124fb20e3e 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 df10adea166e..fbd817014273 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 275b0d3ee35a..d1c541915d19 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 274656622ac9..70f1ba7669c1 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 d2f4d73a6ec4..016842ff5ea1 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 6d5be9476898..572ab04a242e 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 292e5947e006..efed9fb6b3fe 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 30ec6b3832e2..b36068b690ed 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 2a7cf3384295..b47cdbe229fc 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 2b0e6f95c3e3..0e1543e81b8b 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 6ec46b27f645..8a74440beec0 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 d6665939ce44..8e46e83105ec 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 598c96a56b18..c606339577fd 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 9eed13dbf1f6..61bba56429a6 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 9c65b7b8cb98..b2560defc565 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 f719006e5af9..bdda42876a8f 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 09cd88be36e1..12f3b1a77a2e 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 612f1abd2b91..856e2d676e20 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 320152a60638..9b2756dbb4d2 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 976ebcc7150e..797c741a6e74 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 b14a15b253be..320fd8e86994 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 618cec22e8a6..d69535cf3576 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 1ae8f40f9740..3036808c3c47 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 2340c94c691a..27feea5222a7 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 86fbfde778b7..a0ef6bdc2f5b 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 1c109c350cb6..1056212c976e 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 46cd57504eba..8bb741bae2e4 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 769e912a7e65..c6a529bc13c7 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 e418d699ca2c..03c94d829aa7 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 6f022e5637c6..f88db15c7fd9 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 c0f511826127..389c8a589fb8 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 c0f511826127..389c8a589fb8 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 078b39d33a01..7dcb2358b5cc 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 46b9ab0f4ad1..cfe4ca1e2622 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 d2e4bb70135c..3fb7587ba6e7 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 3a5f512ccc9e..37986cf13198 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 9bdda240be5c..2b5173ab82b6 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 abdcda955905..c0a36d1894b6 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 e2464ea28f4c..d29ec1396d4c 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 4263383a0bbf..a8b45fca99fb 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 ea8f8f1ee102..17cddefa31e3 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 58dc5fcc7b7d..8328102958a2 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 2dc7a4b042c4..0d0752b80600 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 0ae53e012bb0..7a8450a177f3 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 56f02c219f15..60e0d1e828c2 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 d51c3bce84c8..9e9585db2e7f 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 4f0b42bf91b2..14379aca37aa 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 cab2b6c2898a..855a078a1e41 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 ef81cf2ef043..2e3d9f6a4377 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 eca6e822f6e2..4b8a7f23f0ca 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 087317911d2f..dbc5316223f1 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 aa78dd8a115f..c66442c43c18 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 8cee92a6a4bd..333c5c39498b 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 02714a4af3c8..2fd8f619a838 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 ae77e9c9c0b4..d4c5c67c9404 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 8cae09284390..cd2ea8ed46f5 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 0623e2624bc9..35c53b58e73a 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 4ce81575447f..0dcc76e29bfb 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 d418bc0ac898..b132a32e5e5a 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 3cfd26fb69e7..65791b99b872 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 7a1b2313cead..2bf7aed2fcc6 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 f25bf92484d2..783531a21214 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 b89167e9aa9d..0a0bb5e03a01 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 acbeba45c5e9..9a1c53c8531f 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 5251cd078d22..758f4d4bd8dc 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 1fd4ea1925c7..607fea4fa994 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 34df72d1dd54..12be6ac78804 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 ea1e209f24bf..23e0a043e22b 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 c0cd7f551693..b6cb58fdb09b 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 dc6bc1917edf..129603ce64aa 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 2676e600764f..191390407c53 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 26eb0ec7e251..34304235c8c8 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 1295bdfcf9c2..e91e6f437f78 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 4d485ddd9600..16e82da75c18 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 0099a2d97eaf..2835e746897a 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 ef879544f9bf..5caef91e52b6 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 7124a7ba6fff..cb43070c2777 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 0f104da5ae82..bca060357b6c 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 8721f9d98403..d1a65bb67c2b 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 49094bb0e6bd..fb80b314fa31 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 b1589f69dcee..a079acf84911 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 7bb5acfbedbb..0453b860b1e1 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 91b008540089..bddc435c75dc 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 8c9fa87e494e..0763ff948104 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 c2d1aa9e8258..1fad75e9a989 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 2292f444ff6d..765527f7771e 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 338b1ef14f8b..26d684ab89aa 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 64faa9a0c09c..46dc4683a1c6 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 cb147f686b55..bdc2834bafdc 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 d6d6794fe5b6..1c191ef723d7 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 4b8305ce1e0f..8a4c16c4b1cf 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 de556d585469..4e092c03ea2f 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 b8b637790518..4f5b295c2b96 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 67715145c740..7675a5829970 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 eebbaebd1306..610eff55feff 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 8d314eae24de..61eec15d105f 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 acc15e6c1a33..7e8990aa69cf 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 83a633725788..82f61bd8b864 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 75a911187c46..81955a57f998 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 b886b1ed169a..18f57d0b02ee 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 80b8812fef99..c03eb506b44b 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 60cb5221f5e6..645a584e4521 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 8193286a8cf5..97494837e452 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 be4caee8d685..342f38a3d580 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 13118b1f2bcc..0cc8a7ebf294 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 5b60865a3e75..35d3ad7ebe51 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 3d767e959f32..d9c4cd6d8ac9 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 4b390246bd8b..247785e656d3 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 450588b8a035..e262d408ca0e 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 46cbb6ce3aa8..a10c4906a669 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 fccddbd97a80..40d890c79579 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 5647bff910ff..a67865ea951e 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 2f6b9a5c0422..852471d6a7c1 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 8efc7583c387..760fb02d63c7 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 7a0e9a0cbb8d..0fe89b60ba8a 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 65361fdc837c..5457c5086a37 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 48ff04ded091..813e43851e8d 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 e08c9b31db6d..a0c8c7bd1370 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 15456d810c09..b8cbd6ca0aff 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 f1d0b408d34f..110900de77f5 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 68e29ceab98f..d423f26aebbf 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 342fc174b592..b1975e9de194 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 e126bf7fb5fb..bda07d6588d0 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 03ba9622642d..8f10de0fce6b 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 70e119694395..4d6dc0a81a07 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 6946c14c5af3..524174017a14 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 b69a455a0f53..365b9b97a943 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 62a6d3a10f71..dbd141f36516 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 0d301cbb847c..860696f144c4 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 99af2b8a69a0..fc48d9672da0 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 45ed934caa5d..6bdc11432ece 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 d4e1a7d1e628..78af3bf7c711 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 3fa0178df710..4d7e2c8824b2 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 3e3d50633689..1267a637ac79 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 e7c6f5e6bb2e..326584989c7f 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 c63e32cca838..d1d6acb5f0d5 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 9fa1c2917097..995f7b083808 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 109fbb70bafe..ce4251ad8e71 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 5c6ec686f516..35d9b789e28e 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 65ec3150bbea..cb4da3ca4552 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 68c3ff18b28b..af9987434013 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 470062c22b80..42d1371ce7dd 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 d32285dc3ae0..122a0e829f30 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 8dbf70cdb04b..9c3051a38021 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 7fe8d83f31e1..9e05934745d3 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 35d6a2f29be3..792fec48d7ce 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 8e3500892679..91b3df114cef 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 1d94cf85460b..9ee1d22c1b87 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 fd8bc97f5bbd..17a3f7593137 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 b984451082ec..f7d4c6d3a12f 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 83b198523bad..f0e607109c92 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 08513a3011e8..9f600515531d 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 dceb3bd390a6..816bb3ac1410 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 7add5089ff95..6fe3015ccf76 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 06e380aea7f2..7c3c0b0a5e41 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 339ca0c0d546..ee2325e1bddb 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 184125273236..fe58593dfba5 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 128468f9659f..e029e983ee76 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 0724b9e565a2..cf003ba438c6 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 1a3e576e3b80..d0f7aa76dbc7 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 d1c2347cb125..b740b3d3bd61 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 0a638b426ae2..d4337b4f6ddf 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 7cf03fd42bb7..4e1bc28f2660 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 98d454b78c67..82cf9bd9f557 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 74c7d35d4fa3..baad4ea0cde9 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 379ee84d2d94..53103a600f1d 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 113e8bbbbeeb..752fd3b1a71c 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 c7fd9652e864..35b89e838974 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 67e2f41f4ca2..c826d1bd510f 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 ef06223a73fb..e337e3d268c3 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 e0271651aae5..1039c1e056e4 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 dd680abb9878..6e37550db85e 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 297ceb941b4b..98629c2614f1 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 cb14ff5bd58b..91b5799d0414 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 e34c853586a9..ebc7cc92dc53 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 c6b5cb7b3f5b..e8403e51a8ee 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 56572b56584e..254811183570 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 b8a0773cf4d6..0e28cc4938ff 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 dfaf6f688e1e..4abec1e40b1c 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 e019b3c9aaaa..967cd567b4a4 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 029d9cd6f8a3..3b74b77a4b3a 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 d788eda7fd02..b611d45935c7 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 b50939f38415..bbbd7d10bec0 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 ddea1a756790..0b33c76ec3b3 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 3b9334d91225..3d2ee186456a 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 b56cf90f93db..241a017c8eb0 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 c063c6722c93..ae3787b17496 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 06b5a7c528b0..0b825cb17d45 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 78b17369506f..6df9c23ccf95 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 146f1c39f34d..dff968e97984 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 7b8015061dc4..84dfd671cc3d 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 ebac6a0e3b90..51393c7016b5 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 cc5429e9fce3..43274b4f1ab2 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 1bd1092fae92..61bcf07c5a6b 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 3c7ad5de9321..f610c07abe36 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 1f5d18e55096..edd09ae38e67 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 1f4da38f9f9f..56f268a84707 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 34003e4e9209..8e3342fe9f68 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 fed43d6977b7..041c7fcf4f5e 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 d8c6109cf982..8a1f3e458127 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 73b7c2579453..0f46840ba8c7 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 7a5716ee676d..7c27ba1380b6 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 3422be4603b9..abaf592123d0 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 085141ac53e7..6aabfae0aadb 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 - } - }, + "type": "ReturnStatement", + "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 23703cf19b25..31ce19c94ef4 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 0d05ba3223fd..824195dc1993 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 26e00894a7a7..8010b9a5b411 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 bf5051685be7..e1645e9fd57e 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 f13ed5f0567c..72c04ef4fff9 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 88c45d101fa8..6cc1bce62569 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 7cd90e6e9021..17dd38b5c5b0 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 b368a372254e..80d1655ddfd8 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 1478f40e097d..a1c8be9580e2 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 deb781226e7f..226c11bd0fe2 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 107a090b5e92..c119e2e0c73c 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 f2522558f086..ffd15aa2c2b3 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 1b75f5865de8..0491fc9e8991 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 0031d27b4529..b065c96cb131 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 34bc34826eca..c58d4a6533da 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 40771337a35f..9dcd00dceb49 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 6a69ac76f332..b73acc4a8d3f 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 01efea8ee23f..80cff7767730 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 a44ee2efc222..166fd813daca 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 d3d00ee7bb86..1bce1392d067 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 909e3ddcd0a4..5f0cc9d12fbb 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 0678d1917926..9d09ab7b33e5 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 2a969d61e76e..67687aa331a8 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 975df8dd8199..2850861ad8fc 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 fb3005664209..2e1a73e9731d 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 74fd91c747c5..789ddb0c28e4 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 987d1eef5055..e93888eeb6f2 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 d411c6ff6e6f..7b6feb810065 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 b129c88406f6..c69a435a1046 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 75716a4009d7..6952e399c10a 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 8f99924c16ba..c50fc16839fe 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 d0896adfc448..004925a92410 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 73a9e36039c4..d1e510436a43 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 2f219a49939a..1977b5cbd495 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 a3f0718a28dd..66302d642b12 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 e1051a68e29b..4da6a4271827 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 81617ba6f123..d3973e7ce798 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 d70b2148db25..c69d5147cef1 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 5f87a8eafa27..19e3e441beb7 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 c50380d9a517..65327624c062 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 2ac3ce6a5954..083fa746f96b 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 ce1316960a9a..3213ec7e4c23 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 367972bf3190..251c4ce6bacc 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 930ce09662d1..77b3d90da307 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 c2bd0ff3a8bd..5e0b3cd9fc43 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 a7eeacec5938..30fd19b64705 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 69484e07993e..c7d7224e9129 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 eefec5ddd7c9..2987e25cf7e8 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 9c14f3d08b01..30f31ef3355d 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 1499a3ede531..893a938ea525 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 9ae808cfd662..fd172b86c4d5 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 084e74570676..d1b72ec9914b 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 733e482e120a..5ede51a7199f 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 8443e39b2b52..47d78bbffa84 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 0628ebff2be5..ab145b851060 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 07e0fd653a45..1268657c20ea 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 2757a35b0190..cc7ff9f301b5 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 fa5fdd6bf2ef..ba7832ad2767 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 cc4e05e15037..5ffd41290834 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 573d999a9e4e..73939907caaa 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 ecda9741a8ec..5d13b2af9ce7 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 bb0fc456e61c..eb62fec97a53 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 1da946b580da..aa7f5f5cb04f 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 73a9e36039c4..d1e510436a43 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 13de96b505a0..61665a28af00 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 1ad3eafe69c2..bb6ddaacfe24 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 03f0153ce87b..ed17f6e590c9 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 2f219a49939a..1977b5cbd495 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 8e9991ea817f..d2668cf74d85 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 da595a9e8f28..05facf06c5eb 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 5432f965ce09..153a2fef0aa5 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 a9cbc8c8e73b..3d9bf0eb29e2 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 45bae118fd6e..ae2ee71fdf41 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 d0b7148af2ee..db5d3138150c 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 0cc967280f5e..258470686ade 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 a63b4c84a28d..ba2ceee1469f 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 b768e4ab0fb4..6f7de702a10b 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 8ad3ed205109..e2c8e1bf29c8 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 3a8f32412f61..64a19f4a5472 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 8fb4c84a2e60..b20f69086b26 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 084e74570676..d1b72ec9914b 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 185dae7e4a7d..852e82ebfe3f 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 b50f70a27b37..5a29004a837e 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 a21a24a89a8e..3f5de76a0efd 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 d3d35687409e..ea877745593d 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 e6808c472edb..e3935122a552 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 fe56e0811a5a..37e56eeb13ba 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 e65a50b154b0..e0734ffc46f3 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 d044c9635205..5b25b65ff136 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 2463d38b5b9c..7887a5bb379a 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 2fa10284f62d..8a7c1ce3f3a4 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 d31b6fbf36ee..c89f5074f84a 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 740426fadfca..e83c25a738e2 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 8f1dc7f1fd64..deae7f725130 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 0f78ff94e38e..9aa076e2d6b8 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 6ee6b54a10f1..b3275b4cd48e 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 12271ff15479..3485397b4d62 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 d8961a920cbd..a0fdd5c38174 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 5bf2f923b846..64b15fcf30f1 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 12e01e17c23c..003b67cda8cb 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 9b2370d8c3ec..c03b9e7046c7 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 7610536beafc..5e1510e58fe0 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 762e468f42f9..f7c0f728ad82 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 762e468f42f9..f7c0f728ad82 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 ca7f05193422..f76347f82a4e 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 955795e96bc2..82f46579d4c6 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 ffa28bc26ba2..6e6d1bea815d 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 8bb7a04b57e5..4e10fae280db 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 bed1899ddc7e..f71e62cf63d4 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 c1dac7764035..a685b94be015 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 6839504edf6c..c32319f375dd 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 c7f4877e2059..7ee60b71ca15 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 1b343c302559..242847410a0f 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 2ab61fd7bb04..aedcced6b5b5 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 e799ede442c5..6fc9be0b380a 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 7eef10ad862b..fa1525dea3eb 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 5a3cc58cada8..8c94785d66b3 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 45e0aecd2129..83b95a090610 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 73400bf8fd10..fcf5f8cc4e08 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 6c6aa937ac70..fac7984d5639 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 a646828811ea..245a9416a843 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 0a1b0a11038e..3ce69cd5a8b1 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 34647c6e63c9..1694c85af975 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 e33208bf5970..e033ff3657a7 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 48e2d915883b..5aebc0f50b72 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 af714540b44f..e8db639c568a 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 151f29fb87dc..9d692b713f67 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 3ec08e9eab54..0b12f49112ee 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 b79700fd396f..2629abd0deed 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 c0bcbc71a47a..f6817e0b226a 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 00976d92c50f..1a2378d0b09f 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 1858a06292b1..fce3fc757812 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 a3ac3d5828d0..6900ec7205d8 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 0b18241bc1c5..987d9624eb59 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 c478966220d4..6fd12b2edcec 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 3c73b3979a52..004e40f97bb0 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 7b4538c88e9c..2fcbd10c8038 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 55f03701d9db..cd4cd6ffeb61 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 4c87cc2b22a7..a6ea0dbbc145 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 65bec6bcbd60..4e0a0023c3b5 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 740a870e3ad3..01995ddd7541 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 8b3ea170250c..58bb3e5decf4 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 a30df38017e0..54d3a1050e08 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 78257d308a98..ded88989d1ad 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 a3ea6fad2e5a..6eb72f741765 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 6461d8dba2bd..f97788382071 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 d27ae3b4fadf..bf350c9fd06a 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 ee4395d21f55..e06df9501114 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 29dc70b2487f..bb0df5540a94 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 f08afb905eac..4484f2592a62 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 2507a579d6de..5b86c977671a 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 89afd3efde35..0a7efd31a5f0 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 8cad1428818e..7e5e1b87de3d 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 9d86aac2191a..a904876ecc6b 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 477b3c1f3cf4..9b87ecd61c19 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 73b694a6656c..09eda4f99df0 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 3e602cf8e35b..1fa9b9b565c7 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 7b96b478be97..ab2be9d065cc 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 bd3c89e95560..2f01f1cdfce4 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 df4e4858faae..19996c619dbd 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 f9203546d16c..73d0352df20d 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 3138ed92346a..26e13a153248 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 5cd647c2bf7d..21d200a0d6d5 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 a43596db0e4e..c0679de758a8 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 c6b51546660e..67f7f4463321 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 4788bc887407..e641715002d1 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 e797620a329e..c9862c7c7459 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 509fa7be5376..59ef8dcfe7df 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 71b523cdc3f5..259a3f3a14a0 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 386c54cac8e1..f83fa6ea3e6d 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 99329263441c..7390d0e73cb8 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 031ce3f9fcf2..f3aadce6c706 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 cf60b4557bd1..482160a3f26d 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 0de8505e1170..ea8fc8c204fb 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 ab45a08cb897..9a263fd785be 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 22352b5f300f..4fa0a1810fd5 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 109e14677751..0d67691d81ba 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 39f6afe910ec..872895190ff4 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 422bdd6c6384..1743eab00fbd 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 4cf178b2082e..836a76bd99c4 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 3ac121a5eece..e9cfbc456cb3 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 4e344f6fd3bf..0e74e29feaae 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 d8a2a2deda67..269b48e7fb28 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 0b63b9681805..d9086f100064 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 6a9efc69296c..12858208a0d3 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 f68c59283508..2128458509f4 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 0c35b0296649..195c69a6e0d1 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 8076713df223..98b20b22a343 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 ad70ca6fc270..96e6972816cb 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 31bfeccc15a7..bae33528af8b 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 ca8eaf7c7c31..e08b97681236 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 689560a3bb3c..17b25f9fb301 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 b92b88fa4a19..37fb1b9d9006 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 9487edc545b8..0c576d51f4f7 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 1c39ba7a1d72..f26f8dd544e9 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 2890e46ca71d..c721e170501c 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 6de8c77bf903..32b05f9776a4 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 ae93a109760c..370cad5f22d0 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 fdede7a21ac0..7302b58872fe 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 ae808dbc99cf..104bab8bfb71 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 784d1a34983e..1696b7203671 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 678bccf4fa1e..4a170306f9d8 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 2c53bf532cbd..ef36209f39e2 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 f3956eac0884..b59406105388 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 fa8e18cac1a1..a240786ccdd3 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 d2ac83f6572e..327ca0646199 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 154d9a6f4641..a1f3a2f79773 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 6e462c0e07d4..5be8427a63dc 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 95a795d633b6..be530847849d 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 51953305e0c8..8946a1d3dfa7 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 d0b1538b39dc..47194a33cc24 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 a394466973f3..2fcf0f2e7170 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 36605277710f..7b94176ac8a8 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 347125ca2b1d..9ccb458bc25c 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 ac06aae7f847..270a3c6f1257 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 a70fc4a0fa0f..f11b9f23a562 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 b75b68e18c5f..b115442a128e 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 7ddf567a2967..8460ef9ed922 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 849bdb6de9a8..af0c11230973 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 112bef72c91a..b4baab71f704 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 e702d612d243..67b40a81583e 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 13d9caf030b8..d332a8378d0b 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 5f86cf161b9a..7e2e98b195ab 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 5ce3d7e5f1db..1e722211301b 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 3364a2a11b7b..b6fc5e3e25ec 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 77046a4ee17f..87cbb9e74aaf 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 fdc0933003a0..e13589825cfd 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 7f14d41f530d..99aaeee03660 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 f505cbb81666..6a5210632fdb 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 2648664f298c..3daf76e31921 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 a270c2420610..945775d56e14 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 650a98a4cbff..961a9442c741 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 037c60cbef6f..ac19c3b8fef1 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 1410809bebec..5ac02a810421 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 5ac0337bfe64..f85156325dbc 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 417003e07eaa..63db3421d887 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 9aa4e5c834d8..34de6f803594 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 859e6d5d5325..bd892f5bef65 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 5020300be097..4ed7d8e9c017 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 3f132f054796..2038ff8d78f1 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 173a126235b1..593809dbd35d 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 4f7277b6d914..67a557a8d3eb 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 1e5f3a747c34..8a9f3fe0cf90 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 ea1d5804721a..28cdddee6c6e 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 9723cfbd4fda..a46838420e3c 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 e802a59e0737..a4f7ce2d86b8 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 ffc792a8db4d..238b8d7eb92f 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 583643ac786d..aca4cb9eaa84 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 71984f0f6d53..0f6ee969f91e 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 92169c50ab72..ebeef35878ea 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 8775652f6e4e..90ccb24c1270 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 8427ff4fefb2..d354fd52d7e1 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 ab96b90e5fb1..fb6a3801249c 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 a3925ad6c8e8..a54bd3bbf50a 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 f47a3612a995..e0ca2b4b003e 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 b9271342b1f5..1d2d8a1aa2ae 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 9677b88e4b27..2571dfafd4f8 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 da24fe2bdd7d..1c28d1ead346 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 b3d5564b9494..8dbcd31afd33 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 e30a6e6b7370..f7497689fd8d 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 f07811a91f63..06face3b6e24 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 8ef9043d9f1a..9c8faafda734 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 3bfad936fc0d..2a1e30bb67b7 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 27f38c578949..417231fb2118 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 f5d9d8f4e7d6..6ff730338e66 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 1e6a1e5b7b87..216ca5341546 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 0562a2e1b529..ae851071991e 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 70fa1ecfe7b7..ca8a87f25dce 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 cb89d2e8671f..44c0e7ee2c34 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 8e6356f7c10e..4e04af8dc422 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 12a2e33585da..5e0c2d44d98b 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 62e3ad2e4f23..81326d22f8b2 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 5f3bb0f0c9f3..38a640ca3a6a 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 b9e808d49031..bf1fbf975e54 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 f060c82f7e0e..ae611586fb8d 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 c4a785b2ee85..a01b262a87a3 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 ac7ce3111be1..970d655f0a80 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 39bdbf743956..b6196e69a2d1 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 61338f165056..dd58d9538a40 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 59529de050d1..50b9590533ae 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 3b558a170e5d..fec2b9a60604 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 14f531a7e147..f92740eabc90 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 d12380e4820c..6b08f2e6eb24 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 0ed567f15eea..f97121b4372e 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 ef37548ee98f..1c9997501890 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 5f2e34747dfa..6ad681373f22 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 de8143714401..b2433fa8b012 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 d1e39e6ccea4..a2e7f8045864 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 4f7a815237e6..40519c9b3851 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 4f7a815237e6..40519c9b3851 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 fee1e93abafb..a21637e0a1f6 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 313e3fa4b8cc..24c9f9af57a1 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 cf3c546e748d..6bf47be1b325 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 06ac009ecf09..27d164f4e2fd 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 31cd9f27dc38..258054048024 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 49c1e410dc02..c3dac63fa751 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 fa743ed7e4ad..07d38e5e3864 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 fbf187592a3e..3660fb6254a4 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 797dec673387..7099351a2e6d 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 ca6d697c465c..c18b78dc08b4 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 fbf187592a3e..3660fb6254a4 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 4f7a815237e6..40519c9b3851 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 8e5b51735864..d4653c73e6a9 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 9a18738b065e..62cfba2b163e 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 620abadb05de..0c2f55089a1f 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 57c57f0f6376..1ce20aa52e6e 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 889bb7a69b62..a5c71deacef5 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 71953d9db9ce..0827c20fe911 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 0aef90100fb5..2468104c6898 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 0fbd40308b71..8ae28448c08d 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 b06186702668..21cf0ef9779b 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 9aceb13325af..d7262f7ab729 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 a4b95926f362..e8ce055d0d81 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 257c98280e2e..1c55597d1ea8 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 5644ff01406b..4e08420cc88a 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 f274dbc1ad48..9c89df8ebff9 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 b0b8ec5955df..f4a75092e3cf 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 89c673d0bc0c..c774d9cb44f7 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 feca14ebaf5b..556699d07afc 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 c1399c71afa2..6e09acd357ab 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 da79f8d294e8..4c0d88c5a719 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 63e37b46042d..18fa5a9166ad 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 95125a326a21..06a45df42fac 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 372a871e8b7b..e673a7df67c9 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 58ca8064b581..b413aeb837f3 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 6f197479125e..f907f6c39b60 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 b4bdcb7bcd7d..b5610cbd5590 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 f168982f9d91..cd596f541bf2 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 899a06650593..cde715cc8a70 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 a185b5983604..10719f0083a3 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 64fb49d7358b..499705448de1 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 df16ab34e48b..1aa91e74b179 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 0023723944ac..6c2b7a1acf34 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 20fef485fd61..2aeb5206b521 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 ae7bef130c84..c110c8d1783f 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 51d79d3318da..4259a597ed79 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 7b38baf9008c..a2fd989f47a3 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 195e3bb795f5..06531b72d5ae 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 3a206964c2bd..524d6e4d87ee 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 9337eb29bf60..248522740c6f 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 18b3068859d9..0321177a1072 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 15b7a61ce7ba..aebaee1b7d4e 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 2fb6945eeb76..a6331818eb10 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 4571a8f3b91e..e3b406e4daa4 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 25757328ebef..297a910a329c 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 d0c29a3cc724..d90e701dc4dd 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 be74d493c27c..57f62fe4a6b1 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 eb53ce59a775..2c33b45a64be 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 501bbac6fa08..a2a0ef2bc6b6 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 e2fb435ec82b..e966a43e47ea 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 7ab18f8fbcfc..6ea4db4a6f24 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 75c247866713..215e0119e445 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 a2feff08dcac..8493ab87355f 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 95c03c8c90e3..117b71e8c537 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 cf2f95415e23..74e0c37287ce 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 e3714c89c3b5..0e266f4100f6 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 3ee59b9da5c3..db2ecd011344 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 c5ba3fb13a9c..872350783544 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 ad59accc2de2..3df77e4676db 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 3d951c7dcb90..81102e182a6e 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 147e066345a3..cb533784bce8 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 147e066345a3..cb533784bce8 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 23ba6b6a9dd4..c6606b33e146 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 dc325327e4b3..33b1ddf85eee 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 db51a8cf702f..0efc35cc94e8 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 c5d7401728fb..6cba070ffeab 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 b6d0cedb6d6d..dad87f1a67b4 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 c2e61b7dcc74..805b977e0219 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 3ca94e61c69f..7d1057ebdf33 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 635e109f119a..66db1d9667cb 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 7f0b58140ccc..7f23399bd729 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 3b5099e2484e..3d6415843c43 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 dad1acd88252..52964dd67ca9 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 980991e0983e..de4e948b6fcd 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 9aa91ba18083..4ea96f95f600 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 1f6e730f77a4..9c2fa5d831dc 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 4d0a4a382399..0531e077259c 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 f644f6f77c2b..2b72eb9e943f 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 7012d6b344c0..602c59d44bda 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 80582542dc79..7a32c398fca3 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 c692f5634ed6..78208a0d1b53 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 57ba6b14baef..ce7c6247f6a8 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 1eb4c5477766..bf7992eebc45 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 e2929b56882d..e1d3be39b30f 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 d765da348a8a..38eff5e05456 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 e9ce95b15400..b1b043ee40db 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 6ef630c21629..8d68a188cc91 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 7d080201f87c..31f3f9f5a4fb 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 35d36a435d45..1117fb9bfb6f 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 234638108d6c..d4adad3aab6c 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 01ba58dde043..400efe6d5f4f 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 d6c9de764ff1..3f3ca0d3d5d7 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 d4989ed391d7..85bfc592f8d6 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 f070f46d18f9..50214d1502e3 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 75c143347674..2d99aea456ef 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 edbbef5c2939..423b95bfc9f1 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 a8fa63668570..747bd08fd19a 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 7dd1fb5e55c8..76dd4a67d87e 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 98c5fbe6f88a..6a5f61a44107 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 c7aa3ef7db9e..8d8096e542d1 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 c1153e8ef9ba..9faf5390f81e 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 678537429214..7a70c20099d4 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 3e96fd7f6e42..df86a70b2a65 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 072db71bd3f6..9f0a0bfc1dbf 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 fdbd4372b103..d6bc57308fbb 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 8d89468bd969..e86e6a2871ab 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 caff17537ea6..67a243bde984 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 c84eb9ef6cb8..cd424ff6725a 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 41f694cea61c..65da3199ea25 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 0467351a38d4..5926ac8938cd 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 a0b4ed887326..ad9dec9755d1 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 783cfac7f3a5..6b7c37b415d6 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 8f770a0b520f..4e0de67a89a8 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 e9c9ec66f592..26b92f4ebb3b 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 140d1ca3a59d..c25d7475fd52 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 1ba67b8a91ed..f63451acca9e 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 0acda94d446f..72ae1ab47d25 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 a486c2f93d61..57e112e27280 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 787369211af9..fbd1e2201de1 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 ac1b66efbad6..9bc05a72f32a 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 d996015a1b4e..c08c3328ed53 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 41ad167999f4..d6ac90f7e3a8 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 eefdc6fa0840..ca481d3e2a31 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 533b224afe85..8ddeec634a00 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 0ac527181bd9..b494d245ac31 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 f54fd54c6595..54766534dd05 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 341d69a0c9a5..28c0d4b1d063 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 0fee8b87f9a7..5f89215691ab 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 c18f0204be2d..985490008afa 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 bfc54baaba2f..ff4d68c93998 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 29e020e74f11..e84414a33e20 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 8cb12ab25ae5..83c7892aee32 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 e5813f87f899..d9117d3b92af 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 f2d5e3c3ddb4..44fe37d1f06a 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 f2d99c02f8f3..609dda3bbf1b 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 84ac3db2b3e5..e3b8e5b00191 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 ad1bda1a1fbc..0179dbeaeaff 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 5c60a91a9482..3c29809b70f4 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 76b845845cea..a1809a9c8d81 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 6dd7932c623a..8e236a6eadc1 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 46ca5191adb2..e7b147232828 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 b050c973d652..4a43408b0fbc 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 5876338e6e3c..44c794754aa4 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 ab51dae8c74a..455448a59aef 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 7e0fe1f7af88..8168708424a4 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 05034cfa43af..ce52b8a32780 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 4daf639555aa..35f991fe7e66 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 93487dccb244..7cb40307353a 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 d90c680f758c..eff90743fb54 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 11b9589834ce..1087c48d75b5 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 aef068ff0dcb..c5667acab8c3 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 83c602cde696..79f7bd562e1e 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 b775d5821aeb..4f81da2ce933 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 7bfe8f7bc378..723655879b5f 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 b148595b1c8c..e4a9490764ce 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 b0e6a55f8b9d..da8fed17fc46 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 0d3190ef7f95..7ae0eef00647 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 a7b5e0bd1bfd..c24fdfc69ccb 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 ac3a71555369..82c45a0863af 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 5163754673d0..653f4d11577a 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 2273b5e141cf..411c960f4bd9 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 fecd37e4b169..58f335c032b2 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 83150d31dec6..1bb35ed64a9f 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 f5d1e7ad2ec7..b713e29da119 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 1f51bd46894e..f46c259f1f2b 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 2654eccc8ca8..0bc304bb7f24 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 b3b301d701b4..d49ff0ece275 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 1d30df1fa402..e5802b234722 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 124c7c8c9d41..fd45665f95f1 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 e22b35045789..5778cecc9dc6 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 e25755bdf0c5..fde0d72e80dd 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 3dfeb7480fa4..ed08a002f952 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 8da7d9e51bdf..17bae3ae9977 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 07b00d61949a..66c1f8c3f742 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 b03d29b7821a..e0a9cd51c3a4 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 dab814bd833d..f6098844bbd8 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 28b0d47818c9..73f36b31b12f 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 0c1f9bcd5045..c20647b9ca75 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 6ce800288f9a..6d1d532d73cb 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 2e283e2f77c8..14f94a2dfd62 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 151b718a43f4..9dc1704ccb9d 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 0ca0c69ed03d..bf1a1f2cd623 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 eb1dc9edcf28..a091d166a9cd 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 a0df02ed0394..00c9046112e0 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 b757f165c1ee..1a31ef55aa0f 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 8ee240a36baf..0743ba782383 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 1450743b5caa..3ca7f733f342 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 24b6f69d7f38..dd14b4489249 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 26af843c60e5..46e5846787ca 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 cf4eef5577aa..d765a4698e87 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 ad94447a587d..85fc081b8e3c 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 c1f7f255feb4..2b9b23d37689 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 5782d9c9baef..05837f4a9777 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 2c3d41a7a407..aad86fddc422 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 4dccbdb5cd3d..1710ddd99dd0 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 ae5fba46a8cd..aee11de08c59 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 ea93f11c4126..0e1c9101ebcb 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 a37b45899de0..c705268ab87a 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 22154057933d..e7434d46f7a1 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 ce27b82a7d1e..5a00ed65e725 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 81d9e807fc24..4d6328f56dd1 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 67d2c1d0b2d0..e2385a402468 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 57d230a74e40..a435e5387f75 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 91c2e1441d4c..624332e91abe 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 ed02f24ca983..510edbfca9f4 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 21a73cbfdc9f..b639cf4ee02c 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 81e260bd12b2..9a2bfcf9f312 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 42be5c156ae8..4e5b3ec14483 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 b70dffe352c1..120d7e5ff2f7 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 02ef8ffabf64..b528894be6db 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 76e30779fc90..73871157f8a9 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 5805e3195560..65c37bcdecac 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 76a211cbb464..0ade27b47bbe 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 5805e3195560..65c37bcdecac 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 18617474f20a..b1327978a1ea 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 5ac37407684c..447e720d0d28 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 0832c75e1b67..85cdb8bc35c3 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 cf4693d78010..52faf1f98373 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 151fa64ab228..9c1064e402f4 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 9aba248217fb..0c47e0453e3a 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 6f706f4594db..0157ee146fc6 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 44a2796b640a..aa726dbfc5fd 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 c1a06bff1006..0aff824b08e1 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 08ee75175b9a..485ab02b5920 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 6bf303dba12b..1eff0862e73d 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 baa5c0d9edeb..2cd1eb6e0bee 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 6a9c52404e56..161049d5089b 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 85d58b0afdd4..7f3d3aa197c7 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 94cfa8948a17..537fb2972f3f 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 1fd25ad194c1..d2ca76ff8ba8 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 75b5e9b5753f..c8c0ae2b71bb 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 02531eeb8dfc..e4f2e048e2f6 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 ad16baa6080b..14bf5968d970 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 f2854db5d736..33e95403e790 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 6a10b7375123..67851e8ae8bf 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 ac37720b4657..c65fd54ac5d7 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 ffad33b3ba48..3208d4b4bd66 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 3b566aaa7fc0..eadc2d985387 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 fb3eb337bc92..64a149197c0c 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 ec0bc381be4e..00814ac01665 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 d5ffb4336861..73deb674b780 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 bbd6090ffe06..8dcd1b0be60d 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 733388df4240..5dc10956fa1f 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 7c4cd7881b85..0125e6307fa9 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 dbf419ea9cc0..c8e969c81806 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 1402c8ad8eb2..9441e11a5d82 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 16e7731de88f..c39333b8861f 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 6dd7211157e3..7e3230844ebd 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 794fdff46258..316359169e24 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 015d69cae1b4..f437182808fc 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 9047e8e46c66..59525a928deb 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 aea51b1a9d13..0aba1cc06f66 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 422a84f34ffe..3a3857adfcc0 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 06d26c8e36dd..fd6dd628c922 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 9f50cb461adc..9a4964e45f3c 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 949dfb412346..ea167df54f56 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 51a834b8819b..7d395e92050c 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 896ad6754174..f6fbb173576b 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 67579952d9a7..30a87379e97b 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 7f4c72ed5990..98aec3b80b45 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 a826331cb1d1..754d867e033d 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 3a8abb5ee6d3..f08c03454ce4 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 f1ad465d3356..844c33565789 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 94b3782bdfca..e2d9cc365e37 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 41dbc2be1068..225c82bca9dc 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 9b2e1c34ab13..7c3d10f344ce 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 edb622d15e0c..84334ba4a90d 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 718dab31950f..3f664920aa97 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 db839f06c23f..891892e2f708 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 a00beeae9dc5..7ec235864e56 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 ab488ef2168d..6d1a17645506 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 d8b704a35180..7b64fc114305 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 0b2866594160..0bbd5e95ce0e 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 14ff0e5a49ea..ae0f5d34baeb 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 8750916dc037..db8d95413d43 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 af984299b9bc..4e384e15aee0 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 722c81c068ca..206e08e2cbe0 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 0de5fd4795f5..8786c334ee5a 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 bcba26999c9f..6b674fc50fc6 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 03de79fdb335..596dd7518653 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 ea95861352c5..3e9472582d84 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 863648b54efa..d8ea7350b595 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 d9c35eafd56c..4df0de125108 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 183b79323c54..60aed8369054 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 87652a453f4e..70b00851f80f 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 78d487b01aad..f35d695d38ca 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 e11d3c6e16c5..3c3ef7f9c9b4 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 81db15781250..bef3b94e5487 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 5cbe8625f52c..9b452767270d 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 3d9ad56d93cd..e7dba971db17 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 d3b588235d88..145a6c321d8f 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 17b274597f95..6a86583fe75d 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 850b27d807b8..a899ee01d131 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 421fef65d7df..9c4db1791064 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 42033b969ac4..89c1664778b4 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 36a3d22a48c0..42b8a0c60df1 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 39c844aa9f01..dbead3f16c13 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 8c2727c7eb82..b32b9fd88dfc 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 c78f286ee314..1735a998c005 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 b31ea80c63cf..825d11b9844e 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 0eb104082d54..b7c150fbef21 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 567f48a615b3..0c7b19f03542 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 908bfa823b79..27ae356bb388 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 e48859a099e9..e72e0dc362e3 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 bd82aabe61e4..6f4643e82a44 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 1c226515e08c..fb23d0c70944 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 24f5486a6cca..79c281f985f6 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 d89a06c3aea6..80baf6d8b1b3 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 1588d322386b..83755258dc41 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 8cc1f0efa17a..917726c4bd56 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 6e866c706cef..70d3ca7fafe8 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 3f8a99853e1c..7e96f7035a5f 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 ed758e8db455..f479dcf7f189 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 f6b7a9e9951a..add3d62cdb35 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 77bff1a2d7be..670fd3f48b4f 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 6380a6ac4c97..fae958e6a266 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 a5a293536703..cf7aed016f9b 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 05c38224f024..db29c7c10d2b 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 740f88c56bc3..760524238b76 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 2fb99dda68c1..d9726e70ef3d 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 a494879bac0d..7a59420775b2 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 c3b63e8c2365..83207c37dbde 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 8363587b4d70..fbec921c6413 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 74efda6cff09..367eb9f2033a 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 df7282a5b0b1..3d09e16a996e 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 eb8a0af73833..6c04210e9a16 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 fb3c7035c60c..ea3b0a8201e9 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 f6916e197579..563b5a9fba2d 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 ed757b4339c0..256231c0f437 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 f4f7fc14c04e..a2a16a81e020 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 84347d7d5618..ffea09887f0f 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 d232518f395f..530e73f24c70 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 3f8901ca6bd9..19be820441b1 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 b720bcb8bb89..4815b5f5dc06 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 4135f43e1dbb..20e04284533f 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 e2a2f288cbb5..dcc3dbe0267f 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 a732ac8a65d4..fcaeaf699b2c 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 f7bb57172e32..f559a7704e8c 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 43cb8ee092f2..6b671f1ed633 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 536157fab722..a1bf5fae4b25 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 2d33b963c778..6155f8eda4f7 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 0a3fe70d8611..bd3851fd4f37 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 4339f6dbf5c6..b16aeb7c7e86 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 24275a8a0541..4897431c8252 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 cf4fbe9e784e..06a5d571ff09 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 4bcd18e2275f..bb35e5604623 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 eadc63d41e2e..63f60d28b1b1 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 873631284ec6..bb7c3a0dce75 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 a7b76763db42..4d6e56841a8f 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 619a44a76feb..ed22d30c4c17 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 211d7604e375..ce672f2280b5 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 26cebcf0a0ef..d881d6276bc1 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 ff402b5db4b6..faab69fb629c 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 1fa1e6b11b8e..d6c3eb01f2d2 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 16b1f7cb34a6..184ed4f2ab90 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 83415ca915c5..64089206d0c7 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 5770e311a044..f377b44c81af 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 812bc218354a..033bfd0bfc02 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 b0f9b7b49412..7a8d40112005 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 6ad6e0049358..e5ae7dd2d318 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 2c952054dac9..0f97774031e5 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 0191d716d9ff..450867f07ed2 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 15a3bbe3f580..7ce565e0d08e 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 938196ebcdb6..54c76604b56e 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 b3c3ca8679ba..02b996288588 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 13f9c5e69ba3..1cde4241aa48 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 20ba8ebd29c7..9cd2d5701c55 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 689d03caa301..ef24cd6ca0fd 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 0d9e8720f89e..5ebbed1e950a 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 c01edfa2f344..df6b983d915f 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 00a5c58dd9e0..758f952645c5 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 a62f9a9beb46..f5ddd9661e42 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 e572b98f4ddf..e63c726b3b70 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 fc89707351ee..8f536f701906 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 c8665a0f248d..bdd2f9ac8fb1 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 8ee139f5c47c..0c9f36244f81 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 8c2e7e69ab33..cc53bdf91782 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 ac17cf909b1c..2e86e933c0d5 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 5dbb2447870d..2d654faa00d2 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 73b86a84e35a..0d7f98f68eb8 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 15e121566e51..b55c6b5b9d41 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 9c80943ab347..9fe35c22085d 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 fd6f4450b1a6..2d409165d994 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 e03f6e9712bd..7422817d7443 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 9a2f18345cd2..56cc5c9ace8a 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 399366269eef..da174b55f384 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 f2277d9ffcc8..baf3a7cb99ec 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 57e3c5d82dcd..2eb913529f69 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 4efdf8e46049..00c64b6bad97 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 2e9c91c109ff..b2d881c84b94 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 28842c5fd477..ca27f1e722d6 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 1680f3f2cc51..d6f642c684e7 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 b5a5dc4951a9..b2f08dfac888 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 19e00f8d51c7..01371ce1c56f 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 b93b653940b8..4497d3a6d362 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 f896b9fffbcb..79791869df20 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 6a0edc43c316..5f245815fbf6 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 7fa5b4a0b07f..6933be95528f 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 224a0566437c..6c4b0246e420 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 0f4fe47c8e64..6cbdf063a824 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 685bd5b4d17e..ef17a8522e31 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 37b85349439d..c8b023403203 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 98ff5ceeead4..94a068947058 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 24b9575138dc..36abf35d4535 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 7e32ace8159d..79a5402f0a2b 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 8efbd4b84fe9..16a8edbd4bcb 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 fe5b3ee400f9..ff2e24bc5d28 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 0bedbf8f82e4..40f82000ed09 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 3c39bdc107f5..8e6299b6397b 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 9e75058274f7..2d4ff81db46b 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 70c296fe6e65..ab97f0f061ed 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 40dc56861aa6..53fdc1eadb82 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 8ca1c30e33fd..9202873a9e4a 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 4506002f7efb..a9b966d7dba8 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 159c921ca347..9c8eea94c707 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 2d6da1e73385..9447b243539b 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 73f418d338aa..db1accdec445 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 cbfe467e6798..7244ddd95fe8 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 32bec330e537..08a97862a7d3 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 5911bf1d90da..ddf8f7342c60 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 d10815eca761..99659e265ccf 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 88174f7dee8e..a4261a11c12a 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 4235a52169b2..18afb96e0ca1 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 26a8ee78e4f1..82bcfd3310e6 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 4b1d879b8e8e..87bc4f8cdca3 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 5d31c9ca0f07..8d8283101c0c 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 12bb8f6bf30f..38872f0d8ddc 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 b4b12c31dccb..0cb78e7903e0 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 af9714b904bd..a0dc37180e19 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 3ec979ff2b1d..b0834548218e 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 f51323cb526d..34520e775075 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 15c57d370772..51705ae6b884 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 7d3d5d229515..ae3f5125cf1c 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 c29716887979..663e4c8f9dc4 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 6bd4005485e1..3e01b65c9766 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 386e43577912..f6fc2b7c24fd 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 40d36101bb17..074c06515cc0 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 1c91e47a4221..285585f5d6ac 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 b2e2b31165a1..9419f28566e8 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 b42f9eacce91..16491604be46 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 605db54c850a..5e81c4e1102c 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 6ff31113bc57..24c9d1877db6 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 60270d94f89f..9cf79269df16 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 b2c7bca4a7c4..91a02b2c7369 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 cac241733955..e056c32eb0a4 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 e86fe7ccc7a0..106b8002e3e1 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 a5e29cf34dc2..ca6b8b096ca9 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 08e5603a221c..fad3d4597882 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 60d612821347..265adf68c112 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 3994f46fa03e..278c95feaf01 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 95c09f5b7c60..07177225478a 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 9e58c564ebbf..836c3af1af2b 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 b43086a4226b..a97fb3437b0c 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 865bb503288f..c8866d697474 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 a21fcad31e10..3d995d3398b7 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 399c914de976..3e8644cc75b6 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 8c08078cbf02..d88ede13e992 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 9972b5f4e9a3..8fc6841593ad 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 c3b9f6ab6530..d3dd80a28b66 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 18c3177d98e4..7b1f26870f4f 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 54d5951f2c2f..0952751d261b 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 90d8c8d415b9..fcca496a2edd 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 bec74d7a65dd..61a2ae35c0a4 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 dd2d8e797ec3..13e89cebca99 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 c1a0d31863c3..4f9187fff6b0 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 03caa38abef8..407e4d9d5c5b 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 c6fe67bfcc37..5e08c9a72d7c 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 faf2c0521617..9d855b1d14c3 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 38de36ddd6cd..d9d0b11bc004 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 645105d39e85..facfb1a52ddd 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 ef8262a78a5d..870564be73bd 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 c350f1ed1904..246523ff7330 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 149ca744eb22..d7d037237391 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 ad507ae14079..f9915cba13fe 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 b96badb7fe54..9909154d6b0f 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 823ca9be9eac..edb012f084b6 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 080077918fd1..a17be34d1705 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 c6357989dc29..948d1edb1a7a 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 efdc8832124e..e100d1aafcfe 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 66bd6ed1baf2..0c62673bf17e 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 b79f9a52c897..345f3c0c34f3 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 5171dbc8a45f..07259bb3363e 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 aed10df3add5..c13650cb21ed 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 dada3aedd52f..d835a33ba94c 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 13bbbb3a705c..b70605d402e3 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 06b17c32b85b..feb7eb5112ef 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 a0ebd094b3ae..d872213e1135 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 33d944843155..1ab4044f4f77 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 d85d635754fa..c7317240ce64 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 5809df40e897..6dd552b578ca 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 7acf8d1b53ef..0a7faddccd26 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 0d65316821a8..bbd8adb7db1d 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 76989f9491d0..f8c51c247f9c 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 bc568d5767be..200ac258b04e 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 f3bbc0ec7aa2..b9a5bb32a00c 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 75f31bbbe6bd..29b561209bee 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 38e2cb2fb8cd..c3e3ff8064ec 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 61dd29778966..4884848edf01 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 3ef0fdc07d93..8472638da812 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 f74bc34124e4..a362179a8d41 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 d97623a0a101..657920883e63 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 5baf19ddf253..0e1467763efa 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 46325d1919a8..e391f94cd973 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 c59fb12c869d..9bbad04360d3 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 64f82d5d024b..bd9ce6276726 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 7e19b6bc6f0f..de15b429989f 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 e8ead5713f0c..4f88107d4f57 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 7b38d3c94c0c..8c9ecb9c8b7d 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 5d1c62f1f377..484e2d071713 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 945e2bedf026..e3602f7e23c7 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 c4c890bf2247..3eb6751e1602 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 ceb8577ee6fb..27f21b74328c 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 b0b946f1c269..fb91bcb296dc 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 8ce86cb8f9c9..348a23ff9fb6 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 7838f04a0adb..b79a2c17e310 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 acc286d064ad..7722bab4ad0e 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 3c80e21673a6..d1defb7ec148 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 6be59ef645aa..405840d57dbd 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 5df63e757a77..538c7957485b 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 3742c1bbf74d..8bb74d389ae3 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 efd8f22618dc..1c9495485e34 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 69b72ebc290c..42b9161b372c 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 adcc7ca5933b..4f09012ac78f 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 a6292dca529a..b5cac75b3292 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 1af4cfcdc000..0c22b938a43e 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 241024d9b602..465217227f91 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 598107b6493b..92d62672928e 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 c65e342557c3..f6bdf3a0ad89 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 ae2fe29bafc4..d527059cda90 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 2479192b7877..72ec0ee8727d 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 b976e5fd9eab..c7611859247c 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, @@ -1775,64 +586,19 @@ } }, "alternate": { - "type": "ArrowFunctionExpression", - "start": 545, - "end": 559, - "loc": { - "start": { - "line": 14, - "column": 14 - }, - "end": { - "line": 14, - "column": 28 - } - }, + "type": "ArrowFunctionExpression", + "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 - } - } + "value": " Async functions or calls", + "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 db7856dd3f1e..e7bc4792483d 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 6088c826820d..8eb08301879a 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 e743dd0477a6..a30af7f2bbfe 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 672f98d0ad8c..3315087c3d4e 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 a5fb057eb10c..c3c7f880bf51 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 93ec46f9bc31..24563be730dc 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 9de1cc4338cf..b687d1711180 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 7b807528c3b9..baeda3cb81d9 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 a69cbb049a89..efef58004674 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 25358ef97ae7..01a9ab853863 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 a5e92908c53a..33e3c985215c 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 c4c86f1991cd..de9cd47bb358 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 5e5c135d5908..27ab9b95ad66 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 44114ec35913..6895d0b4ef67 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 b2a4c51e2bc0..555f58649c80 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 532ca8848c0b..d034848f859e 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 8389c568e814..dd8f7d4acb27 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 d79d846383cf..4f2b265c8859 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 2dbdc1e727c2..d1e848e45942 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 a13ba7dc082c..6a4433ea75d3 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 a8dc40e08d4c..d102313ba870 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 07a5a53fbc08..085f418b8da3 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 6833e37c4de1..4f7bdf0cd238 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 b374e2bcebd9..b68fa592840b 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 9f326dfe3e5e..00382a7d0f82 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 86b98af15006..bbcc52e79f84 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 76300249f569..ae77d22a5326 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 b5b462a59cf5..fcfa4d85054d 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 916e60eaa94a..6170eb332b03 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 0aa57e51c3ff..017c30dec6cd 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 6e394ffbcda1..33397a54dd82 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 95d0b22f7cfd..13e009e688b1 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 09c73482f8f1..b6c3a2ed34c1 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 52626b852e33..31719046a5b5 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 f60940e178bf..0dbab3e68b36 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 271c66e47dd7..80e7ca6b69f3 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 d41f91a9d947..22d33f342732 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 4f1dcc135976..749d355f7d5f 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 70d30bbe8a92..3a91cdcabb5a 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 13fe2cfaec40..9f02c833e573 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 d49e3470fffd..54d736943f7f 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 02498cad1b22..2ab57d3cafb9 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 29c44707cd51..b5884b344691 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 599c27a96449..6b85017fd2bd 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 dada487fe124..b7690d15c28c 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 fd42e0453f20..63abf8d6cf84 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 e7e01aff7792..f12a90e7d046 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 b7b8d201d021..6877b15e5f01 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 1c1fe95023aa..869c689c865a 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 a1ff7e2786c1..8592d1737fed 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 75a8bc8b79e1..e78f03a85792 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 526e348eaba7..8bab56eca723 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 85e99c874f9e..629880bbf293 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 133149d81a31..7a545d1e6536 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 07264734b52f..654e969541db 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 e8d609bee62a..f085ab9a2d0a 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 0212f566b651..7e58c33f5885 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 3bd5d138aed8..d971c67a7547 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 99987bee8e19..9449309b7a07 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 06cbe65fd5ae..73530e6d3bf6 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 c5506a0fe98a..8623c7e1dbae 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 a3e8ba642bf2..ea9d3a211918 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 9ae1b33f3694..eff1cf78a25e 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 4b3587d4c8a8..ea777b7cf185 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 ec02ec57394d..0f8f2401a39a 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 ed6301370237..6014c379ad88 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 df1f40c30646..d2b53a640285 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 d5d9f7533f09..19cd5a6c089d 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 8db7e41bee49..8b942e9bdc1a 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 65c1d505734b..57e141cfd792 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 165aac2e4caa..a68703eb4f6a 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 345675c7e135..696aa6b4a2f2 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 572fa8af86fc..5388de3eda76 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 e6f9bcabf39d..fe45c3c0e5dc 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 1b1c02e6758b..a9fe749cb323 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 ef2bc17e2d96..bd280f5d148b 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 042dd3afd3b4..a9ad9925ad29 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 08cb55525e09..4ffc8971610e 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 c88abb4a585c..6f5bb81982ce 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 ce7e04fe7836..977bff7113b7 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 bdd81eaa2c09..fcd59e9c91eb 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 2e33b31f6c8f..1c70bbf4c422 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 6e48beeb05dc..85b02bb6fd2b 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 6d1756ac6212..f3000dfc4440 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 f3c78da12ed4..9360adf64e81 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 6631ac13ba36..f74434914038 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 59fe3a8d364e..26c61b4ee1b0 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 9996d286ce75..eb1235cabc11 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 3b6ab163afd8..b897ae74356c 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 e78a8bfedd6d..79e4e33dcdd0 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 4dfea64edadc..35af6cc8d2ab 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 040ff5318a87..82b7ad2a9684 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 3e1eebe5e66a..1ac23f768bd3 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 c6dd81472c76..d9e9cf02431f 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 fdb2eedcb099..802ad5904c55 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 243a1e66ff3d..af9300c4a2e0 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 1a1c2f0c3a39..960cfe4635d0 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 b71853c1e1c4..910ef40401ae 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 d69487e11e27..a4834c4fa0d9 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 6ba209d0a64a..4d69f5949667 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 f57534e0225a..c1a395b6a556 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 d38270441cb6..8eb0e2fe683d 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 3a14103ed5d2..d4c417b0e46f 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 17fdd74e265e..60092a40b6ea 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 70cbbd4fef08..928d31152fae 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 1ef29b3b8bb6..c60afd7b1e41 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 b389c49201ad..d77d9d033739 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 cc227490d30a..841e2e0c04b1 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 431aa501bc4d..7420828cc842 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 428bb08cb9aa..3b3472e5d1ff 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 0e133ba1cfbc..cd5d4d6e481a 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 03cc703ab871..5d8ef8f03bf3 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 961fcf35dcb4..3b1f45e1a9b3 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 2cfc8de95973..817f27b39989 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 2f073e822eff..7bdf8b219080 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 b918a1e51b0a..3e4e5b09000f 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 05ff2466b98b..049308dd2a06 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 90d30599238c..1e24e550104f 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 37ca8f2e16a5..5eafd0af6f8d 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 90645ea05110..0c2248fd3c60 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 25f26298f07a..0a761b0f745f 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 70f45659a6ab..6609f33d453f 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 269670602203..a0425a4573c9 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 775ca31fcbc5..08ad1d80a743 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 27ee33be5ecd..5d7bbfd9f096 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 30bfca7bc1eb..49eecab002e1 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 8bab5ed80220..34692af6852c 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 97967a24ad0a..5115a9a3f165 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 9d7ab3c84ac5..7ce1b31f8b2c 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 723428d1e003..eff3ad308aaf 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 0008b902d085..60b7295b821b 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 6ae0568ada05..b19b04b9728f 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 01df1e9622df..a675fbe30505 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 946010a4c0c5..50bf337b3895 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 13e6d6b9d299..998d6746f558 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 cfa5f6db54cc..cd0f73c910d1 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 25d46071b872..1d30c0987907 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 ab167c1f8165..f53f6967816a 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 e9fb827b5b7d..2c7c6e328281 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 0a9b33366ff3..d03e6ea7e4bd 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 ffa3d314947a..4b9e6ec20f37 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 5585c51d80f7..d8f6311f0396 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 867c7ca3769e..ebd6fd0fe18c 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 e0b6a7e06356..23c2533a8af3 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 9d9ac56c78cb..faebb38ba0aa 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 04a418e70d89..b49204c7f0b3 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 92c2e5e1665d..791438f7b79c 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 e7baf1080ce3..0f66616e39e7 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 605f52438707..36bd9e345659 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 566e2fa3f54a..910d7c4938bd 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 419b2b79b70f..cb52b23baff7 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 664595806087..82bd2b624fd0 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 584b5db6d36f..fd87323be264 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 7437eddc1eea..34302acdb383 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 b2e8a95b4eab..75b43c1f700d 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 1fc77461384d..b416d00df481 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 fe6af7116866..cbfbdd516663 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 c093290d0c0c..8750bcb37950 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 f9f9e396dab3..ec686f840182 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 910e0c6bfa07..bd719a79fb2f 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 06d26c8e36dd..fd6dd628c922 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 3a08e3a09901..ec4c62081263 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 e973dbacf6dc..8a1a9a3dd0a0 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 508ef355a397..3f525d36038f 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 d5d5e221c1cb..30d0d42c5f39 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 669b435ac2df..1b22c73f7400 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 ec5e4b479bec..7cb400a2d942 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 3bbbf6d80d84..a3f6ad7100a2 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 6a24cf2f1e35..051aff7dcdeb 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 b728bb8e6f02..92a30707f505 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 39903f16b10a..a727d87002c0 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 9b3179172293..af55784168e2 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 c6ffbdecd47f..54e622f199e0 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 10d818ccb53b..bd76acce912f 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 6f52323d1678..d53d3303ef77 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 056dc7de7b00..43c601b76553 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 78be0c8ba059..37c944d36f74 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 49fb1b3a7b0d..b8e1ad4ce035 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 cc436b3b0505..08f7373de7d6 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 58a7471e980c..9822fae01d58 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 8b8eb4bb5a32..f719b76ee8a7 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 9236c950f3be..0335f33501c6 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 25467cae1b2d..6a21871a8258 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 5ef43efe2bd1..fe16d11775ae 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 a08797bcf335..8b2be7f584af 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 b6326ce6a2b1..a779d3c652bb 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 8d791a081562..69bcdc69f58c 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 01516efbba03..61c9e46c174f 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 74d1c761b02f..aed14419e665 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 f4d18be8251b..b562088728cc 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 64a6f20b34b6..0a08fa97c4bc 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 a93a2ad01ca6..13f0e7bd7a68 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 2fd6fbcbc268..60caa7c8594b 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 cfa41720d824..fa4b9aa787dd 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 f7a9d83482d7..afd2b79b2220 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 52961a4c6105..aa6840c310d3 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 e423abed1ed5..3a4d934f13ec 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 b859028ce948..a06d19da59be 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 8597e224eea2..efea0dcec91d 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 d9d33e1521c5..f2ee74dd938a 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 afe9eb91a15d..8d3f055fab19 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 212024410120..c286ce7a9b01 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 f5fc078a42ce..2406bba2f4f2 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 aeb7eded0711..437eac470802 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 8e626c8ad0a5..fcc0c31ed6dd 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 5ac98d7b46b7..cbd99a19951e 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 3a1010d807fe..1e241ce54643 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 dcbca6978a12..4598f3355fcf 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 05cc09533a23..20c6c607313f 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 90585f1b4f80..37af63c0996a 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 4969f577a320..56fba75c81f5 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 2b57e99a30e7..ff46538a95f6 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 174e856304f7..8d2dd58fa474 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 95872d960a5c..78cb69bb8dea 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 c4508202637c..5d46fe17f39c 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 c4508202637c..5d46fe17f39c 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 a2837f7dd58d..bc961ea83520 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 64b7c306de3b..1fcb8935c9e1 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 cffd72d465f7..b1a4c4bd1ddc 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 b902d88e157e..127bd9282556 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 8b2db5858c66..767a8b87545a 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 773dc48b8cc1..fc8e1f196b8f 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 5e5de02ff3c2..a284774820eb 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 bd86fd173803..f0b6c308604e 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 a86c5b5aebde..3c1f8ac956fb 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 d817f6ed4713..86e2ee528e18 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 7df2d61ae2d7..c73062c2bf89 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 e70ff3c2755e..339773cf697e 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 fc7f1bc6ce23..c83517dcff09 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 260f1c730965..b7e5a930e256 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 a75a9589d316..f09c475b6126 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 1b67e740c14e..14d0d4bfbaa0 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 d5ac0faff366..3118e7c29ccb 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 d2fb70504640..acef855dde41 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 d8b08d1da8b3..9a2538975c98 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 0dc5c6af71e8..152e3df13b06 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 9be1647ab244..b4ee22f6fcd4 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 78b8589e63d1..6eefbdf4a3ba 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 f98a88da1fec..80f780346aca 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 131125e884db..53499a9b3342 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 5f129dfbd4af..b451a6886291 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 463e2ffcb24c..dad8a1a859ba 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 e30f8a938f73..05dc9ee1c893 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 297c8d177689..ebd1f2cd376b 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 53ac01f6fe9a..ab4466e15218 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 e087eecbd2bb..a0f7c08fcadc 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 7b90b530ad65..5881b270042c 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 6d1aceded869..e35839347f26 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 26c9a3ee4039..5903b120858e 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 6c48948afe6a..a1f8a7725956 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 95c6966cb5e3..041443eb98e6 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 4d9f9da74bf5..c8f7a5641e1e 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 fafc87e64442..0e3ddeef5439 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 99c2b77acb85..09dd6a55f57f 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 098b44cec651..84a61889a5fc 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 6b5b957074e0..c56ca182c299 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 84fcef591c74..5eb20e808dfa 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 0e18e29a41ea..60c8b992e95f 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 8170ccf4c8d9..6fef5e583406 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 c5ba396b8101..2dfd651b7a6b 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 d8bfbe9b1216..98c3f55f974e 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 517f9d043755..06d2a6430d16 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 5ae330ce23f7..9633347434f8 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 0dc34605bead..e01de114e596 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 c8d784f85fd3..b9f585103dd8 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 70c311fbfbe8..61afa7d3aff6 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 ee713f49d1d8..43465f251328 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 7c95fc951c3f..0f575bce2909 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 acaecedbd162..28166db395bf 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 5a1709007f43..d7438ce991f0 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 7655bc7e042f..0f199c3576f8 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 24262087534c..2e2704398093 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 3ee9c36533f3..a4bd5cb8573b 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 8ecae0406bd5..57c6e3c2b47e 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 e48fcd57530e..b7ce5fff4a8d 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 ebcfbfdc73ff..05753aae0aa1 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 1af0c7849bd5..969618c86895 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 b07a503ba508..6f5c8aa7b96a 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 a781728b23c0..c1de95224e5d 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 c32f7d50f55e..e50d64b1f5d9 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 cd5d3b3888fe..306715c7ea80 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 417106c4996e..b6a7ec4bf145 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 5fa0e0d0fc57..5cf9215fecc9 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 d67b18f89955..86f8bc59e3e9 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 152cea1d6c6e..075fd8fbaa45 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 2306ee643e7b..4a0689eac53a 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 b7046c70fc3d..3546f044c8b3 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 da7d2b16d94d..29e49e74efa0 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 e02761042799..02bcd5df3486 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 fe57b763fa73..7a6af6561102 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 d3a333659795..b018b26610dc 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 a6202bce9c8f..217844f82939 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 f590db411348..1b8ec9dd3632 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 c1d60cb1be69..161d3dcb81b3 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 c5a33e2bb680..00c80d5af722 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 b5eae7fc0655..e8b60debcc63 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 be21c68891bb..4ab9e3b82d16 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 b759f48d2692..677636892573 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 fc694e099dd8..bf5d832829f6 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 4b7a168fcbe7..02bc04d35af4 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 a58504569cb5..404503d8655f 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 cf95c18b54b5..a47ee63bb988 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 8a88583570c3..d70e7d0fc17c 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 29ab5696546f..54ddb9bae05b 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 63350c9eb5d8..a5d5ef8d53f4 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 bc8730300dda..bdb2bc10538c 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 9445bee4ea00..d32da25e6786 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 80bc377df5ee..74552206a932 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 15e5a1a862d1..de8ce5791dc2 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 54bfbadc9d57..07b4719ab585 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 bfae92192f57..bbf531aefe2b 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 8017ec8fa0f8..50b7af00aadd 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 d695f1c4eae1..7d804c8ddee3 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 8bb402e4312d..c87ad6b98ba7 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 abafdf5c8759..29cc38511677 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 c4315832f005..c06d0a72281e 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 4d13018c3020..dc0f88188df6 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 0bd5ffb6bd40..1855819ef9ca 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 4896328afde6..b0e63aa6ac58 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 6b0b16b70fc7..89b39b42d700 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 61966406846e..d8d6d4bb5966 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 70f4a636520e..649a06dcc065 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 459dacb35f2c..693f74878aae 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 0fe8c71d4786..0d6cc4d1864b 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 b891fe7c30d9..e193ed51d809 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 cde4f271b7de..8a3a9f64573e 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 8ec0bdeaeb64..d52bbba58828 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 61ecc899ae22..f435f0a37072 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 966639d5d351..b28056e898c0 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 a0cc4fb21147..4887a8756c34 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 3da7a5b3b526..272f92504b24 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 79bf65de1189..6b4908e154a6 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 ddabad2b64c7..254503184ba8 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 5d7db268eb97..55842e9c465c 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 f89643fc0a7b..69e81274c952 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 637b5256b845..cb1bc9f9c9fa 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 2fd4cc6f3a99..7960edf4baab 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 34e8dd6e3a04..17aec6b58595 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 5c9ae8516dd4..a33db15edbc5 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 67b0f0429f79..251f78d866c6 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 b89f3e8dec86..1e90f81ce456 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 2391c0c770d0..4ea4409c0637 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 87a301212145..68d516b0d9f0 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 9de9b6f77eda..186d0eead51e 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 3139e3132180..a7122229e1d8 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 fd6205f7ab8e..d8b659b17848 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 a07531190e7d..e0b4961dfe3a 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 1bc90cefa7fc..673783c39ee3 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 9026f46c40db..0bf00557e708 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 b4fdc7e984fa..75a10d9171c2 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 3ec417645be0..807b8ef9e4fe 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 e681ffb18417..fe0e247d127a 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 62d764263d3d..d46d85c82643 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 6fd8a2dbed1f..1fb751ada336 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 a92281d0746a..c77899f26242 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 3976944a46bc..7426dbf77409 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 4ff06895645b..81e351c1d325 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 5690ee81f00f..2b7e6735068e 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 e33e48771a60..d4af9626aa24 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 c7d936e96c64..b52ba4d5dd43 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 bfae4a044410..fe0f44bed277 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 5477bef4ca9e..aa6ab6e293a6 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 9b3f08486a88..1508f63de6f9 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 7ff6bfd05846..2d8f5acbca2c 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 f1e2f1614781..c95cb6187a72 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 ab4488d5a04c..d6e17d6f2a60 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 b6876979197b..6410a2a4d371 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 597468988557..43a860dc7806 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 9980b76f599a..d3858004d2e0 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 1f071964bf16..7a9984f2071c 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 d5f19f4035d0..9e6544a78062 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 133cd26c2bbb..8a3deaca0bb8 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 8c1574395e8d..85e58ce03ba4 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 a2ca569516cc..a13e68e19c46 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 e7a3e3992115..9569219454fc 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 d021e73d9a8c..0a1042e0b619 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 ff9112b64a47..c97e162198e3 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 10ad99945bef..9ec467375c4d 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 2ab16fb38940..eaeda9701773 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 857c56d8be58..a7010d53bdab 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 aca1e4618179..4a4fb0ec742f 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 e13c89c6e10e..61041ac80763 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 cedea33cfd00..6adfc564586f 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 b526e3c8f49b..02920dcb390e 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 81b1f6404209..03f5f764159d 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 0812973f7961..9e6cd8f6b18d 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 90dd3a262529..3f57651c4ade 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 a2863b81f32f..231ffe48c21d 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 30f7f466384c..a2993761b6e3 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 1e1d390dd11d..6ecc2a7294b8 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 9b97deac6b2e..6d666e5a46b4 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 1dec0f7ede36..ef2261c2c2f1 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 34756c1b315f..02d071d32324 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 a8589a5f2dbf..cd7e8ac5f178 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 ee619e14ad22..a9038fabb2dc 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 585a0f4a8ae3..9dbaf187ba7a 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 0d6e9f64b8cb..a59cc05c31f4 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 4bca07d43f55..c42f82ea125a 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 2df38bfb4c2a..b3302e7b3a13 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 394be5e8a868..0311fd5cab5e 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 20ac2d6fcb59..23f152c7a96d 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 6a8dc5942eff..ca789048f361 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 aed5cd10d422..8612e11a8ca3 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 bc637103ee6c..f211a830b4bb 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 10d41548ffa1..21c9d62bc364 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 01a056dd1898..a8a69e55bf82 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 8af1eae03c46..980a142db169 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 d3320bb41535..f038e122ec39 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 b28655fb55ff..90c2313f7b3c 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 aa657ee84f3a..13a2d4749870 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 816c9ca28084..248e37e2e430 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 eca1eab06f3a..9d9669f8ab97 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 f4c66f0f4bf1..24454f584a7c 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 e8a5f05eb61c..1fc04d4b7d95 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 9d4940d16247..6cfc4d9f208e 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 58c3d9672124..2d19c9f092ce 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 1f99918b7ad3..53c4a1b036b0 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 3a08e42c865c..61083fd0e738 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 45239b7a0c11..4cc69d94f780 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 f06258409292..5c2fb6c0f625 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 dc6f8702bdce..6fe5b0873597 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 bed7e168b396..a98a1eefa26a 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 e9d5458c1c89..46971ca25ce9 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 f63a5e0581c3..b356931f8a16 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 62c634c7dc8e..438bfea02bc2 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 82cdaebbcf79..6cfc63021f38 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 bea1caf3de2a..9e6d3541554c 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 90484c4b93a3..8caf5c9c34a9 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 84bb9f048205..e2c60e35e2ad 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 5825bdc4db33..399b0fb6572f 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 29e413f17d6f..f94f25c9a098 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 08bffbefa06b..ff31722aed34 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 369ec9d0eb08..10d0beeb57d2 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 52cb7ee9d5a9..81af16cb094e 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 e1177f2c1eff..b0aceac139e4 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 a83b677640f6..3cba96e6515c 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 f07df1678fb0..bc0f97cffd33 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 d621a6cb84c1..de6f9dbe8982 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 c7b5f885f22a..5a327e4f420b 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 5c3f1fe6b4a6..cbd35d32f71d 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 bb02e0d6956a..06c4c0109b08 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 66c8f18d05f2..564c221f8e72 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 1cbff7954979..d8c1cd3047ce 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 c783913599ca..9e5a3057ec2c 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 4f8a2a548b75..820cc00e77ec 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 9e08ab2e65b7..69f2748151e5 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 19ec66b99e8f..4f00ec5ea154 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 093a065ec05e..893ffd407fc5 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 d815e81603d1..1ed571551016 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 f8020782bcc6..027243b75610 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 964e552cfc5f..5b7a8bb9fd6c 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 34f750336a37..d0f0c3a11dd0 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 0da048e7ef02..79fb8312c758 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 f7f4be716603..31af6553e567 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 08760bb11d2b..80d77b30c63e 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 50d59f6e6383..a4dd4721982c 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 e0ac8a5907fa..2eb4a2e8912b 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 b2a7262f0397..14133610445b 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 24aeccd1b0bf..92b431cd0825 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 55d2eac06ccc..4f03b0ae91e0 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 fb27f3055064..88767978351c 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 a2a697b6ec13..f5caff15c0c2 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 746e2964f438..6019ac5ff859 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 0219c43119d2..ffa963c815c3 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 764a3d2f7efa..8f95aef58bb7 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 f52b40639e43..05defba81f38 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 fe51bdeadee2..945b98a43008 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 d4a3379dd77d..d902e7d6b78f 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 be0e8f7c910f..1111ab1f13e5 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 079c1b83c16b..a5c79a60acdd 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 08401f5d6d9e..1947c1767de2 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 e4478a0a5c71..c1df03485db7 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 0fe556a129e5..c27b6af00f12 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 a84755dbbeb5..ba6f83ebb007 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 e87b66206434..65b948ab9599 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 458a092357f2..676b374c2e07 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 eed6e29d71cf..a01ce54b0ac2 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 bdf468513b3e..19af433cd482 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 bcf3445883b0..19e0d7bc5a9e 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 2117403c6176..931c3c99a40c 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 b1b3fd1a3517..3e05b3479d18 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 bcd481d869bd..6619ed4663eb 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 b386e7aadfaf..e73309d58279 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 e1021cdafaa1..48a27c3f99cd 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 568975c0bd63..390658ca6609 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 cbf364b4ae5a..65872f1e6816 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 7abca58de307..b4e838b1b960 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 198e2e1cf0c9..85529184ac19 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 9cb642e1b385..4e1f8f0c5cc1 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 5d7a7655956a..a255c200f154 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 a58a0876ceb6..f3b0d34b64a3 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 5a44292aaa10..fcd7232c7351 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 051a939e047b..7cd1a5f643a9 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 31a91036931a..7f16ab4af1cf 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 9436fb7283a9..a2d22a5968a1 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 a131ac8e6978..0824c1204b7a 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 219e2a2a60b7..0e54ba03db29 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 a0f7f5f5f39b..22a3ca661e86 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 9107b0794815..59f5d53634e7 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 360a75b9f7a1..5e3dd363ef99 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 60afa0c3bc76..8a49738f30e3 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 3f526e42418c..0bf961bf5037 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 456ca59ae4ae..d97d1b18bcd0 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 dcb6ab198f52..96b576baa8d2 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 67a50c2c16ff..6d6a986845db 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 e2d79f6dbdb2..a0f6801ab6f3 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 4056ed0c50c8..e44bdb7e0136 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 4c2c94afa928..6e530a5502c5 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 9562e7979622..abaabd96cdbe 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 4d58e741f456..76b565c7bbcd 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 234d16b48b3e..c91008a9597b 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 a4ed43a77f94..ad47170376c5 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 211767c304a1..32c2b66597b4 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 249423eab47e..5dfedc4e3ee8 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 43242a7a2d90..421694881ab1 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 2b7786be2c95..a5b611f659cd 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 1091cd74344d..8fe433755c9f 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 63eaea000fef..89a3f765cb0a 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 e8db08d8f766..4a0415750ef9 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 91add31ed156..f546aad36972 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 78500087ba53..ba0a6fb31cfe 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 1218597f4b94..795afe3cba3e 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 a4bb0b3edc7c..f3af45c42a77 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 f0db16702d27..f9ee00cb00c4 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 1e2557b5aa66..cf57b3872576 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 883c7397ecaf..222becba7a6a 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 4852ee8f373f..013c08b407eb 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 bdf96d51700e..9a9bfcb6239d 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 edde64d01369..fc12e3e8f9f6 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 946d73d08ba8..b61f1c0a0774 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 a3e00ac10bdc..7ff47b34b674 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 7f7db6c4b6e5..543538f7a1db 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 5b77e5a9e2b1..c4249303c1d8 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 43acb3b77b28..bba4bdacb985 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 8d7021f0cabe..653d3c688896 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 1b6039be1525..47da0131e957 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 ce157bf4f047..e8399c38636e 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 51485202740c..5c1d6a9647b6 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 9d7eae1f64e4..ef037867a267 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 e687b30cabb8..663a8812ecaf 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 20dcd3d6d8da..6db63dafc279 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 562fb348506c..ed420fce066c 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 18554b17a558..edf987a0149e 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 42c8c034dd19..8aa516aeb780 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 ba424efc68ae..9e3783493f1a 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 0ed87c620a55..cfed1a795c8d 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 3ef0fdc07d93..8472638da812 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 90bae5b4ceda..b834fb54ebb7 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 cc6ca197d7ec..a0d01df37243 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 4ced84dacea3..956c79da82f4 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 03e8106d81c0..0c26c566c6b6 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 0620bc35a34c..e35c550f8aab 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 e69632d570ab..adc29a8ab46e 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 1140ce07c28c..b91fcd5078b0 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 a34049886944..32c0a85958f5 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 cbad2bcfaa8a..4f8221972167 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 3a27b871b8ff..c5eaa9021eb7 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 1a7dcef7a96a..dd3c9e4ddda7 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 66865baeaa83..e08c41659ee0 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 d3902ee1e913..00ed1c2cc182 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 f7fe8f0c03eb..d6b463c693d0 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 f8891d564146..a01e69d56c38 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 5b09114bb272..7ab2f684e80c 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 6a4a98afb573..f0c29970791a 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 b9bc92ecb7bb..0546e0e21df5 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 37f707e8f8bc..dcd0be5cd357 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 fa745450cd54..dfaf36169aef 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 c1c3b22a610d..48f549db12a4 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 0c1b0a87b174..0038b79005e1 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 56e109b261fa..f4f22a613f28 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 ae16a8b7ddaa..9b822018f0ce 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 7e53f4c70113..4d2a3072867d 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 0f7e0a88bb7a..d9710b301c82 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 ea83a7bd8de3..59bb78a048ef 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 6b7b44d5d92d..f4e4aad0c27d 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 d286de258eb6..2494ecbfc434 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 91add31ed156..f546aad36972 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 5f8ae8eb5bb1..8bcf5ab69dc8 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 ff0da7268c7e..649baf03a44b 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 67d5f30c5dbf..0d107dd6726e 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 efae4d5c9247..1bd3f38ff785 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 347a92127a0a..24d18495a92f 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 c0f886e67302..74eabed8abd8 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 06f90373184b..449aeeac499c 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 d731128cf4b1..6562e2f3362b 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 6c3609f59ea4..57fe9bd33cc2 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 bee3b058a55a..172c4f667538 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 eadadded2851..69d543dc898b 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 42f6c8b98b0e..0a92626ffd24 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 8cbb94861b92..967a411d65cf 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 29dfe9b55540..63473abe7889 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 38916a842653..c7a987bc3fd2 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 c2d937d1bd58..f8b77aefebaa 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 ad154a88fd59..dee491112796 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 d11131105469..ed163c699405 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 d62f3bba74be..9369b9ba7d93 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 205c683a029d..e6a42390d2a4 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 ddaa635e8f86..9c74c8de9d07 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 3532a53a3ffd..72f0f6635a4b 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 df5b73f76cf8..2dc87e91b68e 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 4033028297ce..46d31f603be2 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 40da2edef6d4..1ee9c0bf6b56 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 263dec8e48ce..b24638468861 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 b568f8c09849..1d0567998efb 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 301c98de69f7..80c8faf0bbb8 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 3053978d881c..b5f2fb8ebd93 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 7b700a883bdb..3da921f98898 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 d3685c7d0db1..54e57b9a6d14 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 e1b72e08c71d..4d37ea056a7f 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 0de95961df1a..b5e7e60123d8 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 5642df62a53c..b3b42d74d8e3 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 6d6bbe962695..a1cc8e60fcc4 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 b44cc7caf564..aa8b62bd8605 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 c6886d19470d..caddda18d801 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 b51eb30f5c6c..ceb37c4d1a13 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 2120fa78e381..d8c2160f1fdc 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 b6b67ebef96c..baf3fa807a05 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 8518fac0e7e9..6a310f817190 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 8a9778e36851..0660bfd16649 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 a270131731fb..fe1203f2f8d4 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 ab31065f580b..d254111a610a 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 80905a927dc9..62bf37e86c3f 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 4f8b4783578a..cf541c4247d4 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 e347d9e0a548..7b8d2e208cc2 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 4f8b4783578a..cf541c4247d4 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 c8a1a8f8dc65..2613394dc026 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 13e97e869b2d..b5b280602ab6 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 4258090807ff..7b3e29f9ad14 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 351802cc6230..479d69c1a16c 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 5b0af1060cbb..49647a7e08e0 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 63b26bca4458..27a720cd09d3 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 166403881b86..390d3ba24dc7 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 598f4999cfbc..c10986676275 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 0c96b1cd892a..55bc9a70c433 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 e353b5cd0b83..873109cdac08 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 1c1cfb5c1696..cb3f09c087df 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 d1833f641360..46c02e61c9de 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 8c157d8a364d..9de57fd629d2 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 3e63a0f7f298..7738c56de634 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 ba27b683a4b7..775af3064133 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 805839ca3c76..a301d8fa075a 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 4983be36642d..2e27314bf592 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 fb4fc242eac9..c0b3d027b190 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 02fde75620f0..48fee42b09ad 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 8a2375272f10..32a03fa8d704 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 1c1cfb5c1696..cb3f09c087df 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 068b9e0779a4..1dd2dd5d62cd 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 6cfc11c09339..b8b8f8ad7135 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 ec9f551e1fe3..851aa2292336 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 a61beb416a56..f29bd2729b7f 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 6a3a62345736..f4a610d0d307 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 a172139f6af6..fcf7b553f9b8 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 7f9c1f9fd3b7..0e13050d3971 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 e92d91a761a3..844c6486bec7 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 914be894cb88..436c0c9bfea0 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 6cb892434456..e267751ff08c 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 5b329de3547b..2f64bc6a46b7 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 ce11198360c5..7de727879d7a 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 f648588de12f..b2b541d1bee6 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 692ded13ea7d..5071d457d79b 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 8721061b7f18..a5917216b2ff 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 c8b549d70049..6063c08f37d4 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 15f1e7ebdee1..94c356bcf7d7 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 88035f30fd28..503d9fd01ccf 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 b710e28b8d21..84bd90c471de 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 221b2e1d9d4a..72dae30c84ec 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 39c42538452b..6917332b04ae 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 eeb30b1574ec..e359150e7331 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 708c18dc7c5b..9a7acd6e5985 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 91e208a34f9c..cae696cfb551 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 be6f63c9ee51..454bedceab87 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 13de762ac455..3df1338cbc58 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 bd2d69938b98..b0f9cac40033 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 a3aa6c8c537b..0c20c2d20d0b 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 ee52d9dd6d62..309a765c97bb 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 4c6e48290b18..1bb07f76703c 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 44bc4f2acb1f..fdab5fe10cbc 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 70e16143508f..98188ca7ad59 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 ee12b09143a3..0794c7490c11 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 a153fb364a09..66628e71363c 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 ee3c9e5da012..1b6b7291f9be 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 c9cbc53ac2f8..7a2d467c2d55 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 5cde8240b24f..7b27bddbec7a 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 7acae4a0d346..5f00b53a21f0 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 875a3e53d002..5b8fb1442f77 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 29c9133d8a71..70391b5255e5 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 ced722e79dd3..05caa4bb0bc0 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 73c4d7d4cd3f..95f72e236eb9 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 8a977f1e3987..852a87e4d306 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 0e0dd2eb9f49..b787889c9d34 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 d233c0685d3c..15946fb36833 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 56873561f534..644490d17720 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 2608329122d3..74f7532232cd 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 667ffcb301f5..6137ce407347 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 b66ac1ec7326..f15efb254a34 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 90aaa9bc8aac..224e952da41a 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 1d71afdaae49..c3bd73a9c07b 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 28b281a6ccdc..fcc0224f81ad 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 fd5b5999c51a..45db8aad9323 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 5b6c0e2cffd7..429c0b8d80df 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 d3e4066546fb..4522046cb547 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 4f8b2fb7589c..166fbe689328 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 20e7401b1fe8..4887ea6d5bdd 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 4d1c861ed1df..6d659d4ac72c 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 abd65b02a231..79a5f5d4fcab 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 417906511ce0..b1bec4d3efbd 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 e44d316e19ce..bb04898cf9de 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 c02efb12aecc..b1955a2da747 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 3843e6652fc3..108b36d8c024 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 50294da42d99..4a3d356e56df 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 6233a3f2dd7d..0bbbdb1dc37c 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": []