From 9413b1f88eb444bfa6a27ba15bc7dd46267017a4 Mon Sep 17 00:00:00 2001 From: sosukesuzuki Date: Fri, 26 Mar 2021 23:34:11 +0900 Subject: [PATCH] Update snapshots --- .../fail/7/output.json | 104 +++--------------- .../fail/8/output.json | 22 ++-- .../for-missing-semicolons/output.json | 16 ++- .../invalid-assignment-pattern-1/output.json | 16 ++- .../invalid-assignment-pattern-2/output.json | 16 ++- .../invalid-assignment-pattern-3/output.json | 18 ++- .../invalid-assignment-pattern-4/output.json | 18 ++- .../invalid-assignment-pattern-5/output.json | 18 ++- .../invalid-fn-decl-inside-loop/output.json | 8 +- .../output.json | 8 +- .../output.json | 8 +- .../output.json | 8 +- .../output.json | 8 +- .../output.json | 8 +- .../output.json | 8 +- .../output.json | 14 ++- .../output.json | 8 +- .../output.json | 8 +- .../output.json | 8 +- .../core/escape-keyword/invalid/output.json | 14 ++- .../output.json | 48 +++++++- .../output.json | 80 ++++++++++++-- .../output.json | 32 +++++- .../non-octal-eight-and-nine/output.json | 16 ++- .../numeric-escape-in-directive/output.json | 16 ++- .../output.json | 22 ++-- .../non-octal-eight/output.json | 8 +- .../non-octal-nine/output.json | 8 +- .../output.json | 24 +++- .../legacy-octal-after-use-strict/output.json | 16 ++- .../core/object/invalid-setter/output.json | 18 ++- .../non-octal-float-strict-mode/output.json | 8 +- .../regression/octal-float-fail/output.json | 8 +- .../dupl-bind-2nd-lvl-lex-nested/output.json | 8 +- .../scope/dupl-bind-2nd-lvl-lex/output.json | 8 +- .../dupl-bind-2nd-lvl-var-nested/output.json | 8 +- .../scope/dupl-bind-2nd-lvl-var/output.json | 8 +- .../dupl-bind-catch-arr-destr/output.json | 8 +- .../scope/dupl-bind-catch-dbl-let/output.json | 8 +- .../scope/dupl-bind-catch-func/output.json | 8 +- .../scope/dupl-bind-catch-let/output.json | 8 +- .../dupl-bind-catch-obj-destr/output.json | 8 +- .../dupl-bind-catch-var-arr-destr/output.json | 8 +- .../dupl-bind-catch-var-obj-destr/output.json | 14 ++- .../scope/dupl-bind-class-class/output.json | 8 +- .../scope/dupl-bind-class-const/output.json | 8 +- .../scope/dupl-bind-class-func/output.json | 8 +- .../scope/dupl-bind-class-let/output.json | 8 +- .../scope/dupl-bind-class-var/output.json | 8 +- .../scope/dupl-bind-const-const/output.json | 8 +- .../core/scope/dupl-bind-func-gen/output.json | 8 +- .../dupl-bind-func-module-sloppy/output.json | 8 +- .../scope/dupl-bind-func-module/output.json | 8 +- .../dupl-bind-func-var-sloppy/output.json | 8 +- .../core/scope/dupl-bind-gen-func/output.json | 8 +- .../core/scope/dupl-bind-let-let/output.json | 8 +- .../dupl-bind-nested-let-var/output.json | 8 +- .../fixtures/core/scope/for-var/output.json | 8 +- .../undecl-export-as-default/output.json | 8 +- .../core/scope/undecl-export-as/output.json | 8 +- .../scope/undecl-export-block/output.json | 8 +- .../undecl-export-builtin-as/output.json | 8 +- .../scope/undecl-export-builtin/output.json | 8 +- .../core/scope/undecl-export-if/output.json | 16 ++- .../core/scope/undecl-export/output.json | 8 +- .../core/uncategorised/108/output.json | 40 ++++++- .../core/uncategorised/349/output.json | 8 +- .../core/uncategorised/350/output.json | 8 +- .../core/uncategorised/351/output.json | 8 +- .../core/uncategorised/354/output.json | 8 +- .../core/uncategorised/361/output.json | 8 +- .../core/uncategorised/362/output.json | 8 +- .../core/uncategorised/363/output.json | 8 +- .../core/uncategorised/366/output.json | 16 ++- .../core/uncategorised/367/output.json | 8 +- .../core/uncategorised/368/output.json | 8 +- .../core/uncategorised/369/output.json | 24 +++- .../core/uncategorised/370/output.json | 8 +- .../core/uncategorised/371/output.json | 8 +- .../core/uncategorised/372/output.json | 8 +- .../core/uncategorised/373/output.json | 8 +- .../core/uncategorised/374/output.json | 24 +++- .../core/uncategorised/382/output.json | 8 +- .../core/uncategorised/383/output.json | 8 +- .../core/uncategorised/384/output.json | 8 +- .../core/uncategorised/388/output.json | 8 +- .../core/uncategorised/389/output.json | 8 +- .../core/uncategorised/397/output.json | 8 +- .../core/uncategorised/398/output.json | 8 +- .../core/uncategorised/399/output.json | 8 +- .../core/uncategorised/400/output.json | 8 +- .../core/uncategorised/401/output.json | 8 +- .../core/uncategorised/402/output.json | 8 +- .../core/uncategorised/403/output.json | 8 +- .../core/uncategorised/404/output.json | 8 +- .../core/uncategorised/405/output.json | 8 +- .../core/uncategorised/409/output.json | 8 +- .../core/uncategorised/411/output.json | 8 +- .../core/uncategorised/417/output.json | 8 +- .../core/uncategorised/418/output.json | 8 +- .../core/uncategorised/425/output.json | 8 +- .../core/uncategorised/427/output.json | 8 +- .../core/uncategorised/446/output.json | 16 ++- .../core/uncategorised/447/output.json | 8 +- .../core/uncategorised/448/output.json | 8 +- .../core/uncategorised/449/output.json | 8 +- .../core/uncategorised/454/output.json | 8 +- .../core/uncategorised/455/output.json | 8 +- .../core/uncategorised/456/output.json | 8 +- .../core/uncategorised/457/output.json | 8 +- .../core/uncategorised/459/output.json | 8 +- .../core/uncategorised/460/output.json | 8 +- .../core/uncategorised/461/output.json | 16 ++- .../core/uncategorised/462/output.json | 16 ++- .../core/uncategorised/463/output.json | 16 ++- .../core/uncategorised/464/output.json | 16 ++- .../core/uncategorised/465/output.json | 8 +- .../core/uncategorised/466/output.json | 22 ++-- .../core/uncategorised/467/output.json | 22 ++-- .../core/uncategorised/468/output.json | 12 +- .../core/uncategorised/469/output.json | 12 +- .../core/uncategorised/470/output.json | 12 +- .../core/uncategorised/471/output.json | 12 +- .../core/uncategorised/472/output.json | 12 +- .../core/uncategorised/473/output.json | 12 +- .../core/uncategorised/474/output.json | 12 +- .../core/uncategorised/475/output.json | 12 +- .../core/uncategorised/476/output.json | 12 +- .../core/uncategorised/477/output.json | 12 +- .../core/uncategorised/478/output.json | 12 +- .../core/uncategorised/479/output.json | 12 +- .../core/uncategorised/480/output.json | 12 +- .../core/uncategorised/481/output.json | 12 +- .../core/uncategorised/482/output.json | 12 +- .../core/uncategorised/483/output.json | 12 +- .../core/uncategorised/484/output.json | 12 +- .../core/uncategorised/485/output.json | 12 +- .../core/uncategorised/486/output.json | 22 ++-- .../core/uncategorised/487/output.json | 22 ++-- .../core/uncategorised/488/output.json | 20 ++-- .../core/uncategorised/489/output.json | 20 ++-- .../core/uncategorised/490/output.json | 22 ++-- .../core/uncategorised/491/output.json | 20 ++-- .../core/uncategorised/492/output.json | 22 ++-- .../core/uncategorised/493/output.json | 22 ++-- .../core/uncategorised/494/output.json | 22 ++-- .../core/uncategorised/495/output.json | 12 +- .../core/uncategorised/496/output.json | 12 +- .../core/uncategorised/497/output.json | 12 +- .../core/uncategorised/498/output.json | 12 +- .../core/uncategorised/500/output.json | 12 +- .../core/uncategorised/502/output.json | 22 ++-- .../core/uncategorised/504/output.json | 12 +- .../core/uncategorised/505/output.json | 12 +- .../core/uncategorised/506/output.json | 12 +- .../core/uncategorised/507/output.json | 12 +- .../core/uncategorised/508/output.json | 12 +- .../core/uncategorised/509/output.json | 12 +- .../core/uncategorised/510/output.json | 12 +- .../core/uncategorised/511/output.json | 12 +- .../core/uncategorised/512/output.json | 12 +- .../core/uncategorised/513/output.json | 12 +- .../core/uncategorised/514/output.json | 12 +- .../core/uncategorised/515/output.json | 12 +- .../core/uncategorised/516/output.json | 12 +- .../core/uncategorised/517/output.json | 12 +- .../core/uncategorised/518/output.json | 20 ++-- .../core/uncategorised/519/output.json | 20 ++-- .../core/uncategorised/520/output.json | 20 ++-- .../core/uncategorised/521/output.json | 20 ++-- .../core/uncategorised/522/output.json | 16 ++- .../core/uncategorised/523/output.json | 8 +- .../core/uncategorised/524/output.json | 8 +- .../core/uncategorised/536/output.json | 8 +- .../core/uncategorised/544/output.json | 18 ++- .../core/uncategorised/545/output.json | 14 ++- .../core/uncategorised/550/output.json | 12 +- .../core/uncategorised/552/output.json | 12 +- .../comma-after-rest/output.json | 8 +- .../comma-after-spread-for-in/output.json | 8 +- .../comma-after-spread-nested/output.json | 8 +- .../inner-parens-2/output.json | 8 +- .../inner-parens-array-pattern-2/output.json | 8 +- .../inner-parens-array-pattern-3/output.json | 8 +- .../inner-parens-array-pattern/output.json | 8 +- .../output.json | 8 +- .../inner-parens-object-pattern/output.json | 8 +- .../arrow-functions/inner-parens/output.json | 8 +- .../direct-super-in-object-method/output.json | 16 ++- .../output.json | 8 +- .../output.json | 8 +- .../output.json | 8 +- .../disallow-static-prototype/output.json | 8 +- .../getter-signature/output.json | 8 +- .../malformed-super-expression/output.json | 8 +- .../es2015/class/extends-strict/output.json | 18 ++- .../binding-arguments-module/output.json | 14 ++- .../binding-arguments-strict/output.json | 18 ++- .../destructuring/binding-eval/output.json | 26 +++-- .../destructuring/binding-this/output.json | 14 ++- .../error-operator-for-default/output.json | 16 ++- .../parenthesized-lhs-array/output.json | 18 ++- .../parenthesized-lhs-object/output.json | 24 ++-- .../in-new-expression/output.json | 12 +- .../for-in/bare-initializer/output.json | 8 +- .../for-in/const-initializer/output.json | 8 +- .../es2015/for-in/let-initializer/output.json | 8 +- .../for-in/strict-initializer/output.json | 12 +- .../output.json | 8 +- .../output.json | 14 ++- .../for-of/bare-initializer/output.json | 8 +- .../for-of/invalid-escape-of/output.json | 16 ++- .../invalid-escape-yield/output.json | 16 ++- .../generators/invalid-hanging/output.json | 8 +- .../invalid-escape-seq-const/output.json | 24 +++- .../invalid-escape-seq-export/output.json | 24 +++- .../invalid-escape-seq-if/output.json | 8 +- .../invalid-escape-seq-import/output.json | 24 +++- .../invalid-escape-seq-null/output.json | 8 +- .../invalid-escape-seq-true/output.json | 8 +- .../es2015/let/invalid-escape/output.json | 8 +- .../let-as-identifier-strict-fail/output.json | 12 +- .../let-at-binding-list-fail-1/output.json | 14 ++- .../let-at-binding-list-fail-2/output.json | 14 ++- .../let-at-binding-list-fail-3/output.json | 8 +- .../let-at-binding-list-fail-4/output.json | 8 +- .../let-at-binding-list-fail-5/output.json | 8 +- .../let-at-binding-list-fail-6/output.json | 8 +- .../es2015/let/let-at-catch-block/output.json | 8 +- .../invalid-arrow-function/output.json | 8 +- .../new-invalid-prop/output.json | 8 +- .../output.json | 8 +- .../output.json | 8 +- .../new-target-invalid/output.json | 8 +- .../output.json | 16 ++- .../duplicate-export-default/output.json | 8 +- .../output.json | 8 +- .../output.json | 14 ++- .../output.json | 22 +++- .../output.json | 22 +++- .../output.json | 22 +++- .../output.json | 22 +++- .../output.json | 16 ++- .../output.json | 16 ++- .../output.json | 16 ++- .../output.json | 16 ++- .../output.json | 16 ++- .../output.json | 16 ++- .../output.json | 22 +++- .../output.json | 22 +++- .../output.json | 16 ++- .../output.json | 16 ++- .../output.json | 22 +++- .../output.json | 22 +++- .../output.json | 22 +++- .../output.json | 16 ++- .../output.json | 8 +- .../output.json | 8 +- .../duplicate-named-export/output.json | 24 +++- .../import-invalid-keyword-flow/output.json | 8 +- .../output.json | 8 +- .../import-invalid-keyword-typeof/output.json | 8 +- .../import-invalid-keyword/output.json | 8 +- .../output.json | 18 ++- .../invalid-accessor-generator/output.json | 28 +++-- .../es2015/regex/duplicate-flags/output.json | 8 +- .../reserved-word-strict/output.json | 56 ++++++---- .../shorthand/reserved-word/output.json | 52 ++++++--- .../label-invalid-const/output.json | 8 +- .../label-invalid-func-async/output.json | 8 +- .../label-invalid-func-generator/output.json | 8 +- .../label-invalid-func-strict/output.json | 12 +- .../statements/label-invalid-let/output.json | 8 +- .../es2015/uncategorised/109/output.json | 8 +- .../es2015/uncategorised/123/output.json | 20 ++-- .../es2015/uncategorised/125/output.json | 8 +- .../es2015/uncategorised/126/output.json | 8 +- .../es2015/uncategorised/127/output.json | 8 +- .../es2015/uncategorised/166/output.json | 14 ++- .../es2015/uncategorised/198/output.json | 8 +- .../es2015/uncategorised/200/output.json | 8 +- .../es2015/uncategorised/201/output.json | 8 +- .../es2015/uncategorised/202/output.json | 8 +- .../es2015/uncategorised/204/output.json | 8 +- .../es2015/uncategorised/205/output.json | 8 +- .../es2015/uncategorised/206/output.json | 8 +- .../es2015/uncategorised/208/output.json | 8 +- .../es2015/uncategorised/209/output.json | 8 +- .../es2015/uncategorised/210/output.json | 8 +- .../es2015/uncategorised/211/output.json | 8 +- .../es2015/uncategorised/213/output.json | 8 +- .../es2015/uncategorised/214/output.json | 8 +- .../es2015/uncategorised/215/output.json | 8 +- .../es2015/uncategorised/217/output.json | 12 +- .../es2015/uncategorised/218/output.json | 12 +- .../es2015/uncategorised/219/output.json | 12 +- .../es2015/uncategorised/220/output.json | 8 +- .../es2015/uncategorised/221/output.json | 8 +- .../es2015/uncategorised/222/output.json | 16 ++- .../es2015/uncategorised/223/output.json | 16 ++- .../es2015/uncategorised/224/output.json | 8 +- .../es2015/uncategorised/225/output.json | 8 +- .../es2015/uncategorised/226/output.json | 8 +- .../es2015/uncategorised/227/output.json | 22 ++-- .../es2015/uncategorised/228/output.json | 22 ++-- .../es2015/uncategorised/229/output.json | 8 +- .../es2015/uncategorised/230/output.json | 8 +- .../es2015/uncategorised/231/output.json | 8 +- .../es2015/uncategorised/232/output.json | 8 +- .../es2015/uncategorised/233/output.json | 20 ++-- .../es2015/uncategorised/234/output.json | 20 ++-- .../es2015/uncategorised/235/output.json | 8 +- .../es2015/uncategorised/236/output.json | 8 +- .../es2015/uncategorised/242/output.json | 20 +++- .../es2015/uncategorised/243/output.json | 12 +- .../es2015/uncategorised/244/output.json | 12 +- .../es2015/uncategorised/245/output.json | 12 +- .../es2015/uncategorised/246/output.json | 12 +- .../es2015/uncategorised/247/output.json | 12 +- .../es2015/uncategorised/248/output.json | 12 +- .../es2015/uncategorised/249/output.json | 12 +- .../es2015/uncategorised/251/output.json | 8 +- .../es2015/uncategorised/252/output.json | 16 ++- .../es2015/uncategorised/280/output.json | 18 ++- .../es2015/uncategorised/281/output.json | 24 ++-- .../es2015/uncategorised/284/output.json | 8 +- .../es2015/uncategorised/289/output.json | 22 ++-- .../es2015/uncategorised/290/output.json | 12 +- .../es2015/uncategorised/291/output.json | 16 ++- .../es2015/uncategorised/296/output.json | 12 +- .../es2015/uncategorised/297/output.json | 12 +- .../es2015/uncategorised/298/output.json | 8 +- .../es2015/uncategorised/324/output.json | 8 +- .../es2015/uncategorised/325/output.json | 8 +- .../es2015/uncategorised/328/output.json | 8 +- .../es2015/uncategorised/329/output.json | 8 +- .../es2015/uncategorised/332/output.json | 12 +- .../es2015/uncategorised/334/output.json | 8 +- .../es2015/uncategorised/339/output.json | 8 +- .../es2015/uncategorised/344/output.json | 16 ++- .../es2015/uncategorised/347/output.json | 8 +- .../es2015/uncategorised/348/output.json | 18 ++- .../es2015/uncategorised/349/output.json | 18 ++- .../es2015/uncategorised/357/output.json | 8 +- .../es2015/uncategorised/359/output.json | 8 +- .../es2015/uncategorised/361/output.json | 8 +- .../es2015/uncategorised/363/output.json | 8 +- .../es2015/uncategorised/365/output.json | 8 +- .../es2015/uncategorised/367/output.json | 8 +- .../es2015/uncategorised/368/output.json | 8 +- .../es2015/uncategorised/369/output.json | 8 +- .../es2015/uncategorised/37/output.json | 12 +- .../es2015/uncategorised/370/output.json | 8 +- .../es2015/uncategorised/371/output.json | 8 +- .../es2015/uncategorised/372/output.json | 14 ++- .../es2015/uncategorised/373/output.json | 14 ++- .../es2015/uncategorised/374/output.json | 14 ++- .../es2015/uncategorised/375/output.json | 14 ++- .../es2015/uncategorised/376/output.json | 8 +- .../es2015/uncategorised/377/output.json | 8 +- .../es2015/uncategorised/378/output.json | 8 +- .../es2015/uncategorised/379/output.json | 8 +- .../es2015/uncategorised/395/output.json | 12 +- .../output.json | 8 +- .../output.json | 8 +- .../function-name-strict-body/output.json | 12 +- .../yield/function-name-strict/output.json | 12 +- .../es2015/yield/in-global-scope/output.json | 8 +- .../yield/in-plain-function/output.json | 8 +- .../output.json | 8 +- .../output.json | 8 +- .../output.json | 8 +- .../output.json | 8 +- .../output.json | 16 ++- .../output.json | 8 +- .../output.json | 8 +- .../output.json | 8 +- .../parameter-default-strict/output.json | 12 +- .../output.json | 16 ++- .../output.json | 16 ++- .../output.json | 16 ++- .../output.json | 18 ++- .../parameter-name-generator/output.json | 8 +- .../parameter-name-strict-body/output.json | 12 +- .../yield/parameter-name-strict/output.json | 12 +- .../output.json | 16 ++- .../exponentiation-operator/10/output.json | 8 +- .../exponentiation-operator/11/output.json | 8 +- .../exponentiation-operator/12/output.json | 16 ++- .../exponentiation-operator/15/output.json | 8 +- .../exponentiation-operator/16/output.json | 8 +- .../array-pattern-default/output.json | 12 +- .../array-pattern/output.json | 12 +- .../arrow-function/output.json | 12 +- .../async-arrow-function/output.json | 12 +- .../async-function/output.json | 12 +- .../simple-parameter-list/default/output.json | 12 +- .../generator-function/output.json | 12 +- .../generator-method/output.json | 12 +- .../simple-parameter-list/method/output.json | 12 +- .../object-pattern-default/output.json | 24 ++-- .../object-pattern/output.json | 24 ++-- .../simple-parameter-list/rest/output.json | 12 +- .../output.json | 8 +- .../output.json | 8 +- .../output.json | 8 +- .../output.json | 8 +- .../parenthesized-binding-pattern/output.json | 8 +- .../parenthesized-rest-array/output.json | 8 +- .../parenthesized-rest-object/output.json | 8 +- .../es2017/async-functions/2/output.json | 8 +- .../es2017/async-functions/9/output.json | 7 +- .../output.json | 7 +- .../output.json | 8 +- .../output.json | 16 ++- .../output.json | 8 +- .../output.json | 8 +- .../output.json | 8 +- .../output.json | 7 +- .../output.json | 15 ++- .../output.json | 8 +- .../output.json | 8 +- .../output.json | 15 ++- .../await-inside-parameters/output.json | 8 +- .../output.json | 7 +- .../invalid-escape-await/output.json | 16 ++- .../output.json | 16 ++- .../invalid-escape-sequence-arrow/output.json | 15 ++- .../invalid-inside-loop/output.json | 8 +- .../invalid-parens-async-func/output.json | 8 +- .../output.json | 18 ++- .../newline-before-arrow/output.json | 10 +- .../no-constructor/output.json | 8 +- .../output.json | 8 +- .../trailing-function-commas/5/output.json | 14 ++- .../es2018/object-rest-spread/11/output.json | 22 +++- .../es2018/object-rest-spread/12/output.json | 22 +++- .../es2018/object-rest-spread/13/output.json | 22 +++- .../es2018/object-rest-spread/14/output.json | 22 +++- .../es2018/object-rest-spread/15/output.json | 22 +++- .../es2018/object-rest-spread/18/output.json | 16 ++- .../es2018/object-rest-spread/21/output.json | 16 ++- .../es2018/object-rest-spread/24/output.json | 16 ++- .../es2018/object-rest-spread/8/output.json | 28 +++-- .../es2020/bigint/invalid-decimal/output.json | 8 +- .../es2020/bigint/invalid-e/output.json | 8 +- .../invalid-non-octal-decimal-int/output.json | 8 +- .../bigint/invalid-octal-legacy/output.json | 8 +- .../direct-calls-only/output.json | 8 +- .../invalid-arguments-spread/output.json | 8 +- .../dynamic-import/invalid-new/output.json | 8 +- .../invalid-trailing-comma/output.json | 14 ++- .../dynamic-import/multiple-args/output.json | 8 +- .../es2020/dynamic-import/no-args/output.json | 8 +- .../import-meta/error-in-script/output.json | 8 +- .../no-other-prop-names/output.json | 8 +- .../import-meta/not-assignable/output.json | 8 +- .../class-contructor-call/output.json | 12 +- .../optional-constructor/output.json | 8 +- .../optional-super-property-class/output.json | 10 +- .../optional-super-property/output.json | 10 +- .../output.json | 10 +- .../numeric-separator/invalid-0/output.json | 8 +- .../numeric-separator/invalid-1/output.json | 8 +- .../numeric-separator/invalid-10/output.json | 8 +- .../numeric-separator/invalid-100/output.json | 8 +- .../numeric-separator/invalid-101/output.json | 8 +- .../numeric-separator/invalid-102/output.json | 16 ++- .../numeric-separator/invalid-103/output.json | 16 ++- .../numeric-separator/invalid-104/output.json | 8 +- .../numeric-separator/invalid-105/output.json | 8 +- .../numeric-separator/invalid-106/output.json | 8 +- .../numeric-separator/invalid-107/output.json | 8 +- .../numeric-separator/invalid-108/output.json | 8 +- .../numeric-separator/invalid-109/output.json | 8 +- .../numeric-separator/invalid-11/output.json | 8 +- .../numeric-separator/invalid-110/output.json | 8 +- .../numeric-separator/invalid-111/output.json | 8 +- .../numeric-separator/invalid-112/output.json | 8 +- .../numeric-separator/invalid-113/output.json | 24 +++- .../numeric-separator/invalid-114/output.json | 24 +++- .../numeric-separator/invalid-115/output.json | 16 ++- .../numeric-separator/invalid-116/output.json | 8 +- .../numeric-separator/invalid-117/output.json | 8 +- .../numeric-separator/invalid-118/output.json | 16 ++- .../numeric-separator/invalid-119/output.json | 8 +- .../numeric-separator/invalid-12/output.json | 8 +- .../numeric-separator/invalid-120/output.json | 16 ++- .../numeric-separator/invalid-121/output.json | 8 +- .../numeric-separator/invalid-122/output.json | 8 +- .../numeric-separator/invalid-123/output.json | 16 ++- .../numeric-separator/invalid-124/output.json | 8 +- .../numeric-separator/invalid-125/output.json | 8 +- .../numeric-separator/invalid-126/output.json | 16 ++- .../numeric-separator/invalid-127/output.json | 16 ++- .../numeric-separator/invalid-128/output.json | 8 +- .../numeric-separator/invalid-129/output.json | 8 +- .../numeric-separator/invalid-13/output.json | 24 +++- .../numeric-separator/invalid-130/output.json | 8 +- .../numeric-separator/invalid-131/output.json | 8 +- .../numeric-separator/invalid-132/output.json | 8 +- .../numeric-separator/invalid-133/output.json | 8 +- .../numeric-separator/invalid-134/output.json | 8 +- .../numeric-separator/invalid-135/output.json | 8 +- .../numeric-separator/invalid-136/output.json | 8 +- .../numeric-separator/invalid-137/output.json | 24 +++- .../numeric-separator/invalid-138/output.json | 24 +++- .../numeric-separator/invalid-139/output.json | 16 ++- .../numeric-separator/invalid-14/output.json | 24 +++- .../numeric-separator/invalid-140/output.json | 8 +- .../numeric-separator/invalid-141/output.json | 8 +- .../numeric-separator/invalid-142/output.json | 16 ++- .../numeric-separator/invalid-143/output.json | 8 +- .../numeric-separator/invalid-144/output.json | 16 ++- .../numeric-separator/invalid-145/output.json | 8 +- .../numeric-separator/invalid-146/output.json | 8 +- .../numeric-separator/invalid-147/output.json | 16 ++- .../numeric-separator/invalid-15/output.json | 16 ++- .../numeric-separator/invalid-16/output.json | 8 +- .../numeric-separator/invalid-17/output.json | 8 +- .../numeric-separator/invalid-18/output.json | 16 ++- .../numeric-separator/invalid-19/output.json | 8 +- .../numeric-separator/invalid-2/output.json | 16 ++- .../numeric-separator/invalid-20/output.json | 16 ++- .../numeric-separator/invalid-21/output.json | 8 +- .../numeric-separator/invalid-22/output.json | 8 +- .../numeric-separator/invalid-23/output.json | 16 ++- .../numeric-separator/invalid-25/output.json | 16 ++- .../numeric-separator/invalid-26/output.json | 8 +- .../numeric-separator/invalid-28/output.json | 8 +- .../numeric-separator/invalid-29/output.json | 8 +- .../numeric-separator/invalid-3/output.json | 16 ++- .../numeric-separator/invalid-30/output.json | 16 ++- .../numeric-separator/invalid-31/output.json | 16 ++- .../numeric-separator/invalid-32/output.json | 8 +- .../numeric-separator/invalid-33/output.json | 8 +- .../numeric-separator/invalid-34/output.json | 8 +- .../numeric-separator/invalid-35/output.json | 8 +- .../numeric-separator/invalid-36/output.json | 8 +- .../numeric-separator/invalid-37/output.json | 8 +- .../numeric-separator/invalid-38/output.json | 8 +- .../numeric-separator/invalid-39/output.json | 8 +- .../numeric-separator/invalid-4/output.json | 8 +- .../numeric-separator/invalid-40/output.json | 8 +- .../numeric-separator/invalid-41/output.json | 24 +++- .../numeric-separator/invalid-42/output.json | 24 +++- .../numeric-separator/invalid-43/output.json | 16 ++- .../numeric-separator/invalid-44/output.json | 8 +- .../numeric-separator/invalid-45/output.json | 8 +- .../numeric-separator/invalid-46/output.json | 16 ++- .../numeric-separator/invalid-47/output.json | 8 +- .../numeric-separator/invalid-48/output.json | 16 ++- .../numeric-separator/invalid-49/output.json | 8 +- .../numeric-separator/invalid-5/output.json | 8 +- .../numeric-separator/invalid-50/output.json | 8 +- .../numeric-separator/invalid-51/output.json | 16 ++- .../numeric-separator/invalid-52/output.json | 8 +- .../numeric-separator/invalid-53/output.json | 8 +- .../numeric-separator/invalid-54/output.json | 16 ++- .../numeric-separator/invalid-55/output.json | 16 ++- .../numeric-separator/invalid-56/output.json | 8 +- .../numeric-separator/invalid-57/output.json | 8 +- .../numeric-separator/invalid-58/output.json | 8 +- .../numeric-separator/invalid-59/output.json | 8 +- .../numeric-separator/invalid-6/output.json | 8 +- .../numeric-separator/invalid-60/output.json | 8 +- .../numeric-separator/invalid-61/output.json | 8 +- .../numeric-separator/invalid-62/output.json | 8 +- .../numeric-separator/invalid-63/output.json | 8 +- .../numeric-separator/invalid-64/output.json | 8 +- .../numeric-separator/invalid-65/output.json | 24 +++- .../numeric-separator/invalid-66/output.json | 24 +++- .../numeric-separator/invalid-67/output.json | 16 ++- .../numeric-separator/invalid-68/output.json | 8 +- .../numeric-separator/invalid-69/output.json | 8 +- .../numeric-separator/invalid-7/output.json | 8 +- .../numeric-separator/invalid-70/output.json | 16 ++- .../numeric-separator/invalid-71/output.json | 8 +- .../numeric-separator/invalid-72/output.json | 16 ++- .../numeric-separator/invalid-73/output.json | 8 +- .../numeric-separator/invalid-74/output.json | 8 +- .../numeric-separator/invalid-75/output.json | 16 ++- .../numeric-separator/invalid-76/output.json | 8 +- .../numeric-separator/invalid-77/output.json | 8 +- .../numeric-separator/invalid-78/output.json | 16 ++- .../numeric-separator/invalid-79/output.json | 16 ++- .../numeric-separator/invalid-8/output.json | 8 +- .../numeric-separator/invalid-80/output.json | 8 +- .../numeric-separator/invalid-81/output.json | 8 +- .../numeric-separator/invalid-82/output.json | 8 +- .../numeric-separator/invalid-83/output.json | 8 +- .../numeric-separator/invalid-84/output.json | 8 +- .../numeric-separator/invalid-85/output.json | 8 +- .../numeric-separator/invalid-86/output.json | 8 +- .../numeric-separator/invalid-87/output.json | 8 +- .../numeric-separator/invalid-88/output.json | 8 +- .../numeric-separator/invalid-89/output.json | 24 +++- .../numeric-separator/invalid-9/output.json | 8 +- .../numeric-separator/invalid-90/output.json | 24 +++- .../numeric-separator/invalid-91/output.json | 16 ++- .../numeric-separator/invalid-92/output.json | 8 +- .../numeric-separator/invalid-93/output.json | 8 +- .../numeric-separator/invalid-94/output.json | 16 ++- .../numeric-separator/invalid-95/output.json | 8 +- .../numeric-separator/invalid-96/output.json | 16 ++- .../numeric-separator/invalid-97/output.json | 8 +- .../numeric-separator/invalid-98/output.json | 8 +- .../numeric-separator/invalid-99/output.json | 16 ++- .../numeric-separator/invalid-hex/output.json | 12 +- .../invalid-leading-zero/output.json | 8 +- .../invalid-legacy-octal-literal/output.json | 8 +- .../invalid-non-octal-decimal-int/output.json | 16 ++- .../invalid-unicode-2/output.json | 12 +- .../invalid-unicode/output.json | 12 +- .../dupe-param/output.json | 12 +- .../invalid-dup-param/output.json | 8 +- .../dupe-param-1/output.json | 12 +- .../dupe-param-2/output.json | 12 +- .../dupe-param-3/output.json | 18 ++- .../output.json | 8 +- .../invalid-duplicated-params/output.json | 8 +- .../invalid-param-strict-mode/output.json | 12 +- .../output.json | 8 +- .../output.json | 8 +- .../output.json | 12 +- .../output.json | 8 +- .../output.json | 12 +- .../invalid-lhs-01/output.json | 16 ++- .../invalid-lhs-02/output.json | 16 ++- .../invalid-pattern-with-method/output.json | 16 ++- .../invalid-group-assignment/output.json | 36 ++++-- .../invalid-export-named-default/output.json | 16 ++- .../invalid-const-init/output.json | 8 +- .../invalid-let-init/output.json | 8 +- .../invalid-lhs-init/output.json | 8 +- .../invalid-var-init/output.json | 8 +- .../unexpected-number/output.json | 24 +++- .../output.json | 16 ++- .../invalid_expression_await/output.json | 8 +- .../invalid_var_await/output.json | 8 +- .../output.json | 8 +- .../invalid_const_forin/output.json | 8 +- .../invalid_let_forin/output.json | 8 +- .../invalid-new-target/output.json | 8 +- .../unknown-property/output.json | 8 +- .../output.json | 20 ++-- .../output.json | 18 ++- .../invalid-proto-identifiers/output.json | 18 ++- .../output.json | 18 ++- .../invalid-proto-literals/output.json | 18 ++- .../output.json | 20 ++-- .../output.json | 8 +- .../invalid-escape/output.json | 8 +- .../invalid-yield-expression/output.json | 8 +- .../output.json | 8 +- .../output.json | 16 ++- .../output.json | 16 ++- .../invalid-yield-generator-catch/output.json | 8 +- .../output.json | 8 +- .../output.json | 8 +- .../output.json | 16 ++- .../output.json | 16 ++- .../output.json | 16 ++- .../output.json | 8 +- .../output.json | 8 +- .../output.json | 8 +- .../invalid-yield-generator-rest/output.json | 8 +- .../output.json | 12 +- .../output.json | 12 +- .../output.json | 8 +- .../output.json | 20 ++-- .../output.json | 12 +- .../output.json | 12 +- .../output.json | 12 +- .../output.json | 12 +- .../output.json | 12 +- .../output.json | 12 +- .../output.json | 20 ++-- .../output.json | 12 +- .../output.json | 12 +- .../output.json | 12 +- .../output.json | 12 +- .../yield-generator-arrow-default/output.json | 8 +- .../migrated_0012/output.json | 8 +- .../invalid-syntax/GH-1106-00/output.json | 12 +- .../invalid-syntax/GH-1106-01/output.json | 12 +- .../invalid-syntax/GH-1106-02/output.json | 12 +- .../invalid-syntax/GH-1106-03/output.json | 12 +- .../invalid-syntax/GH-1106-04/output.json | 12 +- .../invalid-syntax/GH-1106-05/output.json | 12 +- .../invalid-syntax/GH-1106-06/output.json | 12 +- .../invalid-syntax/GH-1106-07/output.json | 12 +- .../invalid-syntax/migrated_0004/output.json | 8 +- .../invalid-syntax/migrated_0005/output.json | 8 +- .../invalid-syntax/migrated_0006/output.json | 8 +- .../invalid-syntax/migrated_0009/output.json | 8 +- .../invalid-syntax/migrated_0012/output.json | 8 +- .../invalid-syntax/migrated_0013/output.json | 8 +- .../invalid-syntax/migrated_0014/output.json | 8 +- .../invalid-syntax/migrated_0015/output.json | 8 +- .../invalid-syntax/migrated_0017/output.json | 8 +- .../invalid-syntax/migrated_0019/output.json | 8 +- .../invalid-syntax/migrated_0020/output.json | 8 +- .../invalid-syntax/migrated_0021/output.json | 8 +- .../invalid-syntax/migrated_0022/output.json | 8 +- .../invalid-syntax/migrated_0024/output.json | 8 +- .../invalid-syntax/migrated_0025/output.json | 8 +- .../invalid-syntax/migrated_0026/output.json | 8 +- .../invalid-syntax/migrated_0027/output.json | 8 +- .../invalid-syntax/migrated_0028/output.json | 8 +- .../invalid-syntax/migrated_0032/output.json | 8 +- .../invalid-syntax/migrated_0033/output.json | 8 +- .../invalid-syntax/migrated_0034/output.json | 8 +- .../invalid-syntax/migrated_0036/output.json | 8 +- .../invalid-syntax/migrated_0037/output.json | 8 +- .../invalid-syntax/migrated_0041/output.json | 16 ++- .../invalid-syntax/migrated_0042/output.json | 16 ++- .../invalid-syntax/migrated_0043/output.json | 24 +++- .../invalid-syntax/migrated_0044/output.json | 48 +++++++- .../invalid-syntax/migrated_0045/output.json | 8 +- .../invalid-syntax/migrated_0046/output.json | 8 +- .../invalid-syntax/migrated_0047/output.json | 24 +++- .../invalid-syntax/migrated_0049/output.json | 8 +- .../invalid-syntax/migrated_0050/output.json | 8 +- .../invalid-syntax/migrated_0051/output.json | 8 +- .../invalid-syntax/migrated_0052/output.json | 8 +- .../invalid-syntax/migrated_0053/output.json | 8 +- .../invalid-syntax/migrated_0054/output.json | 8 +- .../invalid-syntax/migrated_0055/output.json | 8 +- .../invalid-syntax/migrated_0056/output.json | 24 +++- .../invalid-syntax/migrated_0064/output.json | 8 +- .../invalid-syntax/migrated_0066/output.json | 8 +- .../invalid-syntax/migrated_0067/output.json | 8 +- .../invalid-syntax/migrated_0071/output.json | 8 +- .../invalid-syntax/migrated_0072/output.json | 8 +- .../invalid-syntax/migrated_0075/output.json | 18 ++- .../invalid-syntax/migrated_0087/output.json | 20 +++- .../invalid-syntax/migrated_0088/output.json | 12 +- .../invalid-syntax/migrated_0089/output.json | 12 +- .../invalid-syntax/migrated_0090/output.json | 12 +- .../invalid-syntax/migrated_0091/output.json | 12 +- .../invalid-syntax/migrated_0092/output.json | 8 +- .../invalid-syntax/migrated_0093/output.json | 12 +- .../invalid-syntax/migrated_0094/output.json | 12 +- .../invalid-syntax/migrated_0098/output.json | 8 +- .../invalid-syntax/migrated_0099/output.json | 16 ++- .../invalid-syntax/migrated_0100/output.json | 12 +- .../invalid-syntax/migrated_0101/output.json | 12 +- .../invalid-syntax/migrated_0112/output.json | 8 +- .../invalid-syntax/migrated_0115/output.json | 16 ++- .../invalid-syntax/migrated_0116/output.json | 8 +- .../invalid-syntax/migrated_0118/output.json | 8 +- .../invalid-syntax/migrated_0125/output.json | 8 +- .../invalid-syntax/migrated_0126/output.json | 8 +- .../invalid-syntax/migrated_0133/output.json | 8 +- .../invalid-syntax/migrated_0137/output.json | 8 +- .../invalid-syntax/migrated_0138/output.json | 8 +- .../invalid-syntax/migrated_0139/output.json | 8 +- .../invalid-syntax/migrated_0140/output.json | 8 +- .../invalid-syntax/migrated_0141/output.json | 8 +- .../invalid-syntax/migrated_0142/output.json | 8 +- .../invalid-syntax/migrated_0143/output.json | 8 +- .../invalid-syntax/migrated_0162/output.json | 8 +- .../invalid-syntax/migrated_0163/output.json | 8 +- .../invalid-syntax/migrated_0164/output.json | 8 +- .../invalid-syntax/migrated_0165/output.json | 8 +- .../invalid-syntax/migrated_0166/output.json | 8 +- .../invalid-syntax/migrated_0167/output.json | 8 +- .../invalid-syntax/migrated_0171/output.json | 8 +- .../invalid-syntax/migrated_0172/output.json | 8 +- .../invalid-syntax/migrated_0173/output.json | 8 +- .../invalid-syntax/migrated_0174/output.json | 8 +- .../invalid-syntax/migrated_0176/output.json | 8 +- .../invalid-syntax/migrated_0177/output.json | 8 +- .../invalid-syntax/migrated_0178/output.json | 16 ++- .../invalid-syntax/migrated_0179/output.json | 16 ++- .../invalid-syntax/migrated_0180/output.json | 16 ++- .../invalid-syntax/migrated_0181/output.json | 16 ++- .../invalid-syntax/migrated_0182/output.json | 8 +- .../invalid-syntax/migrated_0183/output.json | 22 ++-- .../invalid-syntax/migrated_0184/output.json | 22 ++-- .../invalid-syntax/migrated_0185/output.json | 12 +- .../invalid-syntax/migrated_0186/output.json | 12 +- .../invalid-syntax/migrated_0187/output.json | 12 +- .../invalid-syntax/migrated_0188/output.json | 12 +- .../invalid-syntax/migrated_0189/output.json | 12 +- .../invalid-syntax/migrated_0190/output.json | 12 +- .../invalid-syntax/migrated_0191/output.json | 12 +- .../invalid-syntax/migrated_0192/output.json | 12 +- .../invalid-syntax/migrated_0193/output.json | 12 +- .../invalid-syntax/migrated_0194/output.json | 12 +- .../invalid-syntax/migrated_0195/output.json | 12 +- .../invalid-syntax/migrated_0196/output.json | 12 +- .../invalid-syntax/migrated_0197/output.json | 12 +- .../invalid-syntax/migrated_0198/output.json | 12 +- .../invalid-syntax/migrated_0199/output.json | 12 +- .../invalid-syntax/migrated_0200/output.json | 12 +- .../invalid-syntax/migrated_0201/output.json | 12 +- .../invalid-syntax/migrated_0202/output.json | 12 +- .../invalid-syntax/migrated_0203/output.json | 22 ++-- .../invalid-syntax/migrated_0204/output.json | 22 ++-- .../invalid-syntax/migrated_0205/output.json | 20 ++-- .../invalid-syntax/migrated_0206/output.json | 20 ++-- .../invalid-syntax/migrated_0207/output.json | 22 ++-- .../invalid-syntax/migrated_0208/output.json | 20 ++-- .../invalid-syntax/migrated_0209/output.json | 22 ++-- .../invalid-syntax/migrated_0210/output.json | 22 ++-- .../invalid-syntax/migrated_0211/output.json | 22 ++-- .../invalid-syntax/migrated_0212/output.json | 12 +- .../invalid-syntax/migrated_0213/output.json | 12 +- .../invalid-syntax/migrated_0214/output.json | 12 +- .../invalid-syntax/migrated_0215/output.json | 12 +- .../invalid-syntax/migrated_0216/output.json | 8 +- .../invalid-syntax/migrated_0217/output.json | 8 +- .../invalid-syntax/migrated_0218/output.json | 12 +- .../invalid-syntax/migrated_0219/output.json | 22 ++-- .../invalid-syntax/migrated_0220/output.json | 22 ++-- .../invalid-syntax/migrated_0221/output.json | 8 +- .../invalid-syntax/migrated_0222/output.json | 16 ++- .../invalid-syntax/migrated_0223/output.json | 16 ++- .../invalid-syntax/migrated_0224/output.json | 12 +- .../invalid-syntax/migrated_0225/output.json | 12 +- .../invalid-syntax/migrated_0226/output.json | 12 +- .../invalid-syntax/migrated_0227/output.json | 12 +- .../invalid-syntax/migrated_0228/output.json | 12 +- .../invalid-syntax/migrated_0229/output.json | 12 +- .../invalid-syntax/migrated_0230/output.json | 12 +- .../invalid-syntax/migrated_0231/output.json | 12 +- .../invalid-syntax/migrated_0232/output.json | 12 +- .../invalid-syntax/migrated_0233/output.json | 12 +- .../invalid-syntax/migrated_0234/output.json | 12 +- .../invalid-syntax/migrated_0235/output.json | 12 +- .../invalid-syntax/migrated_0236/output.json | 12 +- .../invalid-syntax/migrated_0239/output.json | 12 +- .../invalid-syntax/migrated_0240/output.json | 12 +- .../invalid-syntax/migrated_0241/output.json | 12 +- .../invalid-syntax/migrated_0242/output.json | 12 +- .../invalid-syntax/migrated_0243/output.json | 12 +- .../invalid-syntax/migrated_0244/output.json | 20 ++-- .../invalid-syntax/migrated_0245/output.json | 20 ++-- .../invalid-syntax/migrated_0246/output.json | 20 ++-- .../invalid-syntax/migrated_0247/output.json | 20 ++-- .../invalid-syntax/migrated_0248/output.json | 8 +- .../invalid-syntax/migrated_0249/output.json | 12 +- .../invalid-syntax/migrated_0250/output.json | 8 +- .../invalid-syntax/migrated_0257/output.json | 16 ++- .../invalid-syntax/migrated_0270/output.json | 8 +- .../invalid-syntax/migrated_0271/output.json | 8 +- .../invalid-syntax/migrated_0272/output.json | 8 +- .../invalid-syntax/migrated_0273/output.json | 8 +- .../invalid-syntax/migrated_0274/output.json | 8 +- .../invalid-syntax/migrated_0277/output.json | 8 +- .../invalid-syntax/migrated_0278/output.json | 8 +- .../invalid-setter-rest/output.json | 8 +- .../migrated_0002/output.json | 8 +- .../migrated_0003/output.json | 8 +- .../migrated_0004/output.json | 8 +- .../migrated_0005/output.json | 8 +- .../complex-pattern-requires-init/output.json | 8 +- .../object-method/invalid-setter/output.json | 8 +- .../typescript/getter-setter/output.json | 16 ++- .../failure-name-constructor/output.json | 8 +- .../failure-spaces/output.json | 8 +- .../instance-field-instance-field/output.json | 8 +- .../instance-field-instance-get/output.json | 8 +- .../output.json | 8 +- .../instance-field-instance-set/output.json | 8 +- .../instance-field-static-field/output.json | 8 +- .../instance-field-static-get/output.json | 8 +- .../instance-field-static-method/output.json | 8 +- .../instance-field-static-set/output.json | 8 +- .../instance-get-instance-field/output.json | 8 +- .../instance-get-instance-get/output.json | 8 +- .../instance-get-instance-method/output.json | 8 +- .../instance-get-static-field/output.json | 8 +- .../instance-get-static-get/output.json | 8 +- .../instance-get-static-method/output.json | 8 +- .../instance-get-static-set/output.json | 8 +- .../output.json | 8 +- .../instance-method-instance-get/output.json | 8 +- .../output.json | 8 +- .../instance-method-instance-set/output.json | 8 +- .../instance-method-static-field/output.json | 8 +- .../instance-method-static-get/output.json | 8 +- .../instance-method-static-method/output.json | 8 +- .../instance-method-static-set/output.json | 8 +- .../instance-set-instance-field/output.json | 8 +- .../instance-set-instance-method/output.json | 8 +- .../instance-set-instance-set/output.json | 8 +- .../instance-set-static-field/output.json | 8 +- .../instance-set-static-get/output.json | 8 +- .../instance-set-static-method/output.json | 8 +- .../instance-set-static-set/output.json | 8 +- .../static-field-instance-field/output.json | 8 +- .../static-field-instance-get/output.json | 8 +- .../static-field-instance-method/output.json | 8 +- .../static-field-instance-set/output.json | 8 +- .../static-field-static-field/output.json | 8 +- .../static-field-static-get/output.json | 8 +- .../static-field-static-method/output.json | 8 +- .../static-field-static-set/output.json | 8 +- .../static-get-instance-field/output.json | 8 +- .../static-get-instance-get/output.json | 8 +- .../static-get-instance-method/output.json | 8 +- .../static-get-instance-set/output.json | 8 +- .../static-get-static-field/output.json | 8 +- .../static-get-static-get/output.json | 8 +- .../static-get-static-method/output.json | 8 +- .../static-method-instance-field/output.json | 8 +- .../static-method-instance-get/output.json | 8 +- .../static-method-instance-method/output.json | 8 +- .../static-method-instance-set/output.json | 8 +- .../static-method-static-field/output.json | 8 +- .../static-method-static-get/output.json | 8 +- .../static-method-static-method/output.json | 8 +- .../static-method-static-set/output.json | 8 +- .../static-set-instance-field/output.json | 8 +- .../static-set-instance-get/output.json | 8 +- .../static-set-instance-method/output.json | 8 +- .../static-set-instance-set/output.json | 8 +- .../static-set-static-field/output.json | 8 +- .../static-set-static-method/output.json | 8 +- .../static-set-static-set/output.json | 8 +- .../output.json | 10 +- .../output.json | 12 +- .../failure-name-constructor/output.json | 8 +- .../failure-spaces/output.json | 8 +- .../output.json | 8 +- .../invalid-destructuring/output.json | 8 +- .../invalid-object-method/output.json | 18 ++- .../invalid-ts-type-literal/output.json | 8 +- .../super-call/output.json | 8 +- .../super-private-member-access/output.json | 12 +- .../undeclared-nested/output.json | 12 +- .../undeclared-top-level/output.json | 12 +- .../arguments-in-arrow-function/output.json | 8 +- .../output.json | 8 +- .../class-properties/arguments/output.json | 8 +- .../output.json | 8 +- .../new-target-invalid/output.json | 8 +- .../class-properties/no-ctor-2/output.json | 8 +- .../class-properties/no-ctor/output.json | 8 +- .../no-static-prototype-2/output.json | 8 +- .../no-static-prototype/output.json | 8 +- .../output.json | 8 +- .../class-properties/super-call/output.json | 8 +- .../super-inside-function/output.json | 12 +- .../output.json | 24 ++-- .../await-binding-in-static-block/output.json | 104 +++++++++++++++--- .../invalid-arguments/output.json | 8 +- .../invalid-await/output.json | 8 +- .../invalid-break/output.json | 8 +- .../invalid-continue/output.json | 10 +- .../invalid-decorators/output.json | 8 +- .../invalid-legacy-decorators/output.json | 8 +- .../invalid-legacy-octal/output.json | 8 +- .../invalid-return/output.json | 8 +- .../invalid-super-call/output.json | 8 +- .../invalid-yield/output.json | 16 ++- .../decimal/invalid-e/output.json | 8 +- .../invalid-non-octal-decimal-int/output.json | 8 +- .../decimal/invalid-octal-legacy/output.json | 8 +- .../output.json | 8 +- .../no-class-method-parameter/output.json | 8 +- .../no-constructor-decorators/output.json | 8 +- .../no-export-decorators-on-class/output.json | 8 +- .../no-function-parameters/output.json | 8 +- .../no-object-method-parameters/output.json | 8 +- .../no-object-methods/output.json | 8 +- .../no-constructor-decorators/output.json | 8 +- .../invalid-lone-import/output.json | 8 +- .../output.json | 8 +- .../output.json | 8 +- .../incorrect-arity/output.json | 16 ++- .../invalid-escaped-assert/output.json | 16 ++- .../invalid-export-without-from/output.json | 16 ++- .../output.json | 8 +- .../output.json | 16 ++- .../output.json | 8 +- .../string-literal/output.json | 16 ++- .../output.json | 8 +- .../output.json | 8 +- .../output.json | 8 +- .../output.json | 8 +- .../output.json | 8 +- .../import-with-statement/output.json | 8 +- .../incorrect-arity/output.json | 16 ++- .../output.json | 8 +- .../output.json | 8 +- .../output.json | 8 +- .../output.json | 8 +- .../output.json | 8 +- .../output.json | 8 +- .../output.json | 8 +- .../output.json | 8 +- .../output.json | 8 +- .../output.json | 8 +- .../output.json | 8 +- .../output.json | 16 ++- .../in-SuperCall/output.json | 20 +++- .../partial-application/in-new/output.json | 16 ++- .../proposal-fsharp-ban-await-f/output.json | 8 +- .../output.json | 16 ++- .../output.json | 18 ++- .../output.json | 16 ++- .../output.json | 16 ++- .../output.json | 16 ++- .../output.json | 16 ++- .../output.json | 16 ++- .../output.json | 18 ++- .../output.json | 18 ++- .../output.json | 12 +- .../output.json | 8 +- .../output.json | 8 +- .../output.json | 8 +- .../output.json | 16 ++- .../output.json | 16 ++- .../output.json | 16 ++- .../output.json | 16 ++- .../output.json | 16 ++- .../output.json | 16 ++- .../output.json | 16 ++- .../output.json | 16 ++- .../output.json | 20 +++- .../output.json | 16 ++- .../output.json | 16 ++- .../output.json | 8 +- .../output.json | 8 +- .../private-in/private-expression/output.json | 8 +- .../private-in-parenthesized/output.json | 16 ++- .../private-in-without-field/output.json | 8 +- .../invalid-record-method/output.json | 40 ++++++- .../invalid-record-proto/output.json | 8 +- .../invalid-tuple-holes/output.json | 8 +- .../1/output.json | 8 +- .../10/output.json | 8 +- .../11/output.json | 8 +- .../12/output.json | 8 +- .../13/output.json | 8 +- .../14/output.json | 8 +- .../15/output.json | 8 +- .../16/output.json | 8 +- .../17/output.json | 8 +- .../18/output.json | 8 +- .../19/output.json | 8 +- .../2/output.json | 8 +- .../20/output.json | 8 +- .../21/output.json | 8 +- .../22/output.json | 8 +- .../23/output.json | 8 +- .../24/output.json | 8 +- .../25/output.json | 8 +- .../26/output.json | 8 +- .../27/output.json | 8 +- .../28/output.json | 8 +- .../29/output.json | 8 +- .../3/output.json | 8 +- .../30/output.json | 8 +- .../31/output.json | 8 +- .../32/output.json | 8 +- .../33/output.json | 8 +- .../34/output.json | 8 +- .../35/output.json | 8 +- .../36/output.json | 8 +- .../37/output.json | 8 +- .../38/output.json | 8 +- .../39/output.json | 8 +- .../4/output.json | 8 +- .../40/output.json | 8 +- .../41/output.json | 8 +- .../42/output.json | 8 +- .../43/output.json | 8 +- .../44/output.json | 8 +- .../45/output.json | 8 +- .../46/output.json | 8 +- .../47/output.json | 8 +- .../48/output.json | 8 +- .../49/output.json | 8 +- .../5/output.json | 8 +- .../50/output.json | 8 +- .../51/output.json | 8 +- .../52/output.json | 8 +- .../53/output.json | 8 +- .../54/output.json | 8 +- .../55/output.json | 8 +- .../56/output.json | 8 +- .../57/output.json | 8 +- .../58/output.json | 8 +- .../59/output.json | 8 +- .../6/output.json | 8 +- .../60/output.json | 8 +- .../61/output.json | 8 +- .../62/output.json | 8 +- .../63/output.json | 8 +- .../64/output.json | 8 +- .../65/output.json | 8 +- .../66/output.json | 8 +- .../67/output.json | 8 +- .../68/output.json | 8 +- .../7/output.json | 8 +- .../8/output.json | 8 +- .../9/output.json | 8 +- .../top-level-await/inside-arrow/output.json | 8 +- .../inside-class-property/output.json | 8 +- .../inside-function/output.json | 8 +- .../top-level-script/output.json | 7 +- .../declare-field-initializer/output.json | 8 +- .../declare-method/output.json | 8 +- .../declare-constructor/output.json | 8 +- .../declare-field-initializer/output.json | 8 +- .../declare-method/output.json | 8 +- .../output.json | 8 +- .../output.json | 18 ++- .../invalid-export-default-var/output.json | 8 +- .../invalid-commonjs-module/output.json | 8 +- .../invalid-es-module/output.json | 8 +- .../declare-module/invalid-import/output.json | 8 +- .../invalid-module-in-module/output.json | 8 +- .../invalid-multiple-commonjs/output.json | 8 +- .../invalid-literal/output.json | 8 +- .../output.json | 12 +- .../output.json | 10 +- .../duplicate-member-name/output.json | 12 +- .../output.json | 12 +- .../output.json | 12 +- .../output.json | 12 +- .../output.json | 12 +- .../output.json | 12 +- .../output.json | 12 +- .../output.json | 12 +- .../output.json | 12 +- .../output.json | 12 +- .../invalid-member-name/output.json | 20 +++- .../output.json | 12 +- .../output.json | 10 +- .../reserved-word-enum-name/output.json | 12 +- .../output.json | 12 +- .../output.json | 12 +- .../output.json | 24 ++-- .../output.json | 24 ++-- .../output.json | 32 ++++-- .../output.json | 32 ++++-- .../output.json | 24 ++-- .../output.json | 32 ++++-- .../output.json | 32 ++++-- .../output.json | 24 ++-- .../output.json | 24 ++-- .../output.json | 24 ++-- .../output.json | 24 ++-- .../output.json | 24 ++-- .../output.json | 24 ++-- .../output.json | 24 ++-- .../extends-reserved-invalid-1/output.json | 24 ++-- .../extends-reserved-invalid-2/output.json | 24 ++-- .../assignment-expression/output.json | 8 +- .../binary-expression/output.json | 8 +- .../call-expression/output.json | 8 +- .../class-declaration/output.json | 8 +- .../conditional-expression/output.json | 8 +- .../function-declaration/output.json | 8 +- .../import-statement/output.json | 8 +- .../member-expression/output.json | 8 +- .../new-expression/output.json | 8 +- .../sequence-expression/output.json | 8 +- .../unary-expression/output.json | 8 +- .../variable/output.json | 8 +- .../id-reserved-type-invalid/output.json | 8 +- .../output.json | 8 +- .../output.json | 8 +- .../fixtures/flow/iterator/03/output.json | 8 +- .../fixtures/flow/iterator/04/output.json | 8 +- .../fixtures/flow/iterator/05/output.json | 8 +- .../fixtures/flow/iterator/06/output.json | 8 +- .../fixtures/flow/iterator/07/output.json | 8 +- .../fixtures/flow/iterator/08/output.json | 8 +- .../fixtures/flow/iterator/09/output.json | 8 +- .../fixtures/flow/iterator/10/output.json | 8 +- .../fixtures/flow/iterator/11/output.json | 8 +- .../multiple-declarations/class/output.json | 8 +- .../interface/output.json | 8 +- .../multiple-declarations/type/output.json | 8 +- .../output.json | 8 +- .../invalid-getter-param-count/output.json | 8 +- .../invalid-setter-param-count/output.json | 8 +- .../invalid-setter-param-type/output.json | 8 +- .../reserved-type-invalid/output.json | 8 +- .../fixtures/flow/optional-type/6/output.json | 8 +- .../fixtures/flow/predicates/4/output.json | 8 +- .../fixtures/flow/predicates/5/output.json | 8 +- .../regression/issue-58-failing-1/output.json | 28 +++-- .../regression/issue-58-failing-2/output.json | 28 +++-- .../regression/issue-58-failing-3/output.json | 28 +++-- .../regression/issue-58-failing-4/output.json | 28 +++-- .../dupl-decl-const-declare-class/output.json | 8 +- .../output.json | 8 +- .../dupl-decl-const-interface/output.json | 8 +- .../dupl-decl-const-opaque-type/output.json | 8 +- .../scope/dupl-decl-const-type/output.json | 8 +- .../output.json | 8 +- .../output.json | 8 +- .../dupl-decl-declare-var-let/output.json | 8 +- .../dupl-decl-func-declare-func/output.json | 8 +- .../dupl-decl-interface-interface/output.json | 8 +- .../dupl-decl-let-declare-class/output.json | 8 +- .../output.json | 8 +- .../scope/dupl-decl-let-interface/output.json | 8 +- .../dupl-decl-let-opaque-type/output.json | 8 +- .../flow/scope/dupl-decl-let-type/output.json | 8 +- .../dupl-decl-opaque-type-const/output.json | 8 +- .../dupl-decl-opaque-type-let/output.json | 8 +- .../output.json | 8 +- .../dupl-decl-opaque-type-type/output.json | 8 +- .../dupl-decl-opaque-type-var/output.json | 8 +- .../scope/dupl-decl-type-const/output.json | 8 +- .../dupl-decl-type-interface/output.json | 8 +- .../flow/scope/dupl-decl-type-let/output.json | 8 +- .../dupl-decl-type-opaque-type/output.json | 8 +- .../scope/dupl-decl-type-type/output.json | 8 +- .../flow/scope/dupl-decl-type-var/output.json | 8 +- .../output.json | 8 +- .../scope/dupl-decl-var-interface/output.json | 8 +- .../dupl-decl-var-opaque-type/output.json | 8 +- .../flow/scope/dupl-decl-var-type/output.json | 8 +- .../flow/this-annotation/default/output.json | 8 +- .../output.json | 8 +- .../this-arrow-function/output.json | 8 +- .../this-constructor-declare/output.json | 8 +- .../this-constructor/output.json | 8 +- .../this-getter-type/output.json | 8 +- .../this-annotation/this-getter/output.json | 16 ++- .../this-annotation/this-no-annot/output.json | 8 +- .../this-not-first-type/output.json | 8 +- .../this-not-first/output.json | 8 +- .../this-optional-type/output.json | 8 +- .../this-annotation/this-optional/output.json | 8 +- .../this-setter-type/output.json | 16 ++- .../this-annotation/this-setter/output.json | 8 +- .../output.json | 8 +- .../flow/type-annotations/131/output.json | 8 +- .../flow/type-annotations/132/output.json | 8 +- .../flow/type-annotations/133/output.json | 8 +- .../flow/type-annotations/134/output.json | 8 +- .../flow/type-annotations/137/output.json | 8 +- .../flow/type-annotations/139/output.json | 8 +- .../typeof-reserved-invalid-2/output.json | 24 ++-- .../typeof-reserved-invalid-3/output.json | 24 ++-- .../typeof-reserved-invalid-4/output.json | 24 ++-- .../typeof-reserved-invalid-6/output.json | 24 ++-- .../with-default-invalid/output.json | 8 +- .../async-arrow-invalid/output.json | 10 +- .../invalid-import-type-2/output.json | 8 +- .../invalid-import-type-3/output.json | 8 +- .../invalid-import-type-4/output.json | 8 +- .../invalid-import-type-as/output.json | 8 +- .../output.json | 8 +- .../output.json | 8 +- .../output.json | 8 +- .../invalid-import-type-shorthand/output.json | 8 +- .../invalid-import-type/output.json | 8 +- .../default-missing/output.json | 8 +- .../output.json | 8 +- .../output.json | 24 ++-- .../output.json | 24 ++-- .../output.json | 32 ++++-- .../fail-in-calls-with-one-arg/output.json | 8 +- .../flow/typecasts/fail-in-calls/output.json | 8 +- .../fail-in-optional-calls/output.json | 8 +- .../typecasts/fail-without-parens/output.json | 18 ++- .../fails-in-array-expression-1/output.json | 8 +- .../fails-in-array-expression-2/output.json | 18 ++- .../fails-in-array-expression-3/output.json | 18 ++- .../fails-in-array-expression-4/output.json | 8 +- .../fails-in-array-expression-5/output.json | 8 +- .../attribute-empty-expression/output.json | 8 +- .../wrong-closing-tag-fragment/output.json | 8 +- .../jsx/errors/wrong-closing-tag/output.json | 8 +- .../wrong-opening-tag-fragment/output.json | 8 +- .../_errors/space-after/output.json | 8 +- .../_errors/space-before/output.json | 8 +- .../variable/let-context-3/output.json | 8 +- .../output.json | 8 +- .../parenthesized-object-assign/output.json | 8 +- .../cast/arrow-async-parameter-as/output.json | 8 +- .../output.json | 8 +- .../cast/arrow-parameter-as/output.json | 8 +- .../arrow-parameter-assertion/output.json | 8 +- .../typescript/cast/invalid/output.json | 48 +++++++- .../cast/parameter-typecast/output.json | 16 ++- .../output.json | 8 +- .../output.json | 8 +- .../output.json | 8 +- .../output.json | 8 +- .../abstract-method-with-body/output.json | 8 +- .../output.json | 8 +- .../declare-field-initializer/output.json | 8 +- .../class/declare-initializer/output.json | 8 +- .../class/declare-method/output.json | 8 +- .../declare-new-line-abstract/output.json | 8 +- .../class/duplicate-modifier-1/output.json | 8 +- .../class/duplicate-modifier-2/output.json | 8 +- .../duplicates-accessibility/output.json | 48 +++++++- .../class/empty-type-parameters/output.json | 8 +- .../class/extends-empty/output.json | 8 +- .../extends-implements-empty/output.json | 8 +- .../output.json | 16 ++- .../class/implements-empty/output.json | 8 +- .../class/method-readonly/output.json | 8 +- .../modifiers-index-signatures/output.json | 48 +++++++- .../output.json | 16 ++- .../output.json | 72 +++++++++--- .../output.json | 8 +- .../output.json | 8 +- .../output.json | 8 +- .../output.json | 8 +- .../typescript/declare/function/output.json | 8 +- .../declare/module-class/output.json | 8 +- .../declare/module-function/output.json | 8 +- .../declare/namespace-class/output.json | 8 +- .../declare/namespace-function/output.json | 8 +- .../empty-type-parameters/output.json | 8 +- .../function/parameter-properties/output.json | 56 ++++++++-- .../function/pattern-parameters/output.json | 8 +- .../import/export-import-type/output.json | 8 +- .../typescript/import/type-equals/output.json | 16 ++- .../typescript/interface/abstract/output.json | 8 +- .../interface/declare-new-line/output.json | 8 +- .../export-abstract-interface/output.json | 8 +- .../invalid-abstract-interface/output.json | 16 ++- .../invalid-modifiers-method/output.json | 56 ++++++++-- .../invalid-modifiers-property/output.json | 48 +++++++- .../interface/new-line-error/output.json | 8 +- .../module-declare-new-line/output.json | 8 +- .../module-new-line-error/output.json | 8 +- .../namespace-declare-new-line/output.json | 8 +- .../namespace-new-line-error/output.json | 8 +- .../top-level-await/output.json | 7 +- .../redeclaration-class-class/output.json | 8 +- .../redeclaration-class-enum/output.json | 8 +- .../redeclaration-class-type/output.json | 8 +- .../redeclaration-constenum-enum/output.json | 8 +- .../redeclaration-enum-class/output.json | 8 +- .../redeclaration-enum-constenum/output.json | 8 +- .../redeclaration-enum-function/output.json | 8 +- .../redeclaration-enum-interface/output.json | 8 +- .../scope/redeclaration-enum-let/output.json | 8 +- .../scope/redeclaration-enum-type/output.json | 8 +- .../scope/redeclaration-enum-var/output.json | 8 +- .../redeclaration-function-enum/output.json | 8 +- .../redeclaration-interface-enum/output.json | 8 +- .../scope/redeclaration-let-enum/output.json | 8 +- .../redeclaration-type-class/output.json | 8 +- .../scope/redeclaration-type-enum/output.json | 8 +- .../redeclaration-type-interface/output.json | 8 +- .../scope/redeclaration-type-type/output.json | 8 +- .../scope/redeclaration-var-enum/output.json | 8 +- .../typescript/tsx/cast-invalid/output.json | 16 ++- .../type-alias/declare-new-line/output.json | 8 +- .../type-arguments/empty-function/output.json | 8 +- .../empty-interface-extends/output.json | 8 +- .../empty-interface-implements/output.json | 8 +- .../type-arguments/empty-new/output.json | 8 +- .../empty-superclass/output.json | 8 +- .../type-arguments/empty-tsx/output.json | 8 +- .../empty-type-import/output.json | 8 +- .../type-arguments/empty-type-ref/output.json | 8 +- .../import-type-declaration-error/output.json | 8 +- .../import-type-dynamic-errors/output.json | 24 +++- .../types/intrinsic-keyword-error/output.json | 8 +- .../typescript/types/read-only-1/output.json | 24 ++-- .../typescript/types/read-only-2/output.json | 24 ++-- .../typescript/types/read-only-3/output.json | 24 ++-- .../typescript/types/read-only-4/output.json | 24 ++-- .../types/tuple-invalid-label-1/output.json | 8 +- .../types/tuple-invalid-label-2/output.json | 8 +- .../tuple-labeled-after-unlabeled/output.json | 8 +- .../output.json | 8 +- .../types/tuple-optional-invalid/output.json | 8 +- .../output.json | 8 +- .../output.json | 8 +- .../output.json | 8 +- 1380 files changed, 12902 insertions(+), 3155 deletions(-) diff --git a/packages/babel-parser/test/expressions/is-expression-babel-parser/fail/7/output.json b/packages/babel-parser/test/expressions/is-expression-babel-parser/fail/7/output.json index bed17cab3909..2102031d1a8b 100644 --- a/packages/babel-parser/test/expressions/is-expression-babel-parser/fail/7/output.json +++ b/packages/babel-parser/test/expressions/is-expression-babel-parser/fail/7/output.json @@ -1,66 +1,21 @@ { "type": "FunctionExpression", - "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": "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": "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" }, "right": { "type": "StringLiteral", - "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}}, "extra": { "rawValue": "default", "raw": "\"default\"" @@ -71,58 +26,31 @@ ], "body": { "type": "BlockStatement", - "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}}, "body": [], "directives": [ { "type": "Directive", - "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}}, "value": { "type": "DirectiveLiteral", - "start": 26, - "end": 38, - "loc": { - "start": { - "line": 1, - "column": 26 - }, - "end": { - "line": 1, - "column": 38 - } - }, - "value": "use strict", + "start":26,"end":38,"loc":{"start":{"line":1,"column":26},"end":{"line":1,"column":38}}, "extra": { "raw": "\"use strict\"", "rawValue": "use strict" - } + }, + "value": "use strict" } } ] }, "errors": [ - "SyntaxError: Illegal 'use strict' directive in function with non-simple parameter list (1:0)" + { + "$$ babel internal serialized type": "Error", + "message": "Illegal 'use strict' directive in function with non-simple parameter list (1:0)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "IllegalLanguageModeDirective" + } ] } \ No newline at end of file diff --git a/packages/babel-parser/test/expressions/is-expression-babel-parser/fail/8/output.json b/packages/babel-parser/test/expressions/is-expression-babel-parser/fail/8/output.json index df12702dd8b4..2bd98deeb3cf 100644 --- a/packages/babel-parser/test/expressions/is-expression-babel-parser/fail/8/output.json +++ b/packages/babel-parser/test/expressions/is-expression-babel-parser/fail/8/output.json @@ -1,20 +1,14 @@ { "type": "Identifier", - "start": 1, - "end": 7, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 6 - }, - "identifierName": "public" - }, + "start":1,"end":7,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":6},"identifierName":"public"}, "name": "public", "errors": [ - "SyntaxError: Unexpected reserved word 'public' (2:0)" + { + "$$ babel internal serialized type": "Error", + "message": "Unexpected reserved word 'public' (2:0)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "UnexpectedReservedWord" + } ] } \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/core/categorized/for-missing-semicolons/output.json b/packages/babel-parser/test/fixtures/core/categorized/for-missing-semicolons/output.json index ed05439af755..0359819e5bec 100644 --- a/packages/babel-parser/test/fixtures/core/categorized/for-missing-semicolons/output.json +++ b/packages/babel-parser/test/fixtures/core/categorized/for-missing-semicolons/output.json @@ -2,8 +2,20 @@ "type": "File", "start":0,"end":38,"loc":{"start":{"line":1,"column":0},"end":{"line":7,"column":1}}, "errors": [ - "SyntaxError: Missing semicolon (2:11)", - "SyntaxError: Missing semicolon (3:7)" + { + "$$ babel internal serialized type": "Error", + "message": "Missing semicolon (2:11)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "MissingSemicolon" + }, + { + "$$ babel internal serialized type": "Error", + "message": "Missing semicolon (3:7)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "MissingSemicolon" + } ], "program": { "type": "Program", 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 64125f64db72..a63009daa9c6 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 @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":11,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":11}}, "errors": [ - "SyntaxError: Invalid parenthesized assignment pattern (1:1)" + { + "$$ babel internal serialized type": "Error", + "message": "Invalid parenthesized assignment pattern (1:1)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "InvalidParenthesizedAssignment" + } ], "program": { "type": "Program", @@ -20,6 +26,10 @@ "left": { "type": "AssignmentPattern", "start":1,"end":6,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":6}}, + "extra": { + "parenthesized": true, + "parenStart": 0 + }, "left": { "type": "Identifier", "start":1,"end":2,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":2},"identifierName":"a"}, @@ -30,10 +40,6 @@ "start":5,"end":6,"loc":{"start":{"line":1,"column":5},"end":{"line":1,"column":6}}, "value": 1, "raw": "1" - }, - "extra": { - "parenthesized": true, - "parenStart": 0 } }, "right": { diff --git a/packages/babel-parser/test/fixtures/core/categorized/invalid-assignment-pattern-2/output.json b/packages/babel-parser/test/fixtures/core/categorized/invalid-assignment-pattern-2/output.json index 340a0dcdbce9..45ea30a2d0cf 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 @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":13,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":13}}, "errors": [ - "SyntaxError: Invalid parenthesized assignment pattern (1:2)" + { + "$$ babel internal serialized type": "Error", + "message": "Invalid parenthesized assignment pattern (1:2)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "InvalidParenthesizedAssignment" + } ], "program": { "type": "Program", @@ -24,6 +30,10 @@ { "type": "AssignmentPattern", "start":2,"end":7,"loc":{"start":{"line":1,"column":2},"end":{"line":1,"column":7}}, + "extra": { + "parenthesized": true, + "parenStart": 1 + }, "left": { "type": "Identifier", "start":2,"end":3,"loc":{"start":{"line":1,"column":2},"end":{"line":1,"column":3},"identifierName":"a"}, @@ -34,10 +44,6 @@ "start":6,"end":7,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":7}}, "value": 1, "raw": "1" - }, - "extra": { - "parenthesized": true, - "parenStart": 1 } } ] diff --git a/packages/babel-parser/test/fixtures/core/categorized/invalid-assignment-pattern-3/output.json b/packages/babel-parser/test/fixtures/core/categorized/invalid-assignment-pattern-3/output.json index 74aeb35dac49..62092da7fc02 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 @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":21,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":21}}, "errors": [ - "SyntaxError: Invalid parenthesized assignment pattern (1:2)" + { + "$$ babel internal serialized type": "Error", + "message": "Invalid parenthesized assignment pattern (1:2)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "InvalidParenthesizedAssignment" + } ], "program": { "type": "Program", @@ -24,6 +30,10 @@ { "type": "ObjectPattern", "start":2,"end":15,"loc":{"start":{"line":1,"column":2},"end":{"line":1,"column":15}}, + "extra": { + "parenthesized": true, + "parenStart": 1 + }, "properties": [ { "type": "Property", @@ -59,11 +69,7 @@ }, "kind": "init" } - ], - "extra": { - "parenthesized": true, - "parenStart": 1 - } + ] } ] }, diff --git a/packages/babel-parser/test/fixtures/core/categorized/invalid-assignment-pattern-4/output.json b/packages/babel-parser/test/fixtures/core/categorized/invalid-assignment-pattern-4/output.json index 7b5829535204..59229877e230 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 @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":22,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":22}}, "errors": [ - "SyntaxError: Invalid parenthesized assignment pattern (1:7)" + { + "$$ babel internal serialized type": "Error", + "message": "Invalid parenthesized assignment pattern (1:7)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "InvalidParenthesizedAssignment" + } ], "program": { "type": "Program", @@ -43,6 +49,10 @@ { "type": "ArrayPattern", "start":7,"end":14,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":14}}, + "extra": { + "parenthesized": true, + "parenStart": 6 + }, "elements": [ { "type": "AssignmentPattern", @@ -59,11 +69,7 @@ "raw": "1" } } - ], - "extra": { - "parenthesized": true, - "parenStart": 6 - } + ] } ] }, diff --git a/packages/babel-parser/test/fixtures/core/categorized/invalid-assignment-pattern-5/output.json b/packages/babel-parser/test/fixtures/core/categorized/invalid-assignment-pattern-5/output.json index 22e32af6ebf5..18d3d6ae99e7 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 @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":12,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":12}}, "errors": [ - "SyntaxError: Invalid parenthesized assignment pattern (1:2)" + { + "$$ babel internal serialized type": "Error", + "message": "Invalid parenthesized assignment pattern (1:2)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "InvalidParenthesizedAssignment" + } ], "program": { "type": "Program", @@ -24,17 +30,17 @@ { "type": "ArrayPattern", "start":2,"end":5,"loc":{"start":{"line":1,"column":2},"end":{"line":1,"column":5}}, + "extra": { + "parenthesized": true, + "parenStart": 1 + }, "elements": [ { "type": "Identifier", "start":3,"end":4,"loc":{"start":{"line":1,"column":3},"end":{"line":1,"column":4},"identifierName":"x"}, "name": "x" } - ], - "extra": { - "parenthesized": true, - "parenStart": 1 - } + ] } ] }, diff --git a/packages/babel-parser/test/fixtures/core/categorized/invalid-fn-decl-inside-loop/output.json b/packages/babel-parser/test/fixtures/core/categorized/invalid-fn-decl-inside-loop/output.json index c2f51bff4fbd..901f32957ccd 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 @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "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)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "SloppyFunction" + } ], "program": { "type": "Program", 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 f39f3fcea78e..55b6f1d46172 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 @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "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)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "SloppyFunction" + } ], "program": { "type": "Program", 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 a71d68fda717..3b6ead6bae2a 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 @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":22,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":22}}, "errors": [ - "SyntaxError: Invalid parenthesized assignment pattern (1:6)" + { + "$$ babel internal serialized type": "Error", + "message": "Invalid parenthesized assignment pattern (1:6)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "InvalidParenthesizedAssignment" + } ], "program": { "type": "Program", 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 27220d222a07..f761e30ab1cb 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 @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":21,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":21}}, "errors": [ - "SyntaxError: Invalid parenthesized assignment pattern (1:1)" + { + "$$ babel internal serialized type": "Error", + "message": "Invalid parenthesized assignment pattern (1:1)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "InvalidParenthesizedAssignment" + } ], "program": { "type": "Program", 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 7f0500a929df..fca99064d9ca 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 @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":13,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":13}}, "errors": [ - "SyntaxError: Invalid parenthesized assignment pattern (1:1)" + { + "$$ babel internal serialized type": "Error", + "message": "Invalid parenthesized assignment pattern (1:1)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "InvalidParenthesizedAssignment" + } ], "program": { "type": "Program", 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 bec89d06786c..01a8237cdb98 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 @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":11,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":11}}, "errors": [ - "SyntaxError: Invalid parenthesized assignment pattern (1:0)" + { + "$$ babel internal serialized type": "Error", + "message": "Invalid parenthesized assignment pattern (1:0)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "InvalidParenthesizedAssignment" + } ], "program": { "type": "Program", 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 49fc67ea3f47..4d3c47758049 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 @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":10,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":10}}, "errors": [ - "SyntaxError: Invalid parenthesized assignment pattern (1:0)" + { + "$$ babel internal serialized type": "Error", + "message": "Invalid parenthesized assignment pattern (1:0)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "InvalidParenthesizedAssignment" + } ], "program": { "type": "Program", 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 3d1d9274415d..60289dae6980 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 @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":15,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":15}}, "errors": [ - "SyntaxError: Invalid parenthesized assignment pattern (1:0)" + { + "$$ babel internal serialized type": "Error", + "message": "Invalid parenthesized assignment pattern (1:0)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "InvalidParenthesizedAssignment" + } ], "program": { "type": "Program", @@ -27,6 +33,9 @@ { "type": "ObjectProperty", "start":2,"end":3,"loc":{"start":{"line":1,"column":2},"end":{"line":1,"column":3}}, + "extra": { + "shorthand": true + }, "method": false, "key": { "type": "Identifier", @@ -39,9 +48,6 @@ "type": "Identifier", "start":2,"end":3,"loc":{"start":{"line":1,"column":2},"end":{"line":1,"column":3},"identifierName":"x"}, "name": "x" - }, - "extra": { - "shorthand": true } } ] diff --git a/packages/babel-parser/test/fixtures/core/create-parenthesized-expressions/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 342a51f0b192..1563f00a9686 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 @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "Invalid left-hand side in parenthesized expression (1:1)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "InvalidLhs" + } ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/core/create-parenthesized-expressions/invalid-pattern-in-rest-binding/output.json b/packages/babel-parser/test/fixtures/core/create-parenthesized-expressions/invalid-pattern-in-rest-binding/output.json index 0bf2bd22b495..eee21a0b8d69 100644 --- a/packages/babel-parser/test/fixtures/core/create-parenthesized-expressions/invalid-pattern-in-rest-binding/output.json +++ b/packages/babel-parser/test/fixtures/core/create-parenthesized-expressions/invalid-pattern-in-rest-binding/output.json @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":16,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":16}}, "errors": [ - "SyntaxError: Invalid parenthesized assignment pattern (1:5)" + { + "$$ babel internal serialized type": "Error", + "message": "Invalid parenthesized assignment pattern (1:5)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "InvalidParenthesizedAssignment" + } ], "program": { "type": "Program", 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 a655ee4c1fcb..b9fc511fc145 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 @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":12,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":12}}, "errors": [ - "SyntaxError: Invalid parenthesized assignment pattern (1:1)" + { + "$$ babel internal serialized type": "Error", + "message": "Invalid parenthesized assignment pattern (1:1)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "InvalidParenthesizedAssignment" + } ], "program": { "type": "Program", 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 20ba00fd6d9c..949ae42b80aa 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 @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":25,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":2}}, "errors": [ - "SyntaxError: Unexpected keyword 'break' (2:2)" + { + "$$ babel internal serialized type": "Error", + "message": "Unexpected keyword 'break' (2:2)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "UnexpectedKeyword" + } ], "program": { "type": "Program", @@ -29,6 +35,9 @@ { "type": "ObjectProperty", "start":12,"end":22,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":12}}, + "extra": { + "shorthand": true + }, "method": false, "key": { "type": "Identifier", @@ -41,9 +50,6 @@ "type": "Identifier", "start":12,"end":22,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":12},"identifierName":"break"}, "name": "break" - }, - "extra": { - "shorthand": true } } ] diff --git a/packages/babel-parser/test/fixtures/core/escape-string/invalid-decimal-escape-strict-directive-function/output.json b/packages/babel-parser/test/fixtures/core/escape-string/invalid-decimal-escape-strict-directive-function/output.json index 4450ba694b0f..11aaa8ac09dd 100644 --- a/packages/babel-parser/test/fixtures/core/escape-string/invalid-decimal-escape-strict-directive-function/output.json +++ b/packages/babel-parser/test/fixtures/core/escape-string/invalid-decimal-escape-strict-directive-function/output.json @@ -2,12 +2,48 @@ "type": "File", "start":0,"end":182,"loc":{"start":{"line":1,"column":0},"end":{"line":21,"column":1}}, "errors": [ - "SyntaxError: The only valid numeric escape in strict mode is '\\0' (2:4)", - "SyntaxError: The only valid numeric escape in strict mode is '\\0' (7:4)", - "SyntaxError: The only valid numeric escape in strict mode is '\\0' (8:4)", - "SyntaxError: The only valid numeric escape in strict mode is '\\0' (14:4)", - "SyntaxError: The only valid numeric escape in strict mode is '\\0' (19:4)", - "SyntaxError: The only valid numeric escape in strict mode is '\\0' (20:4)" + { + "$$ babel internal serialized type": "Error", + "message": "The only valid numeric escape in strict mode is '\\0' (2:4)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "StrictNumericEscape" + }, + { + "$$ babel internal serialized type": "Error", + "message": "The only valid numeric escape in strict mode is '\\0' (7:4)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "StrictNumericEscape" + }, + { + "$$ babel internal serialized type": "Error", + "message": "The only valid numeric escape in strict mode is '\\0' (8:4)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "StrictNumericEscape" + }, + { + "$$ babel internal serialized type": "Error", + "message": "The only valid numeric escape in strict mode is '\\0' (14:4)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "StrictNumericEscape" + }, + { + "$$ babel internal serialized type": "Error", + "message": "The only valid numeric escape in strict mode is '\\0' (19:4)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "StrictNumericEscape" + }, + { + "$$ babel internal serialized type": "Error", + "message": "The only valid numeric escape in strict mode is '\\0' (20:4)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "StrictNumericEscape" + } ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/core/escape-string/invalid-decimal-escape-strict-directive/output.json b/packages/babel-parser/test/fixtures/core/escape-string/invalid-decimal-escape-strict-directive/output.json index 27f42a3a21dc..938444a39153 100644 --- a/packages/babel-parser/test/fixtures/core/escape-string/invalid-decimal-escape-strict-directive/output.json +++ b/packages/babel-parser/test/fixtures/core/escape-string/invalid-decimal-escape-strict-directive/output.json @@ -2,16 +2,76 @@ "type": "File", "start":0,"end":87,"loc":{"start":{"line":1,"column":0},"end":{"line":11,"column":22}}, "errors": [ - "SyntaxError: The only valid numeric escape in strict mode is '\\0' (1:2)", - "SyntaxError: The only valid numeric escape in strict mode is '\\0' (1:10)", - "SyntaxError: The only valid numeric escape in strict mode is '\\0' (1:18)", - "SyntaxError: The only valid numeric escape in strict mode is '\\0' (3:2)", - "SyntaxError: The only valid numeric escape in strict mode is '\\0' (4:2)", - "SyntaxError: The only valid numeric escape in strict mode is '\\0' (8:2)", - "SyntaxError: The only valid numeric escape in strict mode is '\\0' (9:2)", - "SyntaxError: The only valid numeric escape in strict mode is '\\0' (11:2)", - "SyntaxError: The only valid numeric escape in strict mode is '\\0' (11:10)", - "SyntaxError: The only valid numeric escape in strict mode is '\\0' (11:18)" + { + "$$ babel internal serialized type": "Error", + "message": "The only valid numeric escape in strict mode is '\\0' (1:2)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "StrictNumericEscape" + }, + { + "$$ babel internal serialized type": "Error", + "message": "The only valid numeric escape in strict mode is '\\0' (1:10)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "StrictNumericEscape" + }, + { + "$$ babel internal serialized type": "Error", + "message": "The only valid numeric escape in strict mode is '\\0' (1:18)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "StrictNumericEscape" + }, + { + "$$ babel internal serialized type": "Error", + "message": "The only valid numeric escape in strict mode is '\\0' (3:2)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "StrictNumericEscape" + }, + { + "$$ babel internal serialized type": "Error", + "message": "The only valid numeric escape in strict mode is '\\0' (4:2)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "StrictNumericEscape" + }, + { + "$$ babel internal serialized type": "Error", + "message": "The only valid numeric escape in strict mode is '\\0' (8:2)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "StrictNumericEscape" + }, + { + "$$ babel internal serialized type": "Error", + "message": "The only valid numeric escape in strict mode is '\\0' (9:2)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "StrictNumericEscape" + }, + { + "$$ babel internal serialized type": "Error", + "message": "The only valid numeric escape in strict mode is '\\0' (11:2)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "StrictNumericEscape" + }, + { + "$$ babel internal serialized type": "Error", + "message": "The only valid numeric escape in strict mode is '\\0' (11:10)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "StrictNumericEscape" + }, + { + "$$ babel internal serialized type": "Error", + "message": "The only valid numeric escape in strict mode is '\\0' (11:18)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "StrictNumericEscape" + } ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/core/escape-string/non-octal-eight-and-nine-before-use-strict/output.json b/packages/babel-parser/test/fixtures/core/escape-string/non-octal-eight-and-nine-before-use-strict/output.json index 2390fa033b11..7a445cf9ce4e 100644 --- a/packages/babel-parser/test/fixtures/core/escape-string/non-octal-eight-and-nine-before-use-strict/output.json +++ b/packages/babel-parser/test/fixtures/core/escape-string/non-octal-eight-and-nine-before-use-strict/output.json @@ -2,10 +2,34 @@ "type": "File", "start":0,"end":51,"loc":{"start":{"line":1,"column":0},"end":{"line":5,"column":1}}, "errors": [ - "SyntaxError: The only valid numeric escape in strict mode is '\\0' (2:4)", - "SyntaxError: The only valid numeric escape in strict mode is '\\0' (2:9)", - "SyntaxError: The only valid numeric escape in strict mode is '\\0' (4:4)", - "SyntaxError: The only valid numeric escape in strict mode is '\\0' (4:9)" + { + "$$ babel internal serialized type": "Error", + "message": "The only valid numeric escape in strict mode is '\\0' (2:4)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "StrictNumericEscape" + }, + { + "$$ babel internal serialized type": "Error", + "message": "The only valid numeric escape in strict mode is '\\0' (2:9)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "StrictNumericEscape" + }, + { + "$$ babel internal serialized type": "Error", + "message": "The only valid numeric escape in strict mode is '\\0' (4:4)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "StrictNumericEscape" + }, + { + "$$ babel internal serialized type": "Error", + "message": "The only valid numeric escape in strict mode is '\\0' (4:9)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "StrictNumericEscape" + } ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/core/escape-string/non-octal-eight-and-nine/output.json b/packages/babel-parser/test/fixtures/core/escape-string/non-octal-eight-and-nine/output.json index fad92eec30ff..1f7d4e220328 100644 --- a/packages/babel-parser/test/fixtures/core/escape-string/non-octal-eight-and-nine/output.json +++ b/packages/babel-parser/test/fixtures/core/escape-string/non-octal-eight-and-nine/output.json @@ -2,8 +2,20 @@ "type": "File", "start":0,"end":49,"loc":{"start":{"line":1,"column":0},"end":{"line":5,"column":1}}, "errors": [ - "SyntaxError: The only valid numeric escape in strict mode is '\\0' (4:4)", - "SyntaxError: The only valid numeric escape in strict mode is '\\0' (4:9)" + { + "$$ babel internal serialized type": "Error", + "message": "The only valid numeric escape in strict mode is '\\0' (4:4)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "StrictNumericEscape" + }, + { + "$$ babel internal serialized type": "Error", + "message": "The only valid numeric escape in strict mode is '\\0' (4:9)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "StrictNumericEscape" + } ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/core/escape-string/numeric-escape-in-directive/output.json b/packages/babel-parser/test/fixtures/core/escape-string/numeric-escape-in-directive/output.json index 2c6c0e03d277..975cd93b7928 100644 --- a/packages/babel-parser/test/fixtures/core/escape-string/numeric-escape-in-directive/output.json +++ b/packages/babel-parser/test/fixtures/core/escape-string/numeric-escape-in-directive/output.json @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":76,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":76}}, "errors": [ - "SyntaxError: The only valid numeric escape in strict mode is '\\0' (1:69)" + { + "$$ babel internal serialized type": "Error", + "message": "The only valid numeric escape in strict mode is '\\0' (1:69)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "StrictNumericEscape" + } ], "program": { "type": "Program", @@ -47,11 +53,11 @@ "value": { "type": "DirectiveLiteral", "start":52,"end":71,"loc":{"start":{"line":1,"column":52},"end":{"line":1,"column":71}}, - "value": "octal directive\\1", "extra": { "raw": "\"octal directive\\1\"", "rawValue": "octal directive\\1" - } + }, + "value": "octal directive\\1" } } ] @@ -65,11 +71,11 @@ "value": { "type": "DirectiveLiteral", "start":19,"end":31,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":31}}, - "value": "use strict", "extra": { "raw": "\"use strict\"", "rawValue": "use strict" - } + }, + "value": "use strict" } } ] diff --git a/packages/babel-parser/test/fixtures/core/escape-string/numeric-escape-in-property-name/output.json b/packages/babel-parser/test/fixtures/core/escape-string/numeric-escape-in-property-name/output.json index 0491546b1a61..32b4154127e1 100644 --- a/packages/babel-parser/test/fixtures/core/escape-string/numeric-escape-in-property-name/output.json +++ b/packages/babel-parser/test/fixtures/core/escape-string/numeric-escape-in-property-name/output.json @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":50,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":50}}, "errors": [ - "SyntaxError: The only valid numeric escape in strict mode is '\\0' (1:38)" + { + "$$ babel internal serialized type": "Error", + "message": "The only valid numeric escape in strict mode is '\\0' (1:38)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "StrictNumericEscape" + } ], "program": { "type": "Program", @@ -31,6 +37,10 @@ "expression": { "type": "ObjectExpression", "start":34,"end":46,"loc":{"start":{"line":1,"column":34},"end":{"line":1,"column":46}}, + "extra": { + "parenthesized": true, + "parenStart": 33 + }, "properties": [ { "type": "ObjectProperty", @@ -57,11 +67,7 @@ "value": 42 } } - ], - "extra": { - "parenthesized": true, - "parenStart": 33 - } + ] } } ], @@ -72,11 +78,11 @@ "value": { "type": "DirectiveLiteral", "start":19,"end":31,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":31}}, - "value": "use strict", "extra": { "raw": "'use strict'", "rawValue": "use strict" - } + }, + "value": "use strict" } } ] 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 97c5ce5eb36d..f481cf090f7b 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 @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":5,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":5}}, "errors": [ - "SyntaxError: Invalid escape sequence in template (1:2)" + { + "$$ babel internal serialized type": "Error", + "message": "Invalid escape sequence in template (1:2)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "InvalidEscapeSequenceTemplate" + } ], "program": { "type": "Program", 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 98905e40ab03..79a00e8d9bc4 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 @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":5,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":5}}, "errors": [ - "SyntaxError: Invalid escape sequence in template (1:2)" + { + "$$ babel internal serialized type": "Error", + "message": "Invalid escape sequence in template (1:2)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "InvalidEscapeSequenceTemplate" + } ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/core/legacy-octal/legacy-octal-after-use-strict-function/output.json b/packages/babel-parser/test/fixtures/core/legacy-octal/legacy-octal-after-use-strict-function/output.json index 86f191f9361c..43f5d0053ac0 100644 --- a/packages/babel-parser/test/fixtures/core/legacy-octal/legacy-octal-after-use-strict-function/output.json +++ b/packages/babel-parser/test/fixtures/core/legacy-octal/legacy-octal-after-use-strict-function/output.json @@ -2,9 +2,27 @@ "type": "File", "start":0,"end":84,"loc":{"start":{"line":1,"column":0},"end":{"line":10,"column":1}}, "errors": [ - "SyntaxError: Legacy octal literals are not allowed in strict mode (3:2)", - "SyntaxError: Legacy octal literals are not allowed in strict mode (8:2)", - "SyntaxError: Legacy octal literals are not allowed in strict mode (9:2)" + { + "$$ babel internal serialized type": "Error", + "message": "Legacy octal literals are not allowed in strict mode (3:2)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "StrictOctalLiteral" + }, + { + "$$ babel internal serialized type": "Error", + "message": "Legacy octal literals are not allowed in strict mode (8:2)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "StrictOctalLiteral" + }, + { + "$$ babel internal serialized type": "Error", + "message": "Legacy octal literals are not allowed in strict mode (9:2)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "StrictOctalLiteral" + } ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/core/legacy-octal/legacy-octal-after-use-strict/output.json b/packages/babel-parser/test/fixtures/core/legacy-octal/legacy-octal-after-use-strict/output.json index e184e7d7f892..f8a094706cb3 100644 --- a/packages/babel-parser/test/fixtures/core/legacy-octal/legacy-octal-after-use-strict/output.json +++ b/packages/babel-parser/test/fixtures/core/legacy-octal/legacy-octal-after-use-strict/output.json @@ -2,8 +2,20 @@ "type": "File", "start":0,"end":21,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":21}}, "errors": [ - "SyntaxError: Legacy octal literals are not allowed in strict mode (1:14)", - "SyntaxError: Legacy octal literals are not allowed in strict mode (1:18)" + { + "$$ babel internal serialized type": "Error", + "message": "Legacy octal literals are not allowed in strict mode (1:14)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "StrictOctalLiteral" + }, + { + "$$ babel internal serialized type": "Error", + "message": "Legacy octal literals are not allowed in strict mode (1:18)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "StrictOctalLiteral" + } ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/core/object/invalid-setter/output.json b/packages/babel-parser/test/fixtures/core/object/invalid-setter/output.json index 67751ab07b1f..e22f5fa7e5be 100644 --- a/packages/babel-parser/test/fixtures/core/object/invalid-setter/output.json +++ b/packages/babel-parser/test/fixtures/core/object/invalid-setter/output.json @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":15,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":15}}, "errors": [ - "SyntaxError: setter must have exactly one formal parameter (1:3)" + { + "$$ babel internal serialized type": "Error", + "message": "setter must have exactly one formal parameter (1:3)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "BadSetterArity" + } ], "program": { "type": "Program", @@ -16,6 +22,10 @@ "expression": { "type": "ObjectExpression", "start":1,"end":14,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":14}}, + "extra": { + "parenthesized": true, + "parenStart": 0 + }, "properties": [ { "type": "ObjectMethod", @@ -39,11 +49,7 @@ "directives": [] } } - ], - "extra": { - "parenthesized": true, - "parenStart": 0 - } + ] } } ], 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 7cc466fa1ded..70fc0430a039 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 @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "Legacy octal literals are not allowed in strict mode (1:0)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "StrictOctalLiteral" + } ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/core/regression/octal-float-fail/output.json b/packages/babel-parser/test/fixtures/core/regression/octal-float-fail/output.json index 34bb9d34311a..49697f890180 100644 --- a/packages/babel-parser/test/fixtures/core/regression/octal-float-fail/output.json +++ b/packages/babel-parser/test/fixtures/core/regression/octal-float-fail/output.json @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":4,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":4}}, "errors": [ - "SyntaxError: Missing semicolon (1:2)" + { + "$$ babel internal serialized type": "Error", + "message": "Missing semicolon (1:2)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "MissingSemicolon" + } ], "program": { "type": "Program", 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 bf01e24b493d..c326dcfaaa56 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 @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "Identifier 'foo' has already been declared (4:6)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "VarRedeclaration" + } ], "program": { "type": "Program", 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 dd515037db96..fec7e7ad5c1c 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 @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "Identifier 'foo' has already been declared (3:4)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "VarRedeclaration" + } ], "program": { "type": "Program", 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 26e7aee9b70c..5462ed9248cc 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 @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "Identifier 'foo' has already been declared (4:6)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "VarRedeclaration" + } ], "program": { "type": "Program", 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 9d5f3660774e..5948440daa8f 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 @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "Identifier 'foo' has already been declared (3:4)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "VarRedeclaration" + } ], "program": { "type": "Program", 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 294f5fbc9c7f..31f7668a2bfc 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 @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "Identifier 'foo' has already been declared (2:15)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "VarRedeclaration" + } ], "program": { "type": "Program", 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 532647600b3c..fd2fe1375249 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 @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "Identifier 'foo' has already been declared (1:35)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "VarRedeclaration" + } ], "program": { "type": "Program", 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 680f5225864d..50b45aeb7fe6 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 @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "Identifier 'foo' has already been declared (3:11)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "VarRedeclaration" + } ], "program": { "type": "Program", 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 b1c8e29872ae..f267687b7996 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 @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "Identifier 'foo' has already been declared (3:6)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "VarRedeclaration" + } ], "program": { "type": "Program", 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 01f965585c34..c11f8784dc7d 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 @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "Identifier 'foo' has already been declared (2:28)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "VarRedeclaration" + } ], "program": { "type": "Program", 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 8f5d30047039..84076735fd10 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 @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "Identifier 'foo' has already been declared (3:6)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "VarRedeclaration" + } ], "program": { "type": "Program", 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 df5372c2f51e..0b5d4369fe40 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 @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "Identifier 'foo' has already been declared (3:6)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "VarRedeclaration" + } ], "program": { "type": "Program", @@ -29,6 +35,9 @@ { "type": "ObjectProperty", "start":17,"end":20,"loc":{"start":{"line":2,"column":11},"end":{"line":2,"column":14}}, + "extra": { + "shorthand": true + }, "method": false, "key": { "type": "Identifier", @@ -41,9 +50,6 @@ "type": "Identifier", "start":17,"end":20,"loc":{"start":{"line":2,"column":11},"end":{"line":2,"column":14},"identifierName":"foo"}, "name": "foo" - }, - "extra": { - "shorthand": true } } ] diff --git a/packages/babel-parser/test/fixtures/core/scope/dupl-bind-class-class/output.json b/packages/babel-parser/test/fixtures/core/scope/dupl-bind-class-class/output.json index 9668ddd49b8c..e86feae127b8 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 @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "Identifier 'foo' has already been declared (2:6)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "VarRedeclaration" + } ], "program": { "type": "Program", 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 fcb6f91989b7..f2539c46372f 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 @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "Identifier 'foo' has already been declared (2:6)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "VarRedeclaration" + } ], "program": { "type": "Program", 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 251519a88b9e..457d544c505f 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 @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "Identifier 'foo' has already been declared (2:9)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "VarRedeclaration" + } ], "program": { "type": "Program", 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 40ac7749d89c..49a5f24ce82a 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 @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "Identifier 'foo' has already been declared (2:4)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "VarRedeclaration" + } ], "program": { "type": "Program", 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 7e9448c87dd3..cb7f4bb4862a 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 @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "Identifier 'foo' has already been declared (2:4)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "VarRedeclaration" + } ], "program": { "type": "Program", 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 c35c68c75903..1851fd0498e1 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 @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "Identifier 'foo' has already been declared (1:13)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "VarRedeclaration" + } ], "program": { "type": "Program", 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 ae3ed9341b75..057e1b357862 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 @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "Identifier 'f' has already been declared (1:28)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "VarRedeclaration" + } ], "program": { "type": "Program", 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 71081aa3160a..d4ca2a9c240c 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 @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "Identifier 'foo' has already been declared (1:29)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "VarRedeclaration" + } ], "program": { "type": "Program", 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 f4d8dbbf8917..cbcb4608e9c6 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 @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "Identifier 'foo' has already been declared (2:9)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "VarRedeclaration" + } ], "program": { "type": "Program", 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 7840aedc9085..e6c2db1ba576 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 @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "Identifier 'foo' has already been declared (3:6)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "VarRedeclaration" + } ], "program": { "type": "Program", 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 209a1e02c0b6..d3a2939f91e5 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 @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "Identifier 'f' has already been declared (1:28)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "VarRedeclaration" + } ], "program": { "type": "Program", 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 942dccb6e671..aa33e9d0b8ba 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 @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "Identifier 'foo' has already been declared (1:9)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "VarRedeclaration" + } ], "program": { "type": "Program", 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 047bfbf77f03..81cd0ba86237 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 @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "Identifier 'a' has already been declared (3:8)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "VarRedeclaration" + } ], "program": { "type": "Program", 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 eb373fff2969..f6b1408d1fca 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 @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "Identifier 'i' has already been declared (2:8)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "VarRedeclaration" + } ], "program": { "type": "Program", 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 40f3335e7eb5..257747ac8f1b 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 @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":30,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":30}}, "errors": [ - "SyntaxError: Export 'encrypt' is not defined (1:9)" + { + "$$ babel internal serialized type": "Error", + "message": "Export 'encrypt' is not defined (1:9)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "ModuleExportUndefined" + } ], "program": { "type": "Program", 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 120ad6bc705e..a5f7cd5d95c0 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 @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":52,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":21}}, "errors": [ - "SyntaxError: Export 'encrypt' is not defined (1:9)" + { + "$$ babel internal serialized type": "Error", + "message": "Export 'encrypt' is not defined (1:9)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "ModuleExportUndefined" + } ], "program": { "type": "Program", 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 cedcbba92a8b..9ea4d52f44f0 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 @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":46,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":18}}, "errors": [ - "SyntaxError: Export 'encrypt' is not defined (4:9)" + { + "$$ babel internal serialized type": "Error", + "message": "Export 'encrypt' is not defined (4:9)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "ModuleExportUndefined" + } ], "program": { "type": "Program", 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 a40f509053a3..dfb550e0ec13 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 @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":25,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":25}}, "errors": [ - "SyntaxError: Export 'Object' is not defined (1:9)" + { + "$$ babel internal serialized type": "Error", + "message": "Export 'Object' is not defined (1:9)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "ModuleExportUndefined" + } ], "program": { "type": "Program", 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 faad719a5d09..e294f53985b7 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 @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":18,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":18}}, "errors": [ - "SyntaxError: Export 'Object' is not defined (1:9)" + { + "$$ babel internal serialized type": "Error", + "message": "Export 'Object' is not defined (1:9)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "ModuleExportUndefined" + } ], "program": { "type": "Program", 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 783a60a237c9..4bc0f097fe32 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 @@ -2,8 +2,20 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "In strict mode code, functions can only be declared at top level or inside a block (2:10)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "StrictFunction" + }, + { + "$$ babel internal serialized type": "Error", + "message": "Export 'encrypt' is not defined (1:9)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "ModuleExportUndefined" + } ], "program": { "type": "Program", 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 d83b949cce1f..539b2aabc902 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 @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":19,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":19}}, "errors": [ - "SyntaxError: Export 'encrypt' is not defined (1:9)" + { + "$$ babel internal serialized type": "Error", + "message": "Export 'encrypt' is not defined (1:9)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "ModuleExportUndefined" + } ], "program": { "type": "Program", 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 287f2a053320..3a002cd142a4 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/108/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/108/output.json @@ -2,11 +2,41 @@ "type": "File", "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)", - "SyntaxError: Invalid regular expression flag (1:20)", - "SyntaxError: Invalid regular expression flag (1:21)", - "SyntaxError: Invalid regular expression flag (1:22)" + { + "$$ babel internal serialized type": "Error", + "message": "Invalid regular expression flag (1:17)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "MalformedRegExpFlags" + }, + { + "$$ babel internal serialized type": "Error", + "message": "Invalid regular expression flag (1:19)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "MalformedRegExpFlags" + }, + { + "$$ babel internal serialized type": "Error", + "message": "Invalid regular expression flag (1:20)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "MalformedRegExpFlags" + }, + { + "$$ babel internal serialized type": "Error", + "message": "Invalid regular expression flag (1:21)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "MalformedRegExpFlags" + }, + { + "$$ babel internal serialized type": "Error", + "message": "Invalid regular expression flag (1:22)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "MalformedRegExpFlags" + } ], "program": { "type": "Program", 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 6afcaf3f5045..883c24d13028 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/349/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/349/output.json @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":2,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":2}}, "errors": [ - "SyntaxError: Floating-point numbers require a valid exponent after the 'e' (1:0)" + { + "$$ babel internal serialized type": "Error", + "message": "Floating-point numbers require a valid exponent after the 'e' (1:0)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "InvalidOrMissingExponent" + } ], "program": { "type": "Program", 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 34027472096c..ffa485251e6f 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/350/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/350/output.json @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":3,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":3}}, "errors": [ - "SyntaxError: Floating-point numbers require a valid exponent after the 'e' (1:0)" + { + "$$ babel internal serialized type": "Error", + "message": "Floating-point numbers require a valid exponent after the 'e' (1:0)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "InvalidOrMissingExponent" + } ], "program": { "type": "Program", 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 666fcca21213..ff4ec8fd0d3a 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/351/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/351/output.json @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":3,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":3}}, "errors": [ - "SyntaxError: Floating-point numbers require a valid exponent after the 'e' (1:0)" + { + "$$ babel internal serialized type": "Error", + "message": "Floating-point numbers require a valid exponent after the 'e' (1:0)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "InvalidOrMissingExponent" + } ], "program": { "type": "Program", 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 9a1a7ea60803..9c79df241210 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/354/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/354/output.json @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":2,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":2}}, "errors": [ - "SyntaxError: Expected number in radix 16 (1:2)" + { + "$$ babel internal serialized type": "Error", + "message": "Expected number in radix 16 (1:2)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "InvalidDigit" + } ], "program": { "type": "Program", 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 5dd7b5d3fcd6..91a7c6fff46d 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/361/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/361/output.json @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":2,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":2}}, "errors": [ - "SyntaxError: Expecting Unicode escape sequence \\uXXXX (1:2)" + { + "$$ babel internal serialized type": "Error", + "message": "Expecting Unicode escape sequence \\uXXXX (1:2)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "MissingUnicodeEscape" + } ], "program": { "type": "Program", 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 d9a89994f01f..600288e132df 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/362/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/362/output.json @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":7,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":7}}, "errors": [ - "SyntaxError: Invalid Unicode escape (1:1)" + { + "$$ babel internal serialized type": "Error", + "message": "Invalid Unicode escape (1:1)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "EscapedCharNotAnIdentifier" + } ], "program": { "type": "Program", 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 32180fcde928..00f879dacea7 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/363/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/363/output.json @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":7,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":7}}, "errors": [ - "SyntaxError: Invalid Unicode escape (1:1)" + { + "$$ babel internal serialized type": "Error", + "message": "Invalid Unicode escape (1:1)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "EscapedCharNotAnIdentifier" + } ], "program": { "type": "Program", 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 d42d61f8a543..53e05e009c62 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/366/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/366/output.json @@ -2,8 +2,20 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "Invalid regular expression flag (1:16)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "MalformedRegExpFlags" + }, + { + "$$ babel internal serialized type": "Error", + "message": "Invalid regular expression flag (1:18)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "MalformedRegExpFlags" + } ], "program": { "type": "Program", 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 d4d2cf5dfe67..a7671046aad4 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/367/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/367/output.json @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "Invalid left-hand side in assignment expression (1:0)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "InvalidLhs" + } ], "program": { "type": "Program", 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 edc325840380..729a18689859 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/368/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/368/output.json @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "Invalid left-hand side in assignment expression (1:0)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "InvalidLhs" + } ], "program": { "type": "Program", 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 46112c6c8828..93e28674a7e9 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/369/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/369/output.json @@ -2,8 +2,20 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "Invalid parenthesized assignment pattern (1:1)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "InvalidParenthesizedAssignment" + }, + { + "$$ babel internal serialized type": "Error", + "message": "Invalid left-hand side in assignment expression (1:1)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "InvalidLhs" + } ], "program": { "type": "Program", @@ -21,6 +33,10 @@ "left": { "type": "BinaryExpression", "start":1,"end":6,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":6}}, + "extra": { + "parenthesized": true, + "parenStart": 0 + }, "left": { "type": "NumericLiteral", "start":1,"end":2,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":2}}, @@ -39,10 +55,6 @@ "raw": "1" }, "value": 1 - }, - "extra": { - "parenthesized": true, - "parenStart": 0 } }, "right": { 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 89b9c579fa1c..16ad82507946 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/370/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/370/output.json @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "Invalid left-hand side in postfix operation (1:0)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "InvalidLhs" + } ], "program": { "type": "Program", 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 b0387fd4ff59..708e2b2494a7 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/371/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/371/output.json @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "Invalid left-hand side in postfix operation (1:0)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "InvalidLhs" + } ], "program": { "type": "Program", 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 e86e86ca2246..469422c74446 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/372/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/372/output.json @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "Invalid left-hand side in prefix operation (1:2)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "InvalidLhs" + } ], "program": { "type": "Program", 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 de49f7815bd2..131ef5247a97 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/373/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/373/output.json @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "Invalid left-hand side in prefix operation (1:2)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "InvalidLhs" + } ], "program": { "type": "Program", 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 609aed8d6228..bb0a0a0a7793 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/374/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/374/output.json @@ -2,8 +2,20 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "Invalid parenthesized assignment pattern (1:5)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "InvalidParenthesizedAssignment" + }, + { + "$$ babel internal serialized type": "Error", + "message": "Invalid left-hand side in for-in statement (1:5)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "InvalidLhs" + } ], "program": { "type": "Program", @@ -17,6 +29,10 @@ "left": { "type": "BinaryExpression", "start":5,"end":10,"loc":{"start":{"line":1,"column":5},"end":{"line":1,"column":10}}, + "extra": { + "parenthesized": true, + "parenStart": 4 + }, "left": { "type": "NumericLiteral", "start":5,"end":6,"loc":{"start":{"line":1,"column":5},"end":{"line":1,"column":6}}, @@ -35,10 +51,6 @@ "raw": "1" }, "value": 1 - }, - "extra": { - "parenthesized": true, - "parenStart": 4 } }, "right": { 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 71a10a5324e9..e7ed0ccccf9d 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/382/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/382/output.json @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":11,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":11}}, "errors": [ - "SyntaxError: Unexpected keyword 'if' (1:4)" + { + "$$ babel internal serialized type": "Error", + "message": "Unexpected keyword 'if' (1:4)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "UnexpectedKeyword" + } ], "program": { "type": "Program", 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 62e99551071a..818f8f80301c 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/383/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/383/output.json @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "Invalid left-hand side in assignment expression (1:0)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "InvalidLhs" + } ], "program": { "type": "Program", 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 ba27c1c609ba..1c6c7ad1a08d 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/384/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/384/output.json @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "Invalid left-hand side in assignment expression (1:0)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "InvalidLhs" + } ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/388/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/388/output.json index ec9f3f126a1c..62f52cec85ea 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/388/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/388/output.json @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":9,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":9}}, "errors": [ - "SyntaxError: Missing semicolon (1:5)" + { + "$$ babel internal serialized type": "Error", + "message": "Missing semicolon (1:5)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "MissingSemicolon" + } ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/389/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/389/output.json index eb17665ab7f3..e59f82943a87 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/389/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/389/output.json @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":9,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":9}}, "errors": [ - "SyntaxError: Missing semicolon (1:5)" + { + "$$ babel internal serialized type": "Error", + "message": "Missing semicolon (1:5)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "MissingSemicolon" + } ], "program": { "type": "Program", 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 e005c14c8e87..5ed723da4290 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/397/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/397/output.json @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":18,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":18}}, "errors": [ - "SyntaxError: Unexpected keyword 'if' (1:11)" + { + "$$ babel internal serialized type": "Error", + "message": "Unexpected keyword 'if' (1:11)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "UnexpectedKeyword" + } ], "program": { "type": "Program", 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 6ec5cbae6e42..b8f85d600864 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/398/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/398/output.json @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":20,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":20}}, "errors": [ - "SyntaxError: Unexpected keyword 'true' (1:11)" + { + "$$ babel internal serialized type": "Error", + "message": "Unexpected keyword 'true' (1:11)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "UnexpectedKeyword" + } ], "program": { "type": "Program", 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 52f3a5538421..e529518e4187 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/399/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/399/output.json @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":21,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":21}}, "errors": [ - "SyntaxError: Unexpected keyword 'false' (1:11)" + { + "$$ babel internal serialized type": "Error", + "message": "Unexpected keyword 'false' (1:11)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "UnexpectedKeyword" + } ], "program": { "type": "Program", 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 501517e632d1..b78ede2910b6 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/400/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/400/output.json @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":20,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":20}}, "errors": [ - "SyntaxError: Unexpected keyword 'null' (1:11)" + { + "$$ babel internal serialized type": "Error", + "message": "Unexpected keyword 'null' (1:11)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "UnexpectedKeyword" + } ], "program": { "type": "Program", 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 9ac27929ac37..dc9f802e271c 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/401/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/401/output.json @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":19,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":19}}, "errors": [ - "SyntaxError: Unexpected keyword 'null' (1:9)" + { + "$$ babel internal serialized type": "Error", + "message": "Unexpected keyword 'null' (1:9)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "UnexpectedKeyword" + } ], "program": { "type": "Program", 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 4d6a82553f05..76b3e63a4d09 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/402/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/402/output.json @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":19,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":19}}, "errors": [ - "SyntaxError: Unexpected keyword 'true' (1:9)" + { + "$$ babel internal serialized type": "Error", + "message": "Unexpected keyword 'true' (1:9)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "UnexpectedKeyword" + } ], "program": { "type": "Program", 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 9939c1143924..076e17e79be8 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/403/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/403/output.json @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":20,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":20}}, "errors": [ - "SyntaxError: Unexpected keyword 'false' (1:9)" + { + "$$ babel internal serialized type": "Error", + "message": "Unexpected keyword 'false' (1:9)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "UnexpectedKeyword" + } ], "program": { "type": "Program", 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 18e0bcd2fc99..eaa1df83c15b 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/404/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/404/output.json @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":17,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":17}}, "errors": [ - "SyntaxError: Unexpected keyword 'if' (1:9)" + { + "$$ babel internal serialized type": "Error", + "message": "Unexpected keyword 'if' (1:9)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "UnexpectedKeyword" + } ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/405/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/405/output.json index 9f46d8a53e92..87558f656a98 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/405/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/405/output.json @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":4,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":4}}, "errors": [ - "SyntaxError: Missing semicolon (1:1)" + { + "$$ babel internal serialized type": "Error", + "message": "Missing semicolon (1:1)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "MissingSemicolon" + } ], "program": { "type": "Program", 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 8ce94b960543..33a45a224d2e 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/409/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/409/output.json @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":5,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":5}}, "errors": [ - "SyntaxError: Unsyntactic break (1:0)" + { + "$$ babel internal serialized type": "Error", + "message": "Unsyntactic break (1:0)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "IllegalBreakContinue" + } ], "program": { "type": "Program", 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 6d89822f1568..9f2f1645b5dc 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/411/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/411/output.json @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":8,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":8}}, "errors": [ - "SyntaxError: Unsyntactic continue (1:0)" + { + "$$ babel internal serialized type": "Error", + "message": "Unsyntactic continue (1:0)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "IllegalBreakContinue" + } ], "program": { "type": "Program", 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 d3af5238b363..daaa3901b730 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/417/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/417/output.json @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "Invalid left-hand side in for-in statement (1:5)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "InvalidLhs" + } ], "program": { "type": "Program", 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 a68f97021f5d..6f62438350f5 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/418/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/418/output.json @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "Invalid left-hand side in for-in statement (1:5)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "InvalidLhs" + } ], "program": { "type": "Program", 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 a0bb1f5c08a4..91fd03d7a309 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/425/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/425/output.json @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":7,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":7}}, "errors": [ - "SyntaxError: Missing catch or finally clause (1:0)" + { + "$$ babel internal serialized type": "Error", + "message": "Missing catch or finally clause (1:0)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "NoCatchOrFinally" + } ], "program": { "type": "Program", 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 322359217c2d..918923edd61b 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/427/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/427/output.json @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":32,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":32}}, "errors": [ - "SyntaxError: Multiple default clauses (1:22)" + { + "$$ babel internal serialized type": "Error", + "message": "Multiple default clauses (1:22)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "MultipleDefaultsInSwitch" + } ], "program": { "type": "Program", 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 f0be819b2d86..4fa461032182 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/446/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/446/output.json @@ -2,8 +2,20 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "Expecting Unicode escape sequence \\uXXXX (1:1)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "MissingUnicodeEscape" + }, + { + "$$ babel internal serialized type": "Error", + "message": "Expecting Unicode escape sequence \\uXXXX (1:2)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "MissingUnicodeEscape" + } ], "program": { "type": "Program", 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 6c34e22a0044..87613b902f6f 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/447/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/447/output.json @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":6,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":6}}, "errors": [ - "SyntaxError: Invalid Unicode escape (1:0)" + { + "$$ babel internal serialized type": "Error", + "message": "Invalid Unicode escape (1:0)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "EscapedCharNotAnIdentifier" + } ], "program": { "type": "Program", 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 cc7b3b44d69e..8fd9ef4907d7 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/448/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/448/output.json @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":2,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":2}}, "errors": [ - "SyntaxError: Expecting Unicode escape sequence \\uXXXX (1:1)" + { + "$$ babel internal serialized type": "Error", + "message": "Expecting Unicode escape sequence \\uXXXX (1:1)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "MissingUnicodeEscape" + } ], "program": { "type": "Program", 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 3af7d55ae127..0191407e6fd9 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/449/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/449/output.json @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":6,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":6}}, "errors": [ - "SyntaxError: Invalid Unicode escape (1:0)" + { + "$$ babel internal serialized type": "Error", + "message": "Invalid Unicode escape (1:0)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "EscapedCharNotAnIdentifier" + } ], "program": { "type": "Program", 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 5875cb58be47..094a6bc338a8 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/454/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/454/output.json @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":6,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":6}}, "errors": [ - "SyntaxError: 'return' outside of function (1:0)" + { + "$$ babel internal serialized type": "Error", + "message": "'return' outside of function (1:0)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "IllegalReturn" + } ], "program": { "type": "Program", 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 8ce94b960543..33a45a224d2e 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/455/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/455/output.json @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":5,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":5}}, "errors": [ - "SyntaxError: Unsyntactic break (1:0)" + { + "$$ babel internal serialized type": "Error", + "message": "Unsyntactic break (1:0)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "IllegalBreakContinue" + } ], "program": { "type": "Program", 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 6d89822f1568..9f2f1645b5dc 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/456/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/456/output.json @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":8,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":8}}, "errors": [ - "SyntaxError: Unsyntactic continue (1:0)" + { + "$$ babel internal serialized type": "Error", + "message": "Unsyntactic continue (1:0)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "IllegalBreakContinue" + } ], "program": { "type": "Program", 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 37451db0ed1b..e13c15c081e6 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/457/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/457/output.json @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":33,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":33}}, "errors": [ - "SyntaxError: Unsyntactic continue (1:22)" + { + "$$ babel internal serialized type": "Error", + "message": "Unsyntactic continue (1:22)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "IllegalBreakContinue" + } ], "program": { "type": "Program", 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 ae9cb401dddc..e91e7dbb9529 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/459/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/459/output.json @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":25,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":25}}, "errors": [ - "SyntaxError: Unsyntactic break (1:15)" + { + "$$ babel internal serialized type": "Error", + "message": "Unsyntactic break (1:15)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "IllegalBreakContinue" + } ], "program": { "type": "Program", 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 39c5663443fe..40b52bd4de23 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/460/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/460/output.json @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":28,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":28}}, "errors": [ - "SyntaxError: Unsyntactic continue (1:15)" + { + "$$ babel internal serialized type": "Error", + "message": "Unsyntactic continue (1:15)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "IllegalBreakContinue" + } ], "program": { "type": "Program", 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 3939133b3b8a..fd411368ac52 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/461/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/461/output.json @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":47,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":47}}, "errors": [ - "SyntaxError: Unsyntactic break (1:33)" + { + "$$ babel internal serialized type": "Error", + "message": "Unsyntactic break (1:33)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "IllegalBreakContinue" + } ], "program": { "type": "Program", @@ -31,6 +37,10 @@ "expression": { "type": "FunctionExpression", "start":19,"end":43,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":43}}, + "extra": { + "parenthesized": true, + "parenStart": 18 + }, "id": null, "generator": false, "async": false, @@ -50,10 +60,6 @@ } ], "directives": [] - }, - "extra": { - "parenthesized": true, - "parenStart": 18 } } } diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/462/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/462/output.json index d65c7f7da91a..d52d09b915ea 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/462/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/462/output.json @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":50,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":50}}, "errors": [ - "SyntaxError: Unsyntactic continue (1:33)" + { + "$$ babel internal serialized type": "Error", + "message": "Unsyntactic continue (1:33)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "IllegalBreakContinue" + } ], "program": { "type": "Program", @@ -31,6 +37,10 @@ "expression": { "type": "FunctionExpression", "start":19,"end":46,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":46}}, + "extra": { + "parenthesized": true, + "parenStart": 18 + }, "id": null, "generator": false, "async": false, @@ -50,10 +60,6 @@ } ], "directives": [] - }, - "extra": { - "parenthesized": true, - "parenStart": 18 } } } diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/463/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/463/output.json index 336add4fe32c..861d573d9eb4 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/463/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/463/output.json @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":45,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":45}}, "errors": [ - "SyntaxError: Unsyntactic break (1:33)" + { + "$$ babel internal serialized type": "Error", + "message": "Unsyntactic break (1:33)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "IllegalBreakContinue" + } ], "program": { "type": "Program", @@ -31,6 +37,10 @@ "expression": { "type": "FunctionExpression", "start":19,"end":41,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":41}}, + "extra": { + "parenthesized": true, + "parenStart": 18 + }, "id": null, "generator": false, "async": false, @@ -46,10 +56,6 @@ } ], "directives": [] - }, - "extra": { - "parenthesized": true, - "parenStart": 18 } } } diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/464/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/464/output.json index ac86039c659b..85b83d9157f1 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/464/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/464/output.json @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":48,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":48}}, "errors": [ - "SyntaxError: Unsyntactic continue (1:33)" + { + "$$ babel internal serialized type": "Error", + "message": "Unsyntactic continue (1:33)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "IllegalBreakContinue" + } ], "program": { "type": "Program", @@ -31,6 +37,10 @@ "expression": { "type": "FunctionExpression", "start":19,"end":44,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":44}}, + "extra": { + "parenthesized": true, + "parenStart": 18 + }, "id": null, "generator": false, "async": false, @@ -46,10 +56,6 @@ } ], "directives": [] - }, - "extra": { - "parenthesized": true, - "parenStart": 18 } } } 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 815a430cb2b7..fa51ae23c01d 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/465/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/465/output.json @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":39,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":39}}, "errors": [ - "SyntaxError: Label 'x' is already declared (1:18)" + { + "$$ babel internal serialized type": "Error", + "message": "Label 'x' is already declared (1:18)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "LabelRedeclaration" + } ], "program": { "type": "Program", 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 392c525509d1..a1cd57f28de0 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/466/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/466/output.json @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "Deleting local variable in strict mode (1:29)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "StrictDelete" + } ], "program": { "type": "Program", @@ -16,6 +22,10 @@ "expression": { "type": "CallExpression", "start":1,"end":42,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":42}}, + "extra": { + "parenthesized": true, + "parenStart": 0 + }, "callee": { "type": "FunctionExpression", "start":1,"end":40,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":40}}, @@ -50,21 +60,17 @@ "value": { "type": "DirectiveLiteral", "start":15,"end":27,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":27}}, - "value": "use strict", "extra": { "raw": "'use strict'", "rawValue": "use strict" - } + }, + "value": "use strict" } } ] } }, - "arguments": [], - "extra": { - "parenthesized": true, - "parenStart": 0 - } + "arguments": [] } } ], 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 62cf67d34e04..370aef7f7336 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/467/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/467/output.json @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":43,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":43}}, "errors": [ - "SyntaxError: 'with' in strict mode (1:29)" + { + "$$ babel internal serialized type": "Error", + "message": "'with' in strict mode (1:29)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "StrictWith" + } ], "program": { "type": "Program", @@ -16,6 +22,10 @@ "expression": { "type": "CallExpression", "start":1,"end":42,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":42}}, + "extra": { + "parenthesized": true, + "parenStart": 0 + }, "callee": { "type": "FunctionExpression", "start":1,"end":40,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":40}}, @@ -48,21 +58,17 @@ "value": { "type": "DirectiveLiteral", "start":15,"end":27,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":27}}, - "value": "use strict", "extra": { "raw": "'use strict'", "rawValue": "use strict" - } + }, + "value": "use strict" } } ] } }, - "arguments": [], - "extra": { - "parenthesized": true, - "parenStart": 0 - } + "arguments": [] } } ], 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 fcd0ab9858ca..730f76e76dce 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/468/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/468/output.json @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":48,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":48}}, "errors": [ - "SyntaxError: Binding 'eval' in strict mode (1:36)" + { + "$$ babel internal serialized type": "Error", + "message": "Binding 'eval' in strict mode (1:36)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "StrictEvalArgumentsBinding" + } ], "program": { "type": "Program", @@ -58,11 +64,11 @@ "value": { "type": "DirectiveLiteral", "start":18,"end":30,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":30}}, - "value": "use strict", "extra": { "raw": "'use strict'", "rawValue": "use strict" - } + }, + "value": "use strict" } } ] diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/469/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/469/output.json index d557326e9973..ff64c7206235 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/469/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/469/output.json @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":53,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":53}}, "errors": [ - "SyntaxError: Binding 'arguments' in strict mode (1:36)" + { + "$$ babel internal serialized type": "Error", + "message": "Binding 'arguments' in strict mode (1:36)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "StrictEvalArgumentsBinding" + } ], "program": { "type": "Program", @@ -58,11 +64,11 @@ "value": { "type": "DirectiveLiteral", "start":18,"end":30,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":30}}, - "value": "use strict", "extra": { "raw": "'use strict'", "rawValue": "use strict" - } + }, + "value": "use strict" } } ] diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/470/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/470/output.json index 3040718fd546..f68377b17ee1 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/470/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/470/output.json @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":58,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":58}}, "errors": [ - "SyntaxError: Binding 'eval' in strict mode (1:47)" + { + "$$ babel internal serialized type": "Error", + "message": "Binding 'eval' in strict mode (1:47)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "StrictEvalArgumentsBinding" + } ], "program": { "type": "Program", @@ -59,11 +65,11 @@ "value": { "type": "DirectiveLiteral", "start":18,"end":30,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":30}}, - "value": "use strict", "extra": { "raw": "'use strict'", "rawValue": "use strict" - } + }, + "value": "use strict" } } ] diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/471/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/471/output.json index 429d686ed48c..1131bf5961bb 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/471/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/471/output.json @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":63,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":63}}, "errors": [ - "SyntaxError: Binding 'arguments' in strict mode (1:47)" + { + "$$ babel internal serialized type": "Error", + "message": "Binding 'arguments' in strict mode (1:47)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "StrictEvalArgumentsBinding" + } ], "program": { "type": "Program", @@ -59,11 +65,11 @@ "value": { "type": "DirectiveLiteral", "start":18,"end":30,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":30}}, - "value": "use strict", "extra": { "raw": "'use strict'", "rawValue": "use strict" - } + }, + "value": "use strict" } } ] diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/472/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/472/output.json index 79c71ebb542f..cd27d905217b 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/472/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/472/output.json @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "Assigning to 'eval' in strict mode (1:32)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "StrictEvalArguments" + } ], "program": { "type": "Program", @@ -56,11 +62,11 @@ "value": { "type": "DirectiveLiteral", "start":18,"end":30,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":30}}, - "value": "use strict", "extra": { "raw": "'use strict'", "rawValue": "use strict" - } + }, + "value": "use strict" } } ] diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/473/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/473/output.json index ec34fa9d5ce8..c7266f60979d 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/473/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/473/output.json @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "Assigning to 'arguments' in strict mode (1:32)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "StrictEvalArguments" + } ], "program": { "type": "Program", @@ -56,11 +62,11 @@ "value": { "type": "DirectiveLiteral", "start":18,"end":30,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":30}}, - "value": "use strict", "extra": { "raw": "'use strict'", "rawValue": "use strict" - } + }, + "value": "use strict" } } ] diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/474/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/474/output.json index 2ad942222305..7ebbee87cea4 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/474/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/474/output.json @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "Assigning to 'eval' in strict mode (1:34)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "StrictEvalArguments" + } ], "program": { "type": "Program", @@ -48,11 +54,11 @@ "value": { "type": "DirectiveLiteral", "start":18,"end":30,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":30}}, - "value": "use strict", "extra": { "raw": "'use strict'", "rawValue": "use strict" - } + }, + "value": "use strict" } } ] diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/475/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/475/output.json index c85c53c215da..1215cb9894dd 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/475/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/475/output.json @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "Assigning to 'eval' in strict mode (1:34)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "StrictEvalArguments" + } ], "program": { "type": "Program", @@ -48,11 +54,11 @@ "value": { "type": "DirectiveLiteral", "start":18,"end":30,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":30}}, - "value": "use strict", "extra": { "raw": "'use strict'", "rawValue": "use strict" - } + }, + "value": "use strict" } } ] diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/476/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/476/output.json index 8635017ed5c5..50d0e4da1906 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/476/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/476/output.json @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "Assigning to 'arguments' in strict mode (1:34)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "StrictEvalArguments" + } ], "program": { "type": "Program", @@ -48,11 +54,11 @@ "value": { "type": "DirectiveLiteral", "start":18,"end":30,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":30}}, - "value": "use strict", "extra": { "raw": "'use strict'", "rawValue": "use strict" - } + }, + "value": "use strict" } } ] diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/477/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/477/output.json index 0090b6011203..6c2748a1a843 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/477/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/477/output.json @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "Assigning to 'arguments' in strict mode (1:34)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "StrictEvalArguments" + } ], "program": { "type": "Program", @@ -48,11 +54,11 @@ "value": { "type": "DirectiveLiteral", "start":18,"end":30,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":30}}, - "value": "use strict", "extra": { "raw": "'use strict'", "rawValue": "use strict" - } + }, + "value": "use strict" } } ] diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/478/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/478/output.json index 439436ef7e82..774554855544 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/478/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/478/output.json @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "Assigning to 'eval' in strict mode (1:32)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "StrictEvalArguments" + } ], "program": { "type": "Program", @@ -48,11 +54,11 @@ "value": { "type": "DirectiveLiteral", "start":18,"end":30,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":30}}, - "value": "use strict", "extra": { "raw": "'use strict'", "rawValue": "use strict" - } + }, + "value": "use strict" } } ] diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/479/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/479/output.json index b68c731a58a7..0620f374261e 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/479/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/479/output.json @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "Assigning to 'eval' in strict mode (1:32)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "StrictEvalArguments" + } ], "program": { "type": "Program", @@ -48,11 +54,11 @@ "value": { "type": "DirectiveLiteral", "start":18,"end":30,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":30}}, - "value": "use strict", "extra": { "raw": "'use strict'", "rawValue": "use strict" - } + }, + "value": "use strict" } } ] diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/480/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/480/output.json index 52dbdc3d5ca5..9b7b4c72c4f7 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/480/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/480/output.json @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "Assigning to 'arguments' in strict mode (1:32)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "StrictEvalArguments" + } ], "program": { "type": "Program", @@ -48,11 +54,11 @@ "value": { "type": "DirectiveLiteral", "start":18,"end":30,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":30}}, - "value": "use strict", "extra": { "raw": "'use strict'", "rawValue": "use strict" - } + }, + "value": "use strict" } } ] diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/481/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/481/output.json index 48c2df5468eb..c18db72610c3 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/481/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/481/output.json @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "Assigning to 'arguments' in strict mode (1:32)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "StrictEvalArguments" + } ], "program": { "type": "Program", @@ -48,11 +54,11 @@ "value": { "type": "DirectiveLiteral", "start":18,"end":30,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":30}}, - "value": "use strict", "extra": { "raw": "'use strict'", "rawValue": "use strict" - } + }, + "value": "use strict" } } ] diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/482/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/482/output.json index 3c4ac7fd38dd..ab49aba8f4f6 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/482/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/482/output.json @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":53,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":53}}, "errors": [ - "SyntaxError: Binding 'eval' in strict mode (1:41)" + { + "$$ babel internal serialized type": "Error", + "message": "Binding 'eval' in strict mode (1:41)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "StrictEvalArgumentsBinding" + } ], "program": { "type": "Program", @@ -51,11 +57,11 @@ "value": { "type": "DirectiveLiteral", "start":18,"end":30,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":30}}, - "value": "use strict", "extra": { "raw": "'use strict'", "rawValue": "use strict" - } + }, + "value": "use strict" } } ] diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/483/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/483/output.json index e183294a232f..9e27051a9a6a 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/483/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/483/output.json @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":58,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":58}}, "errors": [ - "SyntaxError: Binding 'arguments' in strict mode (1:41)" + { + "$$ babel internal serialized type": "Error", + "message": "Binding 'arguments' in strict mode (1:41)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "StrictEvalArgumentsBinding" + } ], "program": { "type": "Program", @@ -51,11 +57,11 @@ "value": { "type": "DirectiveLiteral", "start":18,"end":30,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":30}}, - "value": "use strict", "extra": { "raw": "'use strict'", "rawValue": "use strict" - } + }, + "value": "use strict" } } ] diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/484/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/484/output.json index c252adad5c36..4425ab5ebcb4 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/484/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/484/output.json @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":32,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":32}}, "errors": [ - "SyntaxError: Binding 'eval' in strict mode (1:9)" + { + "$$ babel internal serialized type": "Error", + "message": "Binding 'eval' in strict mode (1:9)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "StrictEvalArgumentsBinding" + } ], "program": { "type": "Program", @@ -32,11 +38,11 @@ "value": { "type": "DirectiveLiteral", "start":17,"end":29,"loc":{"start":{"line":1,"column":17},"end":{"line":1,"column":29}}, - "value": "use strict", "extra": { "raw": "'use strict'", "rawValue": "use strict" - } + }, + "value": "use strict" } } ] diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/485/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/485/output.json index 2c691b4f70f1..9fbf885c95dd 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/485/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/485/output.json @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":37,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":37}}, "errors": [ - "SyntaxError: Binding 'arguments' in strict mode (1:9)" + { + "$$ babel internal serialized type": "Error", + "message": "Binding 'arguments' in strict mode (1:9)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "StrictEvalArgumentsBinding" + } ], "program": { "type": "Program", @@ -32,11 +38,11 @@ "value": { "type": "DirectiveLiteral", "start":22,"end":34,"loc":{"start":{"line":1,"column":22},"end":{"line":1,"column":34}}, - "value": "use strict", "extra": { "raw": "'use strict'", "rawValue": "use strict" - } + }, + "value": "use strict" } } ] diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/486/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/486/output.json index 9e3046fe279b..e95d1ad02518 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/486/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/486/output.json @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":57,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":57}}, "errors": [ - "SyntaxError: Binding 'eval' in strict mode (1:42)" + { + "$$ babel internal serialized type": "Error", + "message": "Binding 'eval' in strict mode (1:42)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "StrictEvalArgumentsBinding" + } ], "program": { "type": "Program", @@ -31,6 +37,10 @@ "expression": { "type": "CallExpression", "start":33,"end":54,"loc":{"start":{"line":1,"column":33},"end":{"line":1,"column":54}}, + "extra": { + "parenthesized": true, + "parenStart": 32 + }, "callee": { "type": "FunctionExpression", "start":33,"end":52,"loc":{"start":{"line":1,"column":33},"end":{"line":1,"column":52}}, @@ -49,11 +59,7 @@ "directives": [] } }, - "arguments": [], - "extra": { - "parenthesized": true, - "parenStart": 32 - } + "arguments": [] } } ], @@ -64,11 +70,11 @@ "value": { "type": "DirectiveLiteral", "start":18,"end":30,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":30}}, - "value": "use strict", "extra": { "raw": "'use strict'", "rawValue": "use strict" - } + }, + "value": "use strict" } } ] diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/487/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/487/output.json index 2502c52e184c..166aadd11830 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/487/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/487/output.json @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":62,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":62}}, "errors": [ - "SyntaxError: Binding 'arguments' in strict mode (1:42)" + { + "$$ babel internal serialized type": "Error", + "message": "Binding 'arguments' in strict mode (1:42)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "StrictEvalArgumentsBinding" + } ], "program": { "type": "Program", @@ -31,6 +37,10 @@ "expression": { "type": "CallExpression", "start":33,"end":59,"loc":{"start":{"line":1,"column":33},"end":{"line":1,"column":59}}, + "extra": { + "parenthesized": true, + "parenStart": 32 + }, "callee": { "type": "FunctionExpression", "start":33,"end":57,"loc":{"start":{"line":1,"column":33},"end":{"line":1,"column":57}}, @@ -49,11 +59,7 @@ "directives": [] } }, - "arguments": [], - "extra": { - "parenthesized": true, - "parenStart": 32 - } + "arguments": [] } } ], @@ -64,11 +70,11 @@ "value": { "type": "DirectiveLiteral", "start":18,"end":30,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":30}}, - "value": "use strict", "extra": { "raw": "'use strict'", "rawValue": "use strict" - } + }, + "value": "use strict" } } ] diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/488/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/488/output.json index 887c41149531..0605fbb60469 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/488/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/488/output.json @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":36,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":36}}, "errors": [ - "SyntaxError: Binding 'eval' in strict mode (1:10)" + { + "$$ babel internal serialized type": "Error", + "message": "Binding 'eval' in strict mode (1:10)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "StrictEvalArgumentsBinding" + } ], "program": { "type": "Program", @@ -19,6 +25,10 @@ "callee": { "type": "FunctionExpression", "start":1,"end":33,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":33}}, + "extra": { + "parenthesized": true, + "parenStart": 0 + }, "id": { "type": "Identifier", "start":10,"end":14,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":14},"identifierName":"eval"}, @@ -38,18 +48,14 @@ "value": { "type": "DirectiveLiteral", "start":18,"end":30,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":30}}, - "value": "use strict", "extra": { "raw": "'use strict'", "rawValue": "use strict" - } + }, + "value": "use strict" } } ] - }, - "extra": { - "parenthesized": true, - "parenStart": 0 } }, "arguments": [] diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/489/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/489/output.json index 250afef7d81d..0e2a1293a397 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/489/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/489/output.json @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":41,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":41}}, "errors": [ - "SyntaxError: Binding 'arguments' in strict mode (1:10)" + { + "$$ babel internal serialized type": "Error", + "message": "Binding 'arguments' in strict mode (1:10)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "StrictEvalArgumentsBinding" + } ], "program": { "type": "Program", @@ -19,6 +25,10 @@ "callee": { "type": "FunctionExpression", "start":1,"end":38,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":38}}, + "extra": { + "parenthesized": true, + "parenStart": 0 + }, "id": { "type": "Identifier", "start":10,"end":19,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":19},"identifierName":"arguments"}, @@ -38,18 +48,14 @@ "value": { "type": "DirectiveLiteral", "start":23,"end":35,"loc":{"start":{"line":1,"column":23},"end":{"line":1,"column":35}}, - "value": "use strict", "extra": { "raw": "'use strict'", "rawValue": "use strict" - } + }, + "value": "use strict" } } ] - }, - "extra": { - "parenthesized": true, - "parenStart": 0 } }, "arguments": [] diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/490/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/490/output.json index 03985eff0b57..4a30886ce75a 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/490/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/490/output.json @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":63,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":63}}, "errors": [ - "SyntaxError: Binding 'eval' in strict mode (1:47)" + { + "$$ babel internal serialized type": "Error", + "message": "Binding 'eval' in strict mode (1:47)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "StrictEvalArgumentsBinding" + } ], "program": { "type": "Program", @@ -31,6 +37,10 @@ "expression": { "type": "ObjectExpression", "start":33,"end":59,"loc":{"start":{"line":1,"column":33},"end":{"line":1,"column":59}}, + "extra": { + "parenthesized": true, + "parenStart": 32 + }, "properties": [ { "type": "ObjectProperty", @@ -62,11 +72,7 @@ } } } - ], - "extra": { - "parenthesized": true, - "parenStart": 32 - } + ] } } ], @@ -77,11 +83,11 @@ "value": { "type": "DirectiveLiteral", "start":18,"end":30,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":30}}, - "value": "use strict", "extra": { "raw": "'use strict'", "rawValue": "use strict" - } + }, + "value": "use strict" } } ] diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/491/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/491/output.json index 29ce013f0b8b..fedd7d72d685 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/491/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/491/output.json @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":39,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":39}}, "errors": [ - "SyntaxError: Binding 'package' in strict mode (1:10)" + { + "$$ babel internal serialized type": "Error", + "message": "Binding 'package' in strict mode (1:10)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "StrictEvalArgumentsBinding" + } ], "program": { "type": "Program", @@ -19,6 +25,10 @@ "callee": { "type": "FunctionExpression", "start":1,"end":36,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":36}}, + "extra": { + "parenthesized": true, + "parenStart": 0 + }, "id": { "type": "Identifier", "start":10,"end":17,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":17},"identifierName":"package"}, @@ -38,18 +48,14 @@ "value": { "type": "DirectiveLiteral", "start":21,"end":33,"loc":{"start":{"line":1,"column":21},"end":{"line":1,"column":33}}, - "value": "use strict", "extra": { "raw": "'use strict'", "rawValue": "use strict" - } + }, + "value": "use strict" } } ] - }, - "extra": { - "parenthesized": true, - "parenStart": 0 } }, "arguments": [] diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/492/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/492/output.json index 60d4df26f9f4..67e9140a9559 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/492/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/492/output.json @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":63,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":63}}, "errors": [ - "SyntaxError: Binding 'eval' in strict mode (1:48)" + { + "$$ babel internal serialized type": "Error", + "message": "Binding 'eval' in strict mode (1:48)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "StrictEvalArgumentsBinding" + } ], "program": { "type": "Program", @@ -31,6 +37,10 @@ "expression": { "type": "ObjectExpression", "start":33,"end":59,"loc":{"start":{"line":1,"column":33},"end":{"line":1,"column":59}}, + "extra": { + "parenthesized": true, + "parenStart": 32 + }, "properties": [ { "type": "ObjectProperty", @@ -81,11 +91,7 @@ "directives": [] } } - ], - "extra": { - "parenthesized": true, - "parenStart": 32 - } + ] } } ], @@ -96,11 +102,11 @@ "value": { "type": "DirectiveLiteral", "start":18,"end":30,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":30}}, - "value": "use strict", "extra": { "raw": "'use strict'", "rawValue": "use strict" - } + }, + "value": "use strict" } } ] diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/493/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/493/output.json index 4ee83b14028e..a8358afcb239 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/493/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/493/output.json @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":56,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":56}}, "errors": [ - "SyntaxError: Binding 'eval' in strict mode (1:41)" + { + "$$ babel internal serialized type": "Error", + "message": "Binding 'eval' in strict mode (1:41)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "StrictEvalArgumentsBinding" + } ], "program": { "type": "Program", @@ -31,6 +37,10 @@ "expression": { "type": "ObjectExpression", "start":33,"end":52,"loc":{"start":{"line":1,"column":33},"end":{"line":1,"column":52}}, + "extra": { + "parenthesized": true, + "parenStart": 32 + }, "properties": [ { "type": "ObjectMethod", @@ -60,11 +70,7 @@ "directives": [] } } - ], - "extra": { - "parenthesized": true, - "parenStart": 32 - } + ] } } ], @@ -75,11 +81,11 @@ "value": { "type": "DirectiveLiteral", "start":18,"end":30,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":30}}, - "value": "use strict", "extra": { "raw": "'use strict'", "rawValue": "use strict" - } + }, + "value": "use strict" } } ] diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/494/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/494/output.json index 0c8905156ab1..678ac30f9002 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/494/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/494/output.json @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":64,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":64}}, "errors": [ - "SyntaxError: Binding 'eval' in strict mode (1:49)" + { + "$$ babel internal serialized type": "Error", + "message": "Binding 'eval' in strict mode (1:49)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "StrictEvalArgumentsBinding" + } ], "program": { "type": "Program", @@ -31,6 +37,10 @@ "expression": { "type": "ObjectExpression", "start":33,"end":60,"loc":{"start":{"line":1,"column":33},"end":{"line":1,"column":60}}, + "extra": { + "parenthesized": true, + "parenStart": 32 + }, "properties": [ { "type": "ObjectProperty", @@ -68,11 +78,7 @@ } } } - ], - "extra": { - "parenthesized": true, - "parenStart": 32 - } + ] } } ], @@ -83,11 +89,11 @@ "value": { "type": "DirectiveLiteral", "start":18,"end":30,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":30}}, - "value": "use strict", "extra": { "raw": "'use strict'", "rawValue": "use strict" - } + }, + "value": "use strict" } } ] diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/495/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/495/output.json index 3ccaace1b183..32924b7bda1c 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/495/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/495/output.json @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":36,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":36}}, "errors": [ - "SyntaxError: Binding 'eval' in strict mode (1:15)" + { + "$$ babel internal serialized type": "Error", + "message": "Binding 'eval' in strict mode (1:15)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "StrictEvalArgumentsBinding" + } ], "program": { "type": "Program", @@ -38,11 +44,11 @@ "value": { "type": "DirectiveLiteral", "start":22,"end":34,"loc":{"start":{"line":1,"column":22},"end":{"line":1,"column":34}}, - "value": "use strict", "extra": { "raw": "'use strict'", "rawValue": "use strict" - } + }, + "value": "use strict" } } ] diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/496/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/496/output.json index dc142e76101d..f0feb545fff1 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/496/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/496/output.json @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":41,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":41}}, "errors": [ - "SyntaxError: Binding 'arguments' in strict mode (1:15)" + { + "$$ babel internal serialized type": "Error", + "message": "Binding 'arguments' in strict mode (1:15)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "StrictEvalArgumentsBinding" + } ], "program": { "type": "Program", @@ -38,11 +44,11 @@ "value": { "type": "DirectiveLiteral", "start":27,"end":39,"loc":{"start":{"line":1,"column":27},"end":{"line":1,"column":39}}, - "value": "use strict", "extra": { "raw": "'use strict'", "rawValue": "use strict" - } + }, + "value": "use strict" } } ] diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/497/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/497/output.json index d887db53f5e6..2056b8a15d11 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/497/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/497/output.json @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":58,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":58}}, "errors": [ - "SyntaxError: Binding 'eval' in strict mode (1:48)" + { + "$$ babel internal serialized type": "Error", + "message": "Binding 'eval' in strict mode (1:48)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "StrictEvalArgumentsBinding" + } ], "program": { "type": "Program", @@ -57,11 +63,11 @@ "value": { "type": "DirectiveLiteral", "start":19,"end":31,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":31}}, - "value": "use strict", "extra": { "raw": "'use strict'", "rawValue": "use strict" - } + }, + "value": "use strict" } } ] diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/498/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/498/output.json index ded181413784..12bda957fb2a 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/498/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/498/output.json @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":63,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":63}}, "errors": [ - "SyntaxError: Binding 'arguments' in strict mode (1:48)" + { + "$$ babel internal serialized type": "Error", + "message": "Binding 'arguments' in strict mode (1:48)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "StrictEvalArgumentsBinding" + } ], "program": { "type": "Program", @@ -57,11 +63,11 @@ "value": { "type": "DirectiveLiteral", "start":19,"end":31,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":31}}, - "value": "use strict", "extra": { "raw": "'use strict'", "rawValue": "use strict" - } + }, + "value": "use strict" } } ] diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/500/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/500/output.json index f4096149d8ed..90e5584d4060 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/500/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/500/output.json @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "Legacy octal literals are not allowed in strict mode (1:33)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "StrictOctalLiteral" + } ], "program": { "type": "Program", @@ -46,11 +52,11 @@ "value": { "type": "DirectiveLiteral", "start":19,"end":31,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":31}}, - "value": "use strict", "extra": { "raw": "'use strict'", "rawValue": "use strict" - } + }, + "value": "use strict" } } ] diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/502/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/502/output.json index 8caf22da60fa..7eb4eb85861d 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/502/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/502/output.json @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "Legacy octal literals are not allowed in strict mode (1:36)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "StrictOctalLiteral" + } ], "program": { "type": "Program", @@ -31,6 +37,10 @@ "expression": { "type": "ObjectExpression", "start":34,"end":45,"loc":{"start":{"line":1,"column":34},"end":{"line":1,"column":45}}, + "extra": { + "parenthesized": true, + "parenStart": 33 + }, "properties": [ { "type": "ObjectProperty", @@ -57,11 +67,7 @@ "value": 42 } } - ], - "extra": { - "parenthesized": true, - "parenStart": 33 - } + ] } } ], @@ -72,11 +78,11 @@ "value": { "type": "DirectiveLiteral", "start":19,"end":31,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":31}}, - "value": "use strict", "extra": { "raw": "'use strict'", "rawValue": "use strict" - } + }, + "value": "use strict" } } ] diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/504/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/504/output.json index a3eee1ca1117..b1182be3183e 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/504/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/504/output.json @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":50,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":50}}, "errors": [ - "SyntaxError: Unexpected reserved word 'implements' (1:37)" + { + "$$ babel internal serialized type": "Error", + "message": "Unexpected reserved word 'implements' (1:37)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "UnexpectedReservedWord" + } ], "program": { "type": "Program", @@ -50,11 +56,11 @@ "value": { "type": "DirectiveLiteral", "start":19,"end":31,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":31}}, - "value": "use strict", "extra": { "raw": "\"use strict\"", "rawValue": "use strict" - } + }, + "value": "use strict" } } ] diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/505/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/505/output.json index cffcb241d435..c07d768b3294 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/505/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/505/output.json @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":49,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":49}}, "errors": [ - "SyntaxError: Unexpected reserved word 'interface' (1:37)" + { + "$$ babel internal serialized type": "Error", + "message": "Unexpected reserved word 'interface' (1:37)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "UnexpectedReservedWord" + } ], "program": { "type": "Program", @@ -50,11 +56,11 @@ "value": { "type": "DirectiveLiteral", "start":19,"end":31,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":31}}, - "value": "use strict", "extra": { "raw": "\"use strict\"", "rawValue": "use strict" - } + }, + "value": "use strict" } } ] diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/506/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/506/output.json index 3d7bd0ac8ee4..2d4cfe81a876 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/506/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/506/output.json @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":47,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":47}}, "errors": [ - "SyntaxError: Unexpected reserved word 'package' (1:37)" + { + "$$ babel internal serialized type": "Error", + "message": "Unexpected reserved word 'package' (1:37)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "UnexpectedReservedWord" + } ], "program": { "type": "Program", @@ -50,11 +56,11 @@ "value": { "type": "DirectiveLiteral", "start":19,"end":31,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":31}}, - "value": "use strict", "extra": { "raw": "\"use strict\"", "rawValue": "use strict" - } + }, + "value": "use strict" } } ] diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/507/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/507/output.json index 4c1f2d2844f0..113617944c91 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/507/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/507/output.json @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":47,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":47}}, "errors": [ - "SyntaxError: Unexpected reserved word 'private' (1:37)" + { + "$$ babel internal serialized type": "Error", + "message": "Unexpected reserved word 'private' (1:37)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "UnexpectedReservedWord" + } ], "program": { "type": "Program", @@ -50,11 +56,11 @@ "value": { "type": "DirectiveLiteral", "start":19,"end":31,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":31}}, - "value": "use strict", "extra": { "raw": "\"use strict\"", "rawValue": "use strict" - } + }, + "value": "use strict" } } ] diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/508/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/508/output.json index dcf994402ae1..ae5ff7d0d042 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/508/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/508/output.json @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":49,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":49}}, "errors": [ - "SyntaxError: Unexpected reserved word 'protected' (1:37)" + { + "$$ babel internal serialized type": "Error", + "message": "Unexpected reserved word 'protected' (1:37)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "UnexpectedReservedWord" + } ], "program": { "type": "Program", @@ -50,11 +56,11 @@ "value": { "type": "DirectiveLiteral", "start":19,"end":31,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":31}}, - "value": "use strict", "extra": { "raw": "\"use strict\"", "rawValue": "use strict" - } + }, + "value": "use strict" } } ] diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/509/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/509/output.json index c7306ecdb68b..023c1501d5dc 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/509/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/509/output.json @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":46,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":46}}, "errors": [ - "SyntaxError: Unexpected reserved word 'public' (1:37)" + { + "$$ babel internal serialized type": "Error", + "message": "Unexpected reserved word 'public' (1:37)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "UnexpectedReservedWord" + } ], "program": { "type": "Program", @@ -50,11 +56,11 @@ "value": { "type": "DirectiveLiteral", "start":19,"end":31,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":31}}, - "value": "use strict", "extra": { "raw": "\"use strict\"", "rawValue": "use strict" - } + }, + "value": "use strict" } } ] diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/510/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/510/output.json index 41fd57994528..8eb41708d573 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/510/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/510/output.json @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":46,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":46}}, "errors": [ - "SyntaxError: Unexpected reserved word 'static' (1:37)" + { + "$$ babel internal serialized type": "Error", + "message": "Unexpected reserved word 'static' (1:37)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "UnexpectedReservedWord" + } ], "program": { "type": "Program", @@ -50,11 +56,11 @@ "value": { "type": "DirectiveLiteral", "start":19,"end":31,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":31}}, - "value": "use strict", "extra": { "raw": "\"use strict\"", "rawValue": "use strict" - } + }, + "value": "use strict" } } ] diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/511/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/511/output.json index 160544579047..5fe2e44483eb 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/511/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/511/output.json @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":40,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":40}}, "errors": [ - "SyntaxError: Binding 'static' in strict mode (1:15)" + { + "$$ babel internal serialized type": "Error", + "message": "Binding 'static' in strict mode (1:15)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "StrictEvalArgumentsBinding" + } ], "program": { "type": "Program", @@ -38,11 +44,11 @@ "value": { "type": "DirectiveLiteral", "start":25,"end":37,"loc":{"start":{"line":1,"column":25},"end":{"line":1,"column":37}}, - "value": "use strict", "extra": { "raw": "\"use strict\"", "rawValue": "use strict" - } + }, + "value": "use strict" } } ] diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/512/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/512/output.json index b184d5881724..36e6fdf31558 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/512/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/512/output.json @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":35,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":35}}, "errors": [ - "SyntaxError: Binding 'static' in strict mode (1:9)" + { + "$$ babel internal serialized type": "Error", + "message": "Binding 'static' in strict mode (1:9)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "StrictEvalArgumentsBinding" + } ], "program": { "type": "Program", @@ -32,11 +38,11 @@ "value": { "type": "DirectiveLiteral", "start":20,"end":32,"loc":{"start":{"line":1,"column":20},"end":{"line":1,"column":32}}, - "value": "use strict", "extra": { "raw": "\"use strict\"", "rawValue": "use strict" - } + }, + "value": "use strict" } } ] diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/513/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/513/output.json index 07cfc9324623..c20b9966edb0 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/513/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/513/output.json @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":35,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":35}}, "errors": [ - "SyntaxError: Unexpected reserved word 'static' (1:23)" + { + "$$ babel internal serialized type": "Error", + "message": "Unexpected reserved word 'static' (1:23)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "UnexpectedReservedWord" + } ], "program": { "type": "Program", @@ -36,11 +42,11 @@ "value": { "type": "DirectiveLiteral", "start":0,"end":12,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":12}}, - "value": "use strict", "extra": { "raw": "\"use strict\"", "rawValue": "use strict" - } + }, + "value": "use strict" } } ] diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/514/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/514/output.json index 3b77c9170b54..141319eee7d4 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/514/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/514/output.json @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":34,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":34}}, "errors": [ - "SyntaxError: Argument name clash (1:14)" + { + "$$ babel internal serialized type": "Error", + "message": "Argument name clash (1:14)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "ParamDupe" + } ], "program": { "type": "Program", @@ -43,11 +49,11 @@ "value": { "type": "DirectiveLiteral", "start":19,"end":31,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":31}}, - "value": "use strict", "extra": { "raw": "\"use strict\"", "rawValue": "use strict" - } + }, + "value": "use strict" } } ] diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/515/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/515/output.json index 0581517d990a..31e2bbac95ac 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/515/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/515/output.json @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":34,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":34}}, "errors": [ - "SyntaxError: Binding 'eval' in strict mode (1:11)" + { + "$$ babel internal serialized type": "Error", + "message": "Binding 'eval' in strict mode (1:11)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "StrictEvalArgumentsBinding" + } ], "program": { "type": "Program", @@ -38,11 +44,11 @@ "value": { "type": "DirectiveLiteral", "start":19,"end":31,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":31}}, - "value": "use strict", "extra": { "raw": "\"use strict\"", "rawValue": "use strict" - } + }, + "value": "use strict" } } ] diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/516/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/516/output.json index aafa09421ccc..d511ed85057c 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/516/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/516/output.json @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":37,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":37}}, "errors": [ - "SyntaxError: Binding 'package' in strict mode (1:11)" + { + "$$ babel internal serialized type": "Error", + "message": "Binding 'package' in strict mode (1:11)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "StrictEvalArgumentsBinding" + } ], "program": { "type": "Program", @@ -38,11 +44,11 @@ "value": { "type": "DirectiveLiteral", "start":22,"end":34,"loc":{"start":{"line":1,"column":22},"end":{"line":1,"column":34}}, - "value": "use strict", "extra": { "raw": "\"use strict\"", "rawValue": "use strict" - } + }, + "value": "use strict" } } ] diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/517/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/517/output.json index df3094e728a8..207be977d304 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/517/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/517/output.json @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":52,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":52}}, "errors": [ - "SyntaxError: Argument name clash (1:43)" + { + "$$ babel internal serialized type": "Error", + "message": "Argument name clash (1:43)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "ParamDupe" + } ], "program": { "type": "Program", @@ -66,11 +72,11 @@ "value": { "type": "DirectiveLiteral", "start":15,"end":27,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":27}}, - "value": "use strict", "extra": { "raw": "\"use strict\"", "rawValue": "use strict" - } + }, + "value": "use strict" } } ] diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/518/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/518/output.json index bcaf874206cd..bc75f3a9a56c 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/518/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/518/output.json @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":36,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":36}}, "errors": [ - "SyntaxError: Argument name clash (1:15)" + { + "$$ babel internal serialized type": "Error", + "message": "Argument name clash (1:15)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "ParamDupe" + } ], "program": { "type": "Program", @@ -16,6 +22,10 @@ "expression": { "type": "FunctionExpression", "start":1,"end":35,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":35}}, + "extra": { + "parenthesized": true, + "parenStart": 0 + }, "id": { "type": "Identifier", "start":10,"end":11,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":11},"identifierName":"a"}, @@ -46,18 +56,14 @@ "value": { "type": "DirectiveLiteral", "start":20,"end":32,"loc":{"start":{"line":1,"column":20},"end":{"line":1,"column":32}}, - "value": "use strict", "extra": { "raw": "\"use strict\"", "rawValue": "use strict" - } + }, + "value": "use strict" } } ] - }, - "extra": { - "parenthesized": true, - "parenStart": 0 } } } diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/519/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/519/output.json index 65f5a908f019..1389fc88584f 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/519/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/519/output.json @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":54,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":54}}, "errors": [ - "SyntaxError: Argument name clash (1:44)" + { + "$$ babel internal serialized type": "Error", + "message": "Argument name clash (1:44)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "ParamDupe" + } ], "program": { "type": "Program", @@ -31,6 +37,10 @@ "expression": { "type": "FunctionExpression", "start":30,"end":50,"loc":{"start":{"line":1,"column":30},"end":{"line":1,"column":50}}, + "extra": { + "parenthesized": true, + "parenStart": 29 + }, "id": { "type": "Identifier", "start":39,"end":40,"loc":{"start":{"line":1,"column":39},"end":{"line":1,"column":40},"identifierName":"b"}, @@ -55,10 +65,6 @@ "start":47,"end":50,"loc":{"start":{"line":1,"column":47},"end":{"line":1,"column":50}}, "body": [], "directives": [] - }, - "extra": { - "parenthesized": true, - "parenStart": 29 } } } @@ -70,11 +76,11 @@ "value": { "type": "DirectiveLiteral", "start":15,"end":27,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":27}}, - "value": "use strict", "extra": { "raw": "\"use strict\"", "rawValue": "use strict" - } + }, + "value": "use strict" } } ] diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/520/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/520/output.json index a1ab8b4653ea..0ce381c4a601 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/520/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/520/output.json @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":36,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":36}}, "errors": [ - "SyntaxError: Binding 'eval' in strict mode (1:12)" + { + "$$ babel internal serialized type": "Error", + "message": "Binding 'eval' in strict mode (1:12)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "StrictEvalArgumentsBinding" + } ], "program": { "type": "Program", @@ -16,6 +22,10 @@ "expression": { "type": "FunctionExpression", "start":1,"end":35,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":35}}, + "extra": { + "parenthesized": true, + "parenStart": 0 + }, "id": { "type": "Identifier", "start":10,"end":11,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":11},"identifierName":"a"}, @@ -41,18 +51,14 @@ "value": { "type": "DirectiveLiteral", "start":20,"end":32,"loc":{"start":{"line":1,"column":20},"end":{"line":1,"column":32}}, - "value": "use strict", "extra": { "raw": "\"use strict\"", "rawValue": "use strict" - } + }, + "value": "use strict" } } ] - }, - "extra": { - "parenthesized": true, - "parenStart": 0 } } } diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/521/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/521/output.json index 7caed97929d9..a57b71ec687d 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/521/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/521/output.json @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":39,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":39}}, "errors": [ - "SyntaxError: Binding 'package' in strict mode (1:12)" + { + "$$ babel internal serialized type": "Error", + "message": "Binding 'package' in strict mode (1:12)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "StrictEvalArgumentsBinding" + } ], "program": { "type": "Program", @@ -16,6 +22,10 @@ "expression": { "type": "FunctionExpression", "start":1,"end":38,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":38}}, + "extra": { + "parenthesized": true, + "parenStart": 0 + }, "id": { "type": "Identifier", "start":10,"end":11,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":11},"identifierName":"a"}, @@ -41,18 +51,14 @@ "value": { "type": "DirectiveLiteral", "start":23,"end":35,"loc":{"start":{"line":1,"column":23},"end":{"line":1,"column":35}}, - "value": "use strict", "extra": { "raw": "\"use strict\"", "rawValue": "use strict" - } + }, + "value": "use strict" } } ] - }, - "extra": { - "parenthesized": true, - "parenStart": 0 } } } diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/522/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/522/output.json index a53f5cb5d29e..2237c9f0c9d0 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/522/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/522/output.json @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "Legacy octal literals are not allowed in strict mode (1:65)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "StrictOctalLiteral" + } ], "program": { "type": "Program", @@ -32,11 +38,11 @@ "value": { "type": "DirectiveLiteral", "start":28,"end":40,"loc":{"start":{"line":1,"column":28},"end":{"line":1,"column":40}}, - "value": "use strict", "extra": { "raw": "\"use strict\"", "rawValue": "use strict" - } + }, + "value": "use strict" } } ] @@ -94,11 +100,11 @@ "value": { "type": "DirectiveLiteral", "start":0,"end":12,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":12}}, - "value": "use strict", "extra": { "raw": "\"use strict\"", "rawValue": "use strict" - } + }, + "value": "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 98b811bf5fd6..86130fd10c7d 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/523/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/523/output.json @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":14,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":14}}, "errors": [ - "SyntaxError: Unexpected keyword 'this' (1:4)" + { + "$$ babel internal serialized type": "Error", + "message": "Unexpected keyword 'this' (1:4)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "UnexpectedKeyword" + } ], "program": { "type": "Program", 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 4323a83f4c23..85406f9d0ec7 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/524/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/524/output.json @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":9,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":3}}, "errors": [ - "SyntaxError: Illegal newline after throw (1:5)" + { + "$$ babel internal serialized type": "Error", + "message": "Illegal newline after throw (1:5)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "NewlineAfterThrow" + } ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/536/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/536/output.json index 603923e34e5d..314263d8671f 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/536/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/536/output.json @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":8,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":8}}, "errors": [ - "SyntaxError: Const declarations require an initialization value (1:7)" + { + "$$ babel internal serialized type": "Error", + "message": "Const declarations require an initialization value (1:7)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "DeclarationMissingInitializer" + } ], "program": { "type": "Program", 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 87e0021bd4bb..75f3d0043661 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/544/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/544/output.json @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":39,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":25}}, "errors": [ - "SyntaxError: Unexpected reserved word 'public' (2:8)" + { + "$$ babel internal serialized type": "Error", + "message": "Unexpected reserved word 'public' (2:8)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "UnexpectedReservedWord" + } ], "program": { "type": "Program", @@ -24,6 +30,9 @@ { "type": "ObjectProperty", "start":22,"end":28,"loc":{"start":{"line":2,"column":8},"end":{"line":2,"column":14}}, + "extra": { + "shorthand": true + }, "method": false, "key": { "type": "Identifier", @@ -36,9 +45,6 @@ "type": "Identifier", "start":22,"end":28,"loc":{"start":{"line":2,"column":8},"end":{"line":2,"column":14},"identifierName":"public"}, "name": "public" - }, - "extra": { - "shorthand": true } } ] @@ -65,11 +71,11 @@ "value": { "type": "DirectiveLiteral", "start":0,"end":12,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":12}}, - "value": "use strict", "extra": { "raw": "\"use strict\"", "rawValue": "use strict" - } + }, + "value": "use strict" } } ] diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/545/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/545/output.json index d0a88458d8f9..ee9f646ecd81 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/545/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/545/output.json @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":25,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":25}}, "errors": [ - "SyntaxError: Unexpected reserved word 'public' (1:8)" + { + "$$ babel internal serialized type": "Error", + "message": "Unexpected reserved word 'public' (1:8)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "UnexpectedReservedWord" + } ], "program": { "type": "Program", @@ -24,6 +30,9 @@ { "type": "ObjectProperty", "start":8,"end":14,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":14}}, + "extra": { + "shorthand": true + }, "method": false, "key": { "type": "Identifier", @@ -36,9 +45,6 @@ "type": "Identifier", "start":8,"end":14,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":14},"identifierName":"public"}, "name": "public" - }, - "extra": { - "shorthand": true } } ] diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/550/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/550/output.json index e73c9a97f508..40b615aa2427 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/550/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/550/output.json @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "Legacy octal literals are not allowed in strict mode (2:10)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "StrictOctalLiteral" + } ], "program": { "type": "Program", @@ -43,11 +49,11 @@ "value": { "type": "DirectiveLiteral", "start":0,"end":12,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":12}}, - "value": "use strict", "extra": { "raw": "'use strict'", "rawValue": "use strict" - } + }, + "value": "use strict" } } ] diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/552/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/552/output.json index 765b5e13a1e5..0a9591215223 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/552/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/552/output.json @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "Legacy octal literals are not allowed in strict mode (2:10)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "StrictOctalLiteral" + } ], "program": { "type": "Program", @@ -43,11 +49,11 @@ "value": { "type": "DirectiveLiteral", "start":0,"end":12,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":12}}, - "value": "use strict", "extra": { "raw": "'use strict'", "rawValue": "use strict" - } + }, + "value": "use strict" } } ] 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 2770669d1421..4e49ae408bdc 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 @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "Unexpected trailing comma after rest element (1:5)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "RestTrailingComma" + } ], "program": { "type": "Program", 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 e854b9c5e72e..9c0584a04208 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 @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "Unexpected trailing comma after rest element (1:10)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "RestTrailingComma" + } ], "program": { "type": "Program", 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 9d70fca940ae..d9074e9a9404 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 @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "Unexpected trailing comma after rest element (1:6)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "RestTrailingComma" + } ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2015/arrow-functions/inner-parens-2/output.json b/packages/babel-parser/test/fixtures/es2015/arrow-functions/inner-parens-2/output.json index 09d15bfd29ff..72c663a7e4ca 100644 --- a/packages/babel-parser/test/fixtures/es2015/arrow-functions/inner-parens-2/output.json +++ b/packages/babel-parser/test/fixtures/es2015/arrow-functions/inner-parens-2/output.json @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":14,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":14}}, "errors": [ - "SyntaxError: Invalid parenthesized assignment pattern (1:5)" + { + "$$ babel internal serialized type": "Error", + "message": "Invalid parenthesized assignment pattern (1:5)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "InvalidParenthesizedAssignment" + } ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2015/arrow-functions/inner-parens-array-pattern-2/output.json b/packages/babel-parser/test/fixtures/es2015/arrow-functions/inner-parens-array-pattern-2/output.json index 9f5e348e9980..a858a1409dde 100644 --- a/packages/babel-parser/test/fixtures/es2015/arrow-functions/inner-parens-array-pattern-2/output.json +++ b/packages/babel-parser/test/fixtures/es2015/arrow-functions/inner-parens-array-pattern-2/output.json @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":27,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":27}}, "errors": [ - "SyntaxError: Invalid parenthesized assignment pattern (1:5)" + { + "$$ babel internal serialized type": "Error", + "message": "Invalid parenthesized assignment pattern (1:5)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "InvalidParenthesizedAssignment" + } ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2015/arrow-functions/inner-parens-array-pattern-3/output.json b/packages/babel-parser/test/fixtures/es2015/arrow-functions/inner-parens-array-pattern-3/output.json index 5283e2a52a8b..a62e6ede0658 100644 --- a/packages/babel-parser/test/fixtures/es2015/arrow-functions/inner-parens-array-pattern-3/output.json +++ b/packages/babel-parser/test/fixtures/es2015/arrow-functions/inner-parens-array-pattern-3/output.json @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":24,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":24}}, "errors": [ - "SyntaxError: Invalid parenthesized assignment pattern (1:3)" + { + "$$ babel internal serialized type": "Error", + "message": "Invalid parenthesized assignment pattern (1:3)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "InvalidParenthesizedAssignment" + } ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2015/arrow-functions/inner-parens-array-pattern/output.json b/packages/babel-parser/test/fixtures/es2015/arrow-functions/inner-parens-array-pattern/output.json index c2220d23a6d6..ca4cf0835d42 100644 --- a/packages/babel-parser/test/fixtures/es2015/arrow-functions/inner-parens-array-pattern/output.json +++ b/packages/babel-parser/test/fixtures/es2015/arrow-functions/inner-parens-array-pattern/output.json @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":13,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":13}}, "errors": [ - "SyntaxError: Invalid parenthesized assignment pattern (1:3)" + { + "$$ babel internal serialized type": "Error", + "message": "Invalid parenthesized assignment pattern (1:3)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "InvalidParenthesizedAssignment" + } ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2015/arrow-functions/inner-parens-object-pattern-member/output.json b/packages/babel-parser/test/fixtures/es2015/arrow-functions/inner-parens-object-pattern-member/output.json index e211f20e7d7f..c0fbf10ea0fb 100644 --- a/packages/babel-parser/test/fixtures/es2015/arrow-functions/inner-parens-object-pattern-member/output.json +++ b/packages/babel-parser/test/fixtures/es2015/arrow-functions/inner-parens-object-pattern-member/output.json @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":29,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":29}}, "errors": [ - "SyntaxError: Binding member expression (1:7)" + { + "$$ babel internal serialized type": "Error", + "message": "Binding member expression (1:7)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "InvalidPropertyBindingPattern" + } ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2015/arrow-functions/inner-parens-object-pattern/output.json b/packages/babel-parser/test/fixtures/es2015/arrow-functions/inner-parens-object-pattern/output.json index 0749c0ba9234..4f54d8d9511f 100644 --- a/packages/babel-parser/test/fixtures/es2015/arrow-functions/inner-parens-object-pattern/output.json +++ b/packages/babel-parser/test/fixtures/es2015/arrow-functions/inner-parens-object-pattern/output.json @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":25,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":25}}, "errors": [ - "SyntaxError: Invalid parenthesized assignment pattern (1:7)" + { + "$$ babel internal serialized type": "Error", + "message": "Invalid parenthesized assignment pattern (1:7)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "InvalidParenthesizedAssignment" + } ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2015/arrow-functions/inner-parens/output.json b/packages/babel-parser/test/fixtures/es2015/arrow-functions/inner-parens/output.json index 07989bd92794..f9d57ef8ae5f 100644 --- a/packages/babel-parser/test/fixtures/es2015/arrow-functions/inner-parens/output.json +++ b/packages/babel-parser/test/fixtures/es2015/arrow-functions/inner-parens/output.json @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":24,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":24}}, "errors": [ - "SyntaxError: Invalid parenthesized assignment pattern (1:12)" + { + "$$ babel internal serialized type": "Error", + "message": "Invalid parenthesized assignment pattern (1:12)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "InvalidParenthesizedAssignment" + } ], "program": { "type": "Program", 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 a7fb3e572421..7b01ef975992 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 @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "super is only allowed in object methods and classes (4:13)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "UnexpectedSuper" + } ], "program": { "type": "Program", @@ -24,12 +30,12 @@ "start":0,"end":6,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":6},"identifierName":"Object"}, "name": "Object" }, + "computed": false, "property": { "type": "Identifier", "start":7,"end":13,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":13},"identifierName":"create"}, "name": "create" - }, - "computed": false + } }, "arguments": [ { @@ -88,12 +94,12 @@ "type": "Super", "start":63,"end":68,"loc":{"start":{"line":4,"column":13},"end":{"line":4,"column":18}} }, + "computed": false, "property": { "type": "Identifier", "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 8813fbf71961..420159c017d2 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 @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "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)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "SuperNotAllowed" + } ], "program": { "type": "Program", 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 4fa31326d388..35f8a5c4b52c 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 @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":30,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "errors": [ - "SyntaxError: Argument name clash (2:11)" + { + "$$ babel internal serialized type": "Error", + "message": "Argument name clash (2:11)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "ParamDupe" + } ], "program": { "type": "Program", 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 d5de1e2c20d6..3a11b46f405f 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 @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "Classes may not have static property named prototype (2:10)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "StaticPrototype" + } ], "program": { "type": "Program", 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 c4d1636033ce..067c88704490 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 @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "Classes may not have static property named prototype (2:9)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "StaticPrototype" + } ], "program": { "type": "Program", 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 a135021f7ae8..6d128fd3814f 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 @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "getter must not have any formal parameters (2:2)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "BadGetterArity" + } ], "program": { "type": "Program", 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 8fa6cbb49774..9c4cde8b86d1 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 @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "super can only be used with function calls (i.e. super()) or in property accesses (i.e. super.prop or super[prop]) (3:4)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "UnsupportedSuper" + } ], "program": { "type": "Program", 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 5b9c55e234a8..27827cd88fd0 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 @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":64,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":7}}, "errors": [ - "SyntaxError: 'with' in strict mode (2:2)" + { + "$$ babel internal serialized type": "Error", + "message": "'with' in strict mode (2:2)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "StrictWith" + } ], "program": { "type": "Program", @@ -21,6 +27,10 @@ "superClass": { "type": "CallExpression", "start":17,"end":60,"loc":{"start":{"line":1,"column":17},"end":{"line":4,"column":3}}, + "extra": { + "parenthesized": true, + "parenStart": 16 + }, "callee": { "type": "FunctionExpression", "start":17,"end":58,"loc":{"start":{"line":1,"column":17},"end":{"line":4,"column":1}}, @@ -62,11 +72,7 @@ "directives": [] } }, - "arguments": [], - "extra": { - "parenthesized": true, - "parenStart": 16 - } + "arguments": [] }, "body": { "type": "ClassBody", diff --git a/packages/babel-parser/test/fixtures/es2015/destructuring/binding-arguments-module/output.json b/packages/babel-parser/test/fixtures/es2015/destructuring/binding-arguments-module/output.json index 66f3fdbdeedf..12b4fc59d4a6 100644 --- a/packages/babel-parser/test/fixtures/es2015/destructuring/binding-arguments-module/output.json +++ b/packages/babel-parser/test/fixtures/es2015/destructuring/binding-arguments-module/output.json @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":28,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":28}}, "errors": [ - "SyntaxError: Binding 'arguments' in strict mode (1:8)" + { + "$$ babel internal serialized type": "Error", + "message": "Binding 'arguments' in strict mode (1:8)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "StrictEvalArgumentsBinding" + } ], "program": { "type": "Program", @@ -24,6 +30,9 @@ { "type": "ObjectProperty", "start":8,"end":17,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":17}}, + "extra": { + "shorthand": true + }, "method": false, "key": { "type": "Identifier", @@ -36,9 +45,6 @@ "type": "Identifier", "start":8,"end":17,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":17},"identifierName":"arguments"}, "name": "arguments" - }, - "extra": { - "shorthand": true } } ] diff --git a/packages/babel-parser/test/fixtures/es2015/destructuring/binding-arguments-strict/output.json b/packages/babel-parser/test/fixtures/es2015/destructuring/binding-arguments-strict/output.json index 4fb224686603..587bf467c9f4 100644 --- a/packages/babel-parser/test/fixtures/es2015/destructuring/binding-arguments-strict/output.json +++ b/packages/babel-parser/test/fixtures/es2015/destructuring/binding-arguments-strict/output.json @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":42,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":28}}, "errors": [ - "SyntaxError: Binding 'arguments' in strict mode (2:8)" + { + "$$ babel internal serialized type": "Error", + "message": "Binding 'arguments' in strict mode (2:8)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "StrictEvalArgumentsBinding" + } ], "program": { "type": "Program", @@ -24,6 +30,9 @@ { "type": "ObjectProperty", "start":22,"end":31,"loc":{"start":{"line":2,"column":8},"end":{"line":2,"column":17}}, + "extra": { + "shorthand": true + }, "method": false, "key": { "type": "Identifier", @@ -36,9 +45,6 @@ "type": "Identifier", "start":22,"end":31,"loc":{"start":{"line":2,"column":8},"end":{"line":2,"column":17},"identifierName":"arguments"}, "name": "arguments" - }, - "extra": { - "shorthand": true } } ] @@ -65,11 +71,11 @@ "value": { "type": "DirectiveLiteral", "start":0,"end":12,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":12}}, - "value": "use strict", "extra": { "raw": "\"use strict\"", "rawValue": "use strict" - } + }, + "value": "use strict" } } ] diff --git a/packages/babel-parser/test/fixtures/es2015/destructuring/binding-eval/output.json b/packages/babel-parser/test/fixtures/es2015/destructuring/binding-eval/output.json index 9688161107e5..3bc1407f5d15 100644 --- a/packages/babel-parser/test/fixtures/es2015/destructuring/binding-eval/output.json +++ b/packages/babel-parser/test/fixtures/es2015/destructuring/binding-eval/output.json @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":39,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":39}}, "errors": [ - "SyntaxError: Assigning to 'eval' in strict mode (1:16)" + { + "$$ babel internal serialized type": "Error", + "message": "Assigning to 'eval' in strict mode (1:16)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "StrictEvalArguments" + } ], "program": { "type": "Program", @@ -16,6 +22,10 @@ "expression": { "type": "AssignmentExpression", "start":15,"end":38,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":38}}, + "extra": { + "parenthesized": true, + "parenStart": 14 + }, "operator": "=", "left": { "type": "ObjectPattern", @@ -24,6 +34,9 @@ { "type": "ObjectProperty", "start":16,"end":31,"loc":{"start":{"line":1,"column":16},"end":{"line":1,"column":31}}, + "extra": { + "shorthand": true + }, "method": false, "key": { "type": "Identifier", @@ -45,9 +58,6 @@ "start":23,"end":31,"loc":{"start":{"line":1,"column":23},"end":{"line":1,"column":31},"identifierName":"defValue"}, "name": "defValue" } - }, - "extra": { - "shorthand": true } } ] @@ -56,10 +66,6 @@ "type": "Identifier", "start":35,"end":38,"loc":{"start":{"line":1,"column":35},"end":{"line":1,"column":38},"identifierName":"obj"}, "name": "obj" - }, - "extra": { - "parenthesized": true, - "parenStart": 14 } } } @@ -71,11 +77,11 @@ "value": { "type": "DirectiveLiteral", "start":0,"end":12,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":12}}, - "value": "use strict", "extra": { "raw": "'use strict'", "rawValue": "use strict" - } + }, + "value": "use strict" } } ] diff --git a/packages/babel-parser/test/fixtures/es2015/destructuring/binding-this/output.json b/packages/babel-parser/test/fixtures/es2015/destructuring/binding-this/output.json index 0c6596304a0d..c75fbf15ab55 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 @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":18,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":18}}, "errors": [ - "SyntaxError: Unexpected keyword 'this' (1:6)" + { + "$$ babel internal serialized type": "Error", + "message": "Unexpected keyword 'this' (1:6)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "UnexpectedKeyword" + } ], "program": { "type": "Program", @@ -24,6 +30,9 @@ { "type": "ObjectProperty", "start":6,"end":10,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":10}}, + "extra": { + "shorthand": true + }, "method": false, "key": { "type": "Identifier", @@ -36,9 +45,6 @@ "type": "Identifier", "start":6,"end":10,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":10},"identifierName":"this"}, "name": "this" - }, - "extra": { - "shorthand": true } } ] diff --git a/packages/babel-parser/test/fixtures/es2015/destructuring/error-operator-for-default/output.json b/packages/babel-parser/test/fixtures/es2015/destructuring/error-operator-for-default/output.json index 9c735221c5fd..15b1c9fc432c 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 @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "Only '=' operator can be used for specifying default value. (1:3)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "MissingEqInAssignment" + } ], "program": { "type": "Program", @@ -16,6 +22,10 @@ "expression": { "type": "AssignmentExpression", "start":1,"end":13,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":13}}, + "extra": { + "parenthesized": true, + "parenStart": 0 + }, "operator": "=", "left": { "type": "ArrayPattern", @@ -41,10 +51,6 @@ "type": "Identifier", "start":12,"end":13,"loc":{"start":{"line":1,"column":12},"end":{"line":1,"column":13},"identifierName":"a"}, "name": "a" - }, - "extra": { - "parenthesized": true, - "parenStart": 0 } } } 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 f0bbee72ab6c..a61d7a62a3c4 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 @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":10,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":10}}, "errors": [ - "SyntaxError: Invalid parenthesized assignment pattern (1:1)" + { + "$$ babel internal serialized type": "Error", + "message": "Invalid parenthesized assignment pattern (1:1)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "InvalidParenthesizedAssignment" + } ], "program": { "type": "Program", @@ -20,17 +26,17 @@ "left": { "type": "ArrayPattern", "start":1,"end":4,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":4}}, + "extra": { + "parenthesized": true, + "parenStart": 0 + }, "elements": [ { "type": "Identifier", "start":2,"end":3,"loc":{"start":{"line":1,"column":2},"end":{"line":1,"column":3},"identifierName":"a"}, "name": "a" } - ], - "extra": { - "parenthesized": true, - "parenStart": 0 - } + ] }, "right": { "type": "NumericLiteral", diff --git a/packages/babel-parser/test/fixtures/es2015/destructuring/parenthesized-lhs-object/output.json b/packages/babel-parser/test/fixtures/es2015/destructuring/parenthesized-lhs-object/output.json index 2519d3595ff6..cecd6d3f1bc1 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 @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":10,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":10}}, "errors": [ - "SyntaxError: Invalid parenthesized assignment pattern (1:1)" + { + "$$ babel internal serialized type": "Error", + "message": "Invalid parenthesized assignment pattern (1:1)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "InvalidParenthesizedAssignment" + } ], "program": { "type": "Program", @@ -20,10 +26,17 @@ "left": { "type": "ObjectPattern", "start":1,"end":4,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":4}}, + "extra": { + "parenthesized": true, + "parenStart": 0 + }, "properties": [ { "type": "ObjectProperty", "start":2,"end":3,"loc":{"start":{"line":1,"column":2},"end":{"line":1,"column":3}}, + "extra": { + "shorthand": true + }, "method": false, "key": { "type": "Identifier", @@ -36,16 +49,9 @@ "type": "Identifier", "start":2,"end":3,"loc":{"start":{"line":1,"column":2},"end":{"line":1,"column":3},"identifierName":"a"}, "name": "a" - }, - "extra": { - "shorthand": true } } - ], - "extra": { - "parenthesized": true, - "parenStart": 0 - } + ] }, "right": { "type": "NumericLiteral", diff --git a/packages/babel-parser/test/fixtures/es2015/duplicate-proto/in-new-expression/output.json b/packages/babel-parser/test/fixtures/es2015/duplicate-proto/in-new-expression/output.json index 41eade104e2b..79e572e034b1 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 @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":53,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":53}}, "errors": [ - "SyntaxError: Redefinition of __proto__ property (1:24)" + { + "$$ babel internal serialized type": "Error", + "message": "Redefinition of __proto__ property (1:24)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "DuplicateProto" + } ], "program": { "type": "Program", @@ -59,12 +65,12 @@ } ] }, + "computed": false, "property": { "type": "Identifier", "start":43,"end":52,"loc":{"start":{"line":1,"column":43},"end":{"line":1,"column":52},"identifierName":"__proto__"}, "name": "__proto__" - }, - "computed": false + } }, "arguments": [] } 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 838c1aea7fd3..096b1dbfa83e 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 @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "Invalid left-hand side in for-loop (2:5)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "InvalidLhs" + } ], "program": { "type": "Program", 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 4e70874d2735..6f8e3624ce7a 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 @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "for-in loop variable declaration may not have an initializer (1:5)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "ForInOfLoopInitializer" + } ], "program": { "type": "Program", 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 c3c20c0a10f3..5156b6790eb1 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 @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "for-in loop variable declaration may not have an initializer (1:5)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "ForInOfLoopInitializer" + } ], "program": { "type": "Program", 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 26b3ee955998..ca4dde2d75df 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 @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "for-in loop variable declaration may not have an initializer (2:5)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "ForInOfLoopInitializer" + } ], "program": { "type": "Program", @@ -56,11 +62,11 @@ "value": { "type": "DirectiveLiteral", "start":0,"end":12,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":12}}, - "value": "use strict", "extra": { "raw": "'use strict'", "rawValue": "use strict" - } + }, + "value": "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 32755b31ea17..aaca427cba82 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 @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "for-in loop variable declaration may not have an initializer (1:5)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "ForInOfLoopInitializer" + } ], "program": { "type": "Program", 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 9bde6c44ee0c..84fdf49c7b0c 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 @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "for-in loop variable declaration may not have an initializer (1:5)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "ForInOfLoopInitializer" + } ], "program": { "type": "Program", @@ -27,6 +33,9 @@ { "type": "ObjectProperty", "start":10,"end":11,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":11}}, + "extra": { + "shorthand": true + }, "method": false, "key": { "type": "Identifier", @@ -39,9 +48,6 @@ "type": "Identifier", "start":10,"end":11,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":11},"identifierName":"a"}, "name": "a" - }, - "extra": { - "shorthand": true } } ] diff --git a/packages/babel-parser/test/fixtures/es2015/for-of/bare-initializer/output.json b/packages/babel-parser/test/fixtures/es2015/for-of/bare-initializer/output.json index 40500649a6b4..81b9d71d634b 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 @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "Invalid left-hand side in for-loop (2:5)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "InvalidLhs" + } ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2015/for-of/invalid-escape-of/output.json b/packages/babel-parser/test/fixtures/es2015/for-of/invalid-escape-of/output.json index 5b248b94f2a2..a6d10c8f1795 100644 --- a/packages/babel-parser/test/fixtures/es2015/for-of/invalid-escape-of/output.json +++ b/packages/babel-parser/test/fixtures/es2015/for-of/invalid-escape-of/output.json @@ -2,8 +2,20 @@ "type": "File", "start":0,"end":20,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":20}}, "errors": [ - "SyntaxError: Missing semicolon (1:6)", - "SyntaxError: Missing semicolon (1:14)" + { + "$$ babel internal serialized type": "Error", + "message": "Missing semicolon (1:6)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "MissingSemicolon" + }, + { + "$$ babel internal serialized type": "Error", + "message": "Missing semicolon (1:14)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "MissingSemicolon" + } ], "program": { "type": "Program", 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 f6604179cee6..b8b94e8c5d2b 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 @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "Can not use 'yield' as identifier inside a generator (1:16)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "YieldBindingIdentifier" + } ], "program": { "type": "Program", @@ -16,6 +22,10 @@ "expression": { "type": "FunctionExpression", "start":1,"end":29,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":29}}, + "extra": { + "parenthesized": true, + "parenStart": 0 + }, "id": null, "generator": true, "async": false, @@ -35,10 +45,6 @@ } ], "directives": [] - }, - "extra": { - "parenthesized": true, - "parenStart": 0 } } } 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 27beba5b2e65..cd6456aa8505 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 @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "Generators can only be declared at the top level or inside a block (1:16)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "GeneratorInSingleStatementContext" + } ], "program": { "type": "Program", 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 425fd47bc027..c3c1bbf20163 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 @@ -2,9 +2,27 @@ "type": "File", "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)", - "SyntaxError: Escape sequence in keyword const (3:0)" + { + "$$ babel internal serialized type": "Error", + "message": "Unexpected keyword 'const' (1:4)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "UnexpectedKeyword" + }, + { + "$$ babel internal serialized type": "Error", + "message": "Escape sequence in keyword const (1:4)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "InvalidEscapedReservedWord" + }, + { + "$$ babel internal serialized type": "Error", + "message": "Escape sequence in keyword const (3:0)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "InvalidEscapedReservedWord" + } ], "program": { "type": "Program", 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 9aa7fd43bbb8..b3d24ad324b4 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 @@ -2,9 +2,27 @@ "type": "File", "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)", - "SyntaxError: Escape sequence in keyword export (4:0)" + { + "$$ babel internal serialized type": "Error", + "message": "Unexpected keyword 'export' (1:4)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "UnexpectedKeyword" + }, + { + "$$ babel internal serialized type": "Error", + "message": "Escape sequence in keyword export (1:4)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "InvalidEscapedReservedWord" + }, + { + "$$ babel internal serialized type": "Error", + "message": "Escape sequence in keyword export (4:0)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "InvalidEscapedReservedWord" + } ], "program": { "type": "Program", 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 a9fc063b1be8..d84a44adad88 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 @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":22,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":22}}, "errors": [ - "SyntaxError: Escape sequence in keyword if (1:0)" + { + "$$ babel internal serialized type": "Error", + "message": "Escape sequence in keyword if (1:0)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "InvalidEscapedReservedWord" + } ], "program": { "type": "Program", 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 0533a2a4de2a..d7401280b394 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 @@ -2,9 +2,27 @@ "type": "File", "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)", - "SyntaxError: Escape sequence in keyword import (3:0)" + { + "$$ babel internal serialized type": "Error", + "message": "Unexpected keyword 'import' (1:4)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "UnexpectedKeyword" + }, + { + "$$ babel internal serialized type": "Error", + "message": "Escape sequence in keyword import (1:4)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "InvalidEscapedReservedWord" + }, + { + "$$ babel internal serialized type": "Error", + "message": "Escape sequence in keyword import (3:0)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "InvalidEscapedReservedWord" + } ], "program": { "type": "Program", 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 1205de6403ef..327c35889240 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 @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":9,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":9}}, "errors": [ - "SyntaxError: Escape sequence in keyword null (1:0)" + { + "$$ babel internal serialized type": "Error", + "message": "Escape sequence in keyword null (1:0)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "InvalidEscapedReservedWord" + } ], "program": { "type": "Program", 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 13d4895854d3..83cb1b8bbf1c 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 @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":9,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":9}}, "errors": [ - "SyntaxError: Escape sequence in keyword true (1:0)" + { + "$$ babel internal serialized type": "Error", + "message": "Escape sequence in keyword true (1:0)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "InvalidEscapedReservedWord" + } ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2015/let/invalid-escape/output.json b/packages/babel-parser/test/fixtures/es2015/let/invalid-escape/output.json index 481ab58d62c4..5b9ee9531db7 100644 --- a/packages/babel-parser/test/fixtures/es2015/let/invalid-escape/output.json +++ b/packages/babel-parser/test/fixtures/es2015/let/invalid-escape/output.json @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":14,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":14}}, "errors": [ - "SyntaxError: Missing semicolon (1:8)" + { + "$$ babel internal serialized type": "Error", + "message": "Missing semicolon (1:8)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "MissingSemicolon" + } ], "program": { "type": "Program", 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 c45edc3f9592..4dbddaad4c9b 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 @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":21,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":7}}, "errors": [ - "SyntaxError: Unexpected reserved word 'let' (2:0)" + { + "$$ babel internal serialized type": "Error", + "message": "Unexpected reserved word 'let' (2:0)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "UnexpectedReservedWord" + } ], "program": { "type": "Program", @@ -41,11 +47,11 @@ "value": { "type": "DirectiveLiteral", "start":0,"end":12,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":12}}, - "value": "use strict", "extra": { "raw": "\"use strict\"", "rawValue": "use strict" - } + }, + "value": "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 12a2c9548cf4..40ce797bc5fb 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 @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "'let' is not allowed to be used as a name in 'let' or 'const' declarations. (1:6)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "LetInLexicalBinding" + } ], "program": { "type": "Program", @@ -24,6 +30,9 @@ { "type": "ObjectProperty", "start":6,"end":9,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":9}}, + "extra": { + "shorthand": true + }, "method": false, "key": { "type": "Identifier", @@ -36,9 +45,6 @@ "type": "Identifier", "start":6,"end":9,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":9},"identifierName":"let"}, "name": "let" - }, - "extra": { - "shorthand": true } } ] 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 978664b05799..b5af2d5c7f81 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 @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "'let' is not allowed to be used as a name in 'let' or 'const' declarations. (1:8)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "LetInLexicalBinding" + } ], "program": { "type": "Program", @@ -24,6 +30,9 @@ { "type": "ObjectProperty", "start":8,"end":11,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":11}}, + "extra": { + "shorthand": true + }, "method": false, "key": { "type": "Identifier", @@ -36,9 +45,6 @@ "type": "Identifier", "start":8,"end":11,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":11},"identifierName":"let"}, "name": "let" - }, - "extra": { - "shorthand": true } } ] 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 5b853db406eb..d2275b68c167 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 @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "'let' is not allowed to be used as a name in 'let' or 'const' declarations. (1:5)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "LetInLexicalBinding" + } ], "program": { "type": "Program", 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 908c57bb93e5..fea1b54a4df0 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 @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "'let' is not allowed to be used as a name in 'let' or 'const' declarations. (1:7)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "LetInLexicalBinding" + } ], "program": { "type": "Program", 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 b2f6cfd13568..ca5fad379d8f 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 @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "'let' is not allowed to be used as a name in 'let' or 'const' declarations. (1:4)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "LetInLexicalBinding" + } ], "program": { "type": "Program", 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 1cd48f97ea7b..15d4c57c8025 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 @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "'let' is not allowed to be used as a name in 'let' or 'const' declarations. (1:6)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "LetInLexicalBinding" + } ], "program": { "type": "Program", 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 22e958dfc7ad..66a1fbe95b1d 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 @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "'let' is not allowed to be used as a name in 'let' or 'const' declarations. (2:6)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "LetInLexicalBinding" + } ], "program": { "type": "Program", 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 eee1bada9870..acba8c587d5e 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 @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "new.target can only be used in functions (2:2)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "UnexpectedNewTarget" + } ], "program": { "type": "Program", 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 525e9f0ba047..e79ad26f42e4 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 @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "The only valid meta property for new is new.target (2:6)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "UnsupportedMetaProperty" + } ], "program": { "type": "Program", 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 95fcf34a01ab..700bc80b4815 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 @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":33,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":33}}, "errors": [ - "SyntaxError: Escape sequence in keyword new (1:15)" + { + "$$ babel internal serialized type": "Error", + "message": "Escape sequence in keyword new (1:15)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "InvalidEscapedReservedWord" + } ], "program": { "type": "Program", 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 6524f1e405ef..30388b859ac0 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 @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "The only valid meta property for new is new.target (1:19)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "UnsupportedMetaProperty" + } ], "program": { "type": "Program", 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 eac0709d91ee..f75dc15895af 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 @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "new.target can only be used in functions (1:0)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "UnexpectedNewTarget" + } ], "program": { "type": "Program", 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 c2f48e113192..9b08c774def8 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 @@ -2,8 +2,20 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "Only one default export allowed per module. (2:9)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "DuplicateDefaultExport" + }, + { + "$$ babel internal serialized type": "Error", + "message": "Export 'foo' is not defined (2:9)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "ModuleExportUndefined" + } ], "program": { "type": "Program", 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 59fd6339b34e..3d944a19ee23 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 @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "Only one default export allowed per module. (2:0)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "DuplicateDefaultExport" + } ], "program": { "type": "Program", 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 2c706885c52f..fe438ef08bba 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 @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "`Foo` has already been exported. Exported identifiers must be unique. (2:0)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "DuplicateExport" + } ], "program": { "type": "Program", 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 254af5e59656..f995a1f30e7c 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 @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "`foo` has already been exported. Exported identifiers must be unique. (2:15)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "DuplicateExport" + } ], "program": { "type": "Program", @@ -51,6 +57,9 @@ { "type": "ObjectProperty", "start":31,"end":38,"loc":{"start":{"line":2,"column":15},"end":{"line":2,"column":22}}, + "extra": { + "shorthand": true + }, "method": false, "key": { "type": "Identifier", @@ -76,9 +85,6 @@ }, "value": 1 } - }, - "extra": { - "shorthand": true } } ] 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 119ea1be6c04..c4c9993b9f45 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 @@ -2,8 +2,20 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "Identifier 'foo' has already been declared (2:20)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "VarRedeclaration" + }, + { + "$$ babel internal serialized type": "Error", + "message": "`foo` has already been exported. Exported identifiers must be unique. (2:20)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "DuplicateExport" + } ], "program": { "type": "Program", @@ -77,6 +89,9 @@ { "type": "ObjectProperty", "start":46,"end":49,"loc":{"start":{"line":2,"column":20},"end":{"line":2,"column":23}}, + "extra": { + "shorthand": true + }, "method": false, "key": { "type": "Identifier", @@ -89,9 +104,6 @@ "type": "Identifier", "start":46,"end":49,"loc":{"start":{"line":2,"column":20},"end":{"line":2,"column":23},"identifierName":"foo"}, "name": "foo" - }, - "extra": { - "shorthand": true } } ] diff --git a/packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-destructuring11/output.json b/packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-destructuring11/output.json index 933af6bc6d6d..ea56f6659d4b 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 @@ -2,8 +2,20 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "Identifier 'foo4' has already been declared (2:50)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "VarRedeclaration" + }, + { + "$$ babel internal serialized type": "Error", + "message": "`foo4` has already been exported. Exported identifiers must be unique. (2:50)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "DuplicateExport" + } ], "program": { "type": "Program", @@ -81,6 +93,9 @@ { "type": "ObjectProperty", "start":49,"end":52,"loc":{"start":{"line":2,"column":22},"end":{"line":2,"column":25}}, + "extra": { + "shorthand": true + }, "method": false, "key": { "type": "Identifier", @@ -93,9 +108,6 @@ "type": "Identifier", "start":49,"end":52,"loc":{"start":{"line":2,"column":22},"end":{"line":2,"column":25},"identifierName":"foo"}, "name": "foo" - }, - "extra": { - "shorthand": true } } ] diff --git a/packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-destructuring12/output.json b/packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-destructuring12/output.json index c5c74319fb0f..ca36e60bd027 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 @@ -2,8 +2,20 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "Identifier 'foo4' has already been declared (2:49)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "VarRedeclaration" + }, + { + "$$ babel internal serialized type": "Error", + "message": "`foo4` has already been exported. Exported identifiers must be unique. (2:49)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "DuplicateExport" + } ], "program": { "type": "Program", @@ -77,6 +89,9 @@ { "type": "ObjectProperty", "start":48,"end":51,"loc":{"start":{"line":2,"column":21},"end":{"line":2,"column":24}}, + "extra": { + "shorthand": true + }, "method": false, "key": { "type": "Identifier", @@ -89,9 +104,6 @@ "type": "Identifier", "start":48,"end":51,"loc":{"start":{"line":2,"column":21},"end":{"line":2,"column":24},"identifierName":"foo"}, "name": "foo" - }, - "extra": { - "shorthand": true } } ] diff --git a/packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-destructuring13/output.json b/packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-destructuring13/output.json index 2e17d443f69c..0f1b347bc57b 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 @@ -2,8 +2,20 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "Identifier 'foo4' has already been declared (2:58)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "VarRedeclaration" + }, + { + "$$ babel internal serialized type": "Error", + "message": "`foo4` has already been exported. Exported identifiers must be unique. (2:58)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "DuplicateExport" + } ], "program": { "type": "Program", @@ -99,6 +111,9 @@ { "type": "ObjectProperty", "start":62,"end":63,"loc":{"start":{"line":2,"column":35},"end":{"line":2,"column":36}}, + "extra": { + "shorthand": true + }, "method": false, "key": { "type": "Identifier", @@ -111,9 +126,6 @@ "type": "Identifier", "start":62,"end":63,"loc":{"start":{"line":2,"column":35},"end":{"line":2,"column":36},"identifierName":"b"}, "name": "b" - }, - "extra": { - "shorthand": true } }, { diff --git a/packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-destructuring14/output.json b/packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-destructuring14/output.json index c0baf34cf9a6..e416a3e36273 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 @@ -2,8 +2,20 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "Identifier 'foo' has already been declared (2:21)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "VarRedeclaration" + }, + { + "$$ babel internal serialized type": "Error", + "message": "`foo` has already been exported. Exported identifiers must be unique. (2:21)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "DuplicateExport" + } ], "program": { "type": "Program", 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 3d24d4832079..cbd4adffa229 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 @@ -2,8 +2,20 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "Identifier 'foo2' has already been declared (2:13)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "VarRedeclaration" + }, + { + "$$ babel internal serialized type": "Error", + "message": "`foo2` has already been exported. Exported identifiers must be unique. (2:13)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "DuplicateExport" + } ], "program": { "type": "Program", 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 02547f2eee7d..485acd9a1041 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 @@ -2,8 +2,20 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "Identifier 'foo' has already been declared (2:22)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "VarRedeclaration" + }, + { + "$$ babel internal serialized type": "Error", + "message": "`foo` has already been exported. Exported identifiers must be unique. (2:22)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "DuplicateExport" + } ], "program": { "type": "Program", 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 df81eb4ac1a5..534d5ae76d68 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 @@ -2,8 +2,20 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "Identifier 'bar' has already been declared (2:13)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "VarRedeclaration" + }, + { + "$$ babel internal serialized type": "Error", + "message": "`bar` has already been exported. Exported identifiers must be unique. (2:13)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "DuplicateExport" + } ], "program": { "type": "Program", 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 23ff7e9f4422..2b2fc05c4fe6 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 @@ -2,8 +2,20 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "Identifier 'foo' has already been declared (2:28)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "VarRedeclaration" + }, + { + "$$ babel internal serialized type": "Error", + "message": "`foo` has already been exported. Exported identifiers must be unique. (2:28)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "DuplicateExport" + } ], "program": { "type": "Program", 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 2c99a1b1d6ae..f177f0dc0f9b 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 @@ -2,8 +2,20 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "Identifier 'foo' has already been declared (2:29)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "VarRedeclaration" + }, + { + "$$ babel internal serialized type": "Error", + "message": "`foo` has already been exported. Exported identifiers must be unique. (2:29)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "DuplicateExport" + } ], "program": { "type": "Program", 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 4673f3337235..cd0ba6767ec1 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 @@ -2,8 +2,20 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "Identifier 'foo' has already been declared (2:15)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "VarRedeclaration" + }, + { + "$$ babel internal serialized type": "Error", + "message": "`foo` has already been exported. Exported identifiers must be unique. (2:15)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "DuplicateExport" + } ], "program": { "type": "Program", @@ -58,6 +70,9 @@ { "type": "ObjectProperty", "start":41,"end":44,"loc":{"start":{"line":2,"column":15},"end":{"line":2,"column":18}}, + "extra": { + "shorthand": true + }, "method": false, "key": { "type": "Identifier", @@ -70,9 +85,6 @@ "type": "Identifier", "start":41,"end":44,"loc":{"start":{"line":2,"column":15},"end":{"line":2,"column":18},"identifierName":"foo"}, "name": "foo" - }, - "extra": { - "shorthand": true } } ] diff --git a/packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-destructuring3/output.json b/packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-destructuring3/output.json index 300af91efc82..ff2ef5ae54ec 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 @@ -2,8 +2,20 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "Identifier 'foo' has already been declared (2:16)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "VarRedeclaration" + }, + { + "$$ babel internal serialized type": "Error", + "message": "`foo` has already been exported. Exported identifiers must be unique. (2:0)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "DuplicateExport" + } ], "program": { "type": "Program", @@ -30,6 +42,9 @@ { "type": "ObjectProperty", "start":15,"end":18,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":18}}, + "extra": { + "shorthand": true + }, "method": false, "key": { "type": "Identifier", @@ -42,9 +57,6 @@ "type": "Identifier", "start":15,"end":18,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":18},"identifierName":"foo"}, "name": "foo" - }, - "extra": { - "shorthand": true } } ] diff --git a/packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-destructuring4/output.json b/packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-destructuring4/output.json index 54ca454dbed6..71136d918bff 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 @@ -2,8 +2,20 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "Identifier 'foo' has already been declared (2:14)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "VarRedeclaration" + }, + { + "$$ babel internal serialized type": "Error", + "message": "`foo` has already been exported. Exported identifiers must be unique. (2:14)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "DuplicateExport" + } ], "program": { "type": "Program", 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 f8265d2b7780..8429cb8a1a68 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 @@ -2,8 +2,20 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "Identifier 'foo' has already been declared (2:16)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "VarRedeclaration" + }, + { + "$$ babel internal serialized type": "Error", + "message": "`foo` has already been exported. Exported identifiers must be unique. (2:0)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "DuplicateExport" + } ], "program": { "type": "Program", 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 74dc3d4b6e5f..5337b7f94432 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 @@ -2,8 +2,20 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "Identifier 'foo' has already been declared (2:14)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "VarRedeclaration" + }, + { + "$$ babel internal serialized type": "Error", + "message": "`foo` has already been exported. Exported identifiers must be unique. (2:14)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "DuplicateExport" + } ], "program": { "type": "Program", @@ -30,6 +42,9 @@ { "type": "ObjectProperty", "start":15,"end":18,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":18}}, + "extra": { + "shorthand": true + }, "method": false, "key": { "type": "Identifier", @@ -42,9 +57,6 @@ "type": "Identifier", "start":15,"end":18,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":18},"identifierName":"foo"}, "name": "foo" - }, - "extra": { - "shorthand": true } } ] diff --git a/packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-destructuring7/output.json b/packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-destructuring7/output.json index 90a9d8e8df78..961738fb763d 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 @@ -2,8 +2,20 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "Identifier 'foo' has already been declared (2:15)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "VarRedeclaration" + }, + { + "$$ babel internal serialized type": "Error", + "message": "`foo` has already been exported. Exported identifiers must be unique. (2:15)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "DuplicateExport" + } ], "program": { "type": "Program", @@ -63,6 +75,9 @@ { "type": "ObjectProperty", "start":41,"end":44,"loc":{"start":{"line":2,"column":15},"end":{"line":2,"column":18}}, + "extra": { + "shorthand": true + }, "method": false, "key": { "type": "Identifier", @@ -75,9 +90,6 @@ "type": "Identifier", "start":41,"end":44,"loc":{"start":{"line":2,"column":15},"end":{"line":2,"column":18},"identifierName":"foo"}, "name": "foo" - }, - "extra": { - "shorthand": true } } ] diff --git a/packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-destructuring8/output.json b/packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-destructuring8/output.json index b09cb52efb83..2d62c3630604 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 @@ -2,8 +2,20 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "Identifier 'Foo' has already been declared (2:15)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "VarRedeclaration" + }, + { + "$$ babel internal serialized type": "Error", + "message": "`Foo` has already been exported. Exported identifiers must be unique. (2:15)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "DuplicateExport" + } ], "program": { "type": "Program", @@ -55,6 +67,9 @@ { "type": "ObjectProperty", "start":36,"end":39,"loc":{"start":{"line":2,"column":15},"end":{"line":2,"column":18}}, + "extra": { + "shorthand": true + }, "method": false, "key": { "type": "Identifier", @@ -67,9 +82,6 @@ "type": "Identifier", "start":36,"end":39,"loc":{"start":{"line":2,"column":15},"end":{"line":2,"column":18},"identifierName":"Foo"}, "name": "Foo" - }, - "extra": { - "shorthand": true } } ] diff --git a/packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-destructuring9/output.json b/packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-destructuring9/output.json index db65b77d4d43..742be67ed0ac 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 @@ -2,8 +2,20 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "Identifier 'Foo' has already been declared (2:14)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "VarRedeclaration" + }, + { + "$$ babel internal serialized type": "Error", + "message": "`Foo` has already been exported. Exported identifiers must be unique. (2:14)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "DuplicateExport" + } ], "program": { "type": "Program", 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 411c0c758dce..e9f75ee717a6 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 @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "`foo` has already been exported. Exported identifiers must be unique. (2:0)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "DuplicateExport" + } ], "program": { "type": "Program", 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 65c91019ea3a..73899e731682 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 @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "`foo` has already been exported. Exported identifiers must be unique. (2:13)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "DuplicateExport" + } ], "program": { "type": "Program", 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 86c07bcfa5b0..b7487fc1e95e 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 @@ -2,9 +2,27 @@ "type": "File", "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)", - "SyntaxError: Export 'bar' is not defined (2:9)" + { + "$$ babel internal serialized type": "Error", + "message": "`foo` has already been exported. Exported identifiers must be unique. (2:9)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "DuplicateExport" + }, + { + "$$ babel internal serialized type": "Error", + "message": "Export 'foo' is not defined (1:9)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "ModuleExportUndefined" + }, + { + "$$ babel internal serialized type": "Error", + "message": "Export 'bar' is not defined (2:9)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "ModuleExportUndefined" + } ], "program": { "type": "Program", 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 ab2ca9601162..45e822c17722 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 @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":30,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":30}}, "errors": [ - "SyntaxError: Unexpected keyword 'default' (1:9)" + { + "$$ babel internal serialized type": "Error", + "message": "Unexpected keyword 'default' (1:9)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "UnexpectedKeyword" + } ], "program": { "type": "Program", 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 d4df45baefea..c06eef24663e 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 @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":29,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":29}}, "errors": [ - "SyntaxError: Unexpected keyword 'typeof' (1:9)" + { + "$$ babel internal serialized type": "Error", + "message": "Unexpected keyword 'typeof' (1:9)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "UnexpectedKeyword" + } ], "program": { "type": "Program", 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 95070d9dab76..97b779b2d74a 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 @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":29,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":29}}, "errors": [ - "SyntaxError: Unexpected keyword 'typeof' (1:9)" + { + "$$ babel internal serialized type": "Error", + "message": "Unexpected keyword 'typeof' (1:9)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "UnexpectedKeyword" + } ], "program": { "type": "Program", 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 a627dce5e719..77a4be1045e2 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 @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":31,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":31}}, "errors": [ - "SyntaxError: Unexpected keyword 'debugger' (1:9)" + { + "$$ babel internal serialized type": "Error", + "message": "Unexpected keyword 'debugger' (1:9)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "UnexpectedKeyword" + } ], "program": { "type": "Program", 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 2d66299daa51..c2d2de3029d7 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 @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":22,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":2}}, "errors": [ - "SyntaxError: Argument name clash (2:11)" + { + "$$ babel internal serialized type": "Error", + "message": "Argument name clash (2:11)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "ParamDupe" + } ], "program": { "type": "Program", @@ -16,6 +22,10 @@ "expression": { "type": "ObjectExpression", "start":1,"end":21,"loc":{"start":{"line":1,"column":1},"end":{"line":3,"column":1}}, + "extra": { + "parenthesized": true, + "parenStart": 0 + }, "properties": [ { "type": "ObjectMethod", @@ -50,11 +60,7 @@ "directives": [] } } - ], - "extra": { - "parenthesized": true, - "parenStart": 0 - } + ] } } ], diff --git a/packages/babel-parser/test/fixtures/es2015/object/invalid-accessor-generator/output.json b/packages/babel-parser/test/fixtures/es2015/object/invalid-accessor-generator/output.json index 09cc367ae97a..634c389e771d 100644 --- a/packages/babel-parser/test/fixtures/es2015/object/invalid-accessor-generator/output.json +++ b/packages/babel-parser/test/fixtures/es2015/object/invalid-accessor-generator/output.json @@ -2,8 +2,20 @@ "type": "File", "start":0,"end":58,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":2}}, "errors": [ - "SyntaxError: A getter cannot be a generator (2:9)", - "SyntaxError: A setter cannot be a generator (3:9)" + { + "$$ babel internal serialized type": "Error", + "message": "A getter cannot be a generator (2:9)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "AccessorIsGenerator" + }, + { + "$$ babel internal serialized type": "Error", + "message": "A setter cannot be a generator (3:9)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "AccessorIsGenerator" + } ], "program": { "type": "Program", @@ -17,6 +29,10 @@ "expression": { "type": "ObjectExpression", "start":1,"end":57,"loc":{"start":{"line":1,"column":1},"end":{"line":4,"column":1}}, + "extra": { + "parenthesized": true, + "parenStart": 0 + }, "properties": [ { "type": "ObjectMethod", @@ -68,14 +84,10 @@ "directives": [] } } - ], - "extra": { - "parenthesized": true, - "parenStart": 0 - } + ] } } ], "directives": [] } -} +} \ No newline at end of file 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 397423695084..dc91dfa2e5cf 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 @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":7,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":7}}, "errors": [ - "SyntaxError: Duplicate regular expression flag (1:6)" + { + "$$ babel internal serialized type": "Error", + "message": "Duplicate regular expression flag (1:6)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "DuplicateRegExpFlags" + } ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2015/shorthand/reserved-word-strict/output.json b/packages/babel-parser/test/fixtures/es2015/shorthand/reserved-word-strict/output.json index 4549edcbc96a..8174db51bb21 100644 --- a/packages/babel-parser/test/fixtures/es2015/shorthand/reserved-word-strict/output.json +++ b/packages/babel-parser/test/fixtures/es2015/shorthand/reserved-word-strict/output.json @@ -2,9 +2,27 @@ "type": "File", "start":0,"end":59,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":45}}, "errors": [ - "SyntaxError: Unexpected reserved word 'implements' (2:11)", - "SyntaxError: Unexpected reserved word 'interface' (2:23)", - "SyntaxError: Unexpected reserved word 'package' (2:34)" + { + "$$ babel internal serialized type": "Error", + "message": "Unexpected reserved word 'implements' (2:11)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "UnexpectedReservedWord" + }, + { + "$$ babel internal serialized type": "Error", + "message": "Unexpected reserved word 'interface' (2:23)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "UnexpectedReservedWord" + }, + { + "$$ babel internal serialized type": "Error", + "message": "Unexpected reserved word 'package' (2:34)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "UnexpectedReservedWord" + } ], "program": { "type": "Program", @@ -27,10 +45,17 @@ "init": { "type": "ObjectExpression", "start":23,"end":57,"loc":{"start":{"line":2,"column":9},"end":{"line":2,"column":43}}, + "extra": { + "parenthesized": true, + "parenStart": 22 + }, "properties": [ { "type": "ObjectProperty", "start":25,"end":35,"loc":{"start":{"line":2,"column":11},"end":{"line":2,"column":21}}, + "extra": { + "shorthand": true + }, "method": false, "key": { "type": "Identifier", @@ -43,14 +68,14 @@ "type": "Identifier", "start":25,"end":35,"loc":{"start":{"line":2,"column":11},"end":{"line":2,"column":21},"identifierName":"implements"}, "name": "implements" - }, - "extra": { - "shorthand": true } }, { "type": "ObjectProperty", "start":37,"end":46,"loc":{"start":{"line":2,"column":23},"end":{"line":2,"column":32}}, + "extra": { + "shorthand": true + }, "method": false, "key": { "type": "Identifier", @@ -63,14 +88,14 @@ "type": "Identifier", "start":37,"end":46,"loc":{"start":{"line":2,"column":23},"end":{"line":2,"column":32},"identifierName":"interface"}, "name": "interface" - }, - "extra": { - "shorthand": true } }, { "type": "ObjectProperty", "start":48,"end":55,"loc":{"start":{"line":2,"column":34},"end":{"line":2,"column":41}}, + "extra": { + "shorthand": true + }, "method": false, "key": { "type": "Identifier", @@ -83,16 +108,9 @@ "type": "Identifier", "start":48,"end":55,"loc":{"start":{"line":2,"column":34},"end":{"line":2,"column":41},"identifierName":"package"}, "name": "package" - }, - "extra": { - "shorthand": true } } - ], - "extra": { - "parenthesized": true, - "parenStart": 22 - } + ] } } ], @@ -106,11 +124,11 @@ "value": { "type": "DirectiveLiteral", "start":0,"end":12,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":12}}, - "value": "use strict", "extra": { "raw": "\"use strict\"", "rawValue": "use strict" - } + }, + "value": "use strict" } } ] diff --git a/packages/babel-parser/test/fixtures/es2015/shorthand/reserved-word/output.json b/packages/babel-parser/test/fixtures/es2015/shorthand/reserved-word/output.json index 752251aa9b35..c68a490c9b07 100644 --- a/packages/babel-parser/test/fixtures/es2015/shorthand/reserved-word/output.json +++ b/packages/babel-parser/test/fixtures/es2015/shorthand/reserved-word/output.json @@ -2,9 +2,27 @@ "type": "File", "start":0,"end":30,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":30}}, "errors": [ - "SyntaxError: Unexpected keyword 'const' (1:11)", - "SyntaxError: Unexpected keyword 'if' (1:18)", - "SyntaxError: Unexpected keyword 'this' (1:22)" + { + "$$ babel internal serialized type": "Error", + "message": "Unexpected keyword 'const' (1:11)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "UnexpectedKeyword" + }, + { + "$$ babel internal serialized type": "Error", + "message": "Unexpected keyword 'if' (1:18)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "UnexpectedKeyword" + }, + { + "$$ babel internal serialized type": "Error", + "message": "Unexpected keyword 'this' (1:22)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "UnexpectedKeyword" + } ], "program": { "type": "Program", @@ -27,10 +45,17 @@ "init": { "type": "ObjectExpression", "start":9,"end":28,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":28}}, + "extra": { + "parenthesized": true, + "parenStart": 8 + }, "properties": [ { "type": "ObjectProperty", "start":11,"end":16,"loc":{"start":{"line":1,"column":11},"end":{"line":1,"column":16}}, + "extra": { + "shorthand": true + }, "method": false, "key": { "type": "Identifier", @@ -43,14 +68,14 @@ "type": "Identifier", "start":11,"end":16,"loc":{"start":{"line":1,"column":11},"end":{"line":1,"column":16},"identifierName":"const"}, "name": "const" - }, - "extra": { - "shorthand": true } }, { "type": "ObjectProperty", "start":18,"end":20,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":20}}, + "extra": { + "shorthand": true + }, "method": false, "key": { "type": "Identifier", @@ -63,14 +88,14 @@ "type": "Identifier", "start":18,"end":20,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":20},"identifierName":"if"}, "name": "if" - }, - "extra": { - "shorthand": true } }, { "type": "ObjectProperty", "start":22,"end":26,"loc":{"start":{"line":1,"column":22},"end":{"line":1,"column":26}}, + "extra": { + "shorthand": true + }, "method": false, "key": { "type": "Identifier", @@ -83,16 +108,9 @@ "type": "Identifier", "start":22,"end":26,"loc":{"start":{"line":1,"column":22},"end":{"line":1,"column":26},"identifierName":"this"}, "name": "this" - }, - "extra": { - "shorthand": true } } - ], - "extra": { - "parenthesized": true, - "parenStart": 8 - } + ] } } ], diff --git a/packages/babel-parser/test/fixtures/es2015/statements/label-invalid-const/output.json b/packages/babel-parser/test/fixtures/es2015/statements/label-invalid-const/output.json index 4c65f3b1133e..b39e1159c49c 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 @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "Lexical declaration cannot appear in a single-statement context (1:5)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "UnexpectedLexicalDeclaration" + } ], "program": { "type": "Program", 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 4ceffd86de0f..be0f5e3bdfb8 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 @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "Async functions can only be declared at the top level or inside a block (1:5)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "AsyncFunctionInSingleStatementContext" + } ], "program": { "type": "Program", 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 f71d506d0042..dc0b203f77d1 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 @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "Generators can only be declared at the top level or inside a block (1:13)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "GeneratorInSingleStatementContext" + } ], "program": { "type": "Program", 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 47915b8c2b34..1ff5eb48bbf0 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 @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "In strict mode code, functions can only be declared at top level or inside a block (1:35)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "StrictFunction" + } ], "program": { "type": "Program", @@ -60,11 +66,11 @@ "value": { "type": "DirectiveLiteral", "start":16,"end":28,"loc":{"start":{"line":1,"column":16},"end":{"line":1,"column":28}}, - "value": "use strict", "extra": { "raw": "\"use strict\"", "rawValue": "use strict" - } + }, + "value": "use strict" } } ] diff --git a/packages/babel-parser/test/fixtures/es2015/statements/label-invalid-let/output.json b/packages/babel-parser/test/fixtures/es2015/statements/label-invalid-let/output.json index f9826760ea5a..f6b159016f94 100644 --- a/packages/babel-parser/test/fixtures/es2015/statements/label-invalid-let/output.json +++ b/packages/babel-parser/test/fixtures/es2015/statements/label-invalid-let/output.json @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":13,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":13}}, "errors": [ - "SyntaxError: Missing semicolon (1:8)" + { + "$$ babel internal serialized type": "Error", + "message": "Missing semicolon (1:8)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "MissingSemicolon" + } ], "program": { "type": "Program", 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 a3d47c9c212e..9a8f1f1bc119 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/109/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/109/output.json @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "for-of loop variable declaration may not have an initializer (1:5)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "ForInOfLoopInitializer" + } ], "program": { "type": "Program", 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 9bf15e6a3a03..26d2778948ff 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/123/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/123/output.json @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "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)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "SuperNotAllowed" + } ], "program": { "type": "Program", @@ -16,6 +22,10 @@ "expression": { "type": "ClassExpression", "start":15,"end":50,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":50}}, + "extra": { + "parenthesized": true, + "parenStart": 14 + }, "id": { "type": "Identifier", "start":21,"end":22,"loc":{"start":{"line":1,"column":21},"end":{"line":1,"column":22},"identifierName":"A"}, @@ -63,10 +73,6 @@ } } ] - }, - "extra": { - "parenthesized": true, - "parenStart": 14 } } } @@ -78,11 +84,11 @@ "value": { "type": "DirectiveLiteral", "start":0,"end":12,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":12}}, - "value": "use strict", "extra": { "raw": "\"use strict\"", "rawValue": "use strict" - } + }, + "value": "use strict" } } ] 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 2d6cbfab112a..6c1cc61bc94e 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/125/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/125/output.json @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "Duplicate constructor in the same class (1:27)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "DuplicateConstructor" + } ], "program": { "type": "Program", 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 ccd3aa3f3e7c..5c5139b79bfc 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/126/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/126/output.json @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "Class constructor may not be an accessor (1:14)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "ConstructorIsAccessor" + } ], "program": { "type": "Program", 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 8650fd6a5dc4..e0f81ba38d4f 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/127/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/127/output.json @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "Constructor can't be a generator (1:11)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "ConstructorIsGenerator" + } ], "program": { "type": "Program", 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 e1a64571a1b8..3851b38788f0 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/166/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/166/output.json @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":22,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":22}}, "errors": [ - "SyntaxError: Argument name clash (1:16)" + { + "$$ babel internal serialized type": "Error", + "message": "Argument name clash (1:16)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "ParamDupe" + } ], "program": { "type": "Program", @@ -33,6 +39,9 @@ { "type": "ObjectProperty", "start":16,"end":17,"loc":{"start":{"line":1,"column":16},"end":{"line":1,"column":17}}, + "extra": { + "shorthand": true + }, "method": false, "key": { "type": "Identifier", @@ -45,9 +54,6 @@ "type": "Identifier", "start":16,"end":17,"loc":{"start":{"line":1,"column":16},"end":{"line":1,"column":17},"identifierName":"a"}, "name": "a" - }, - "extra": { - "shorthand": true } } ] diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/198/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/198/output.json index a880531bce85..6d36cc449c9f 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/198/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/198/output.json @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":2,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":2}}, "errors": [ - "SyntaxError: Expected number in radix 8 (1:2)" + { + "$$ babel internal serialized type": "Error", + "message": "Expected number in radix 8 (1:2)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "InvalidDigit" + } ], "program": { "type": "Program", 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 42696d4924d6..737f32877968 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/200/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/200/output.json @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":3,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":3}}, "errors": [ - "SyntaxError: Expected number in radix 8 (1:2)" + { + "$$ babel internal serialized type": "Error", + "message": "Expected number in radix 8 (1:2)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "InvalidDigit" + } ], "program": { "type": "Program", 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 9ed93409bc00..907b23c069d3 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/201/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/201/output.json @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":4,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":4}}, "errors": [ - "SyntaxError: Expected number in radix 8 (1:3)" + { + "$$ babel internal serialized type": "Error", + "message": "Expected number in radix 8 (1:3)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "InvalidDigit" + } ], "program": { "type": "Program", 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 91dec1a23074..1964b91a0929 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/202/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/202/output.json @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":2,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":2}}, "errors": [ - "SyntaxError: Expected number in radix 8 (1:2)" + { + "$$ babel internal serialized type": "Error", + "message": "Expected number in radix 8 (1:2)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "InvalidDigit" + } ], "program": { "type": "Program", 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 2fbc3ece3140..0a044dc7b3de 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/204/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/204/output.json @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":3,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":3}}, "errors": [ - "SyntaxError: Expected number in radix 8 (1:2)" + { + "$$ babel internal serialized type": "Error", + "message": "Expected number in radix 8 (1:2)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "InvalidDigit" + } ], "program": { "type": "Program", 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 4978bcf4e51b..5e0da6655d33 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/205/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/205/output.json @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":4,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":4}}, "errors": [ - "SyntaxError: Expected number in radix 8 (1:3)" + { + "$$ babel internal serialized type": "Error", + "message": "Expected number in radix 8 (1:3)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "InvalidDigit" + } ], "program": { "type": "Program", 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 bd3bd49916b3..1300079f48c8 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/206/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/206/output.json @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":2,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":2}}, "errors": [ - "SyntaxError: Expected number in radix 2 (1:2)" + { + "$$ babel internal serialized type": "Error", + "message": "Expected number in radix 2 (1:2)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "InvalidDigit" + } ], "program": { "type": "Program", 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 fabbead51492..0fdfbe633576 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/208/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/208/output.json @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":3,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":3}}, "errors": [ - "SyntaxError: Expected number in radix 2 (1:2)" + { + "$$ babel internal serialized type": "Error", + "message": "Expected number in radix 2 (1:2)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "InvalidDigit" + } ], "program": { "type": "Program", 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 c90afe1734e6..bdc7d4022289 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/209/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/209/output.json @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":4,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":4}}, "errors": [ - "SyntaxError: Expected number in radix 2 (1:3)" + { + "$$ babel internal serialized type": "Error", + "message": "Expected number in radix 2 (1:3)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "InvalidDigit" + } ], "program": { "type": "Program", 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 2b8e4f22be33..f097a9055158 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/210/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/210/output.json @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":4,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":4}}, "errors": [ - "SyntaxError: Expected number in radix 2 (1:3)" + { + "$$ babel internal serialized type": "Error", + "message": "Expected number in radix 2 (1:3)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "InvalidDigit" + } ], "program": { "type": "Program", 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 6cfde9edb3b5..83fc6641c202 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/211/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/211/output.json @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":2,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":2}}, "errors": [ - "SyntaxError: Expected number in radix 2 (1:2)" + { + "$$ babel internal serialized type": "Error", + "message": "Expected number in radix 2 (1:2)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "InvalidDigit" + } ], "program": { "type": "Program", 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 6e3728ace39b..c4e544ef0ee4 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/213/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/213/output.json @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":3,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":3}}, "errors": [ - "SyntaxError: Expected number in radix 2 (1:2)" + { + "$$ babel internal serialized type": "Error", + "message": "Expected number in radix 2 (1:2)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "InvalidDigit" + } ], "program": { "type": "Program", 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 d5ba308d5906..1f59a3719056 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/214/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/214/output.json @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":4,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":4}}, "errors": [ - "SyntaxError: Expected number in radix 2 (1:3)" + { + "$$ babel internal serialized type": "Error", + "message": "Expected number in radix 2 (1:3)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "InvalidDigit" + } ], "program": { "type": "Program", 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 af38f05f89fa..3d4d7dc83f7a 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/215/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/215/output.json @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":4,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":4}}, "errors": [ - "SyntaxError: Expected number in radix 2 (1:3)" + { + "$$ babel internal serialized type": "Error", + "message": "Expected number in radix 2 (1:3)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "InvalidDigit" + } ], "program": { "type": "Program", 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 8169a2831084..eab6d2a73c5e 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/217/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/217/output.json @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":6,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":6}}, "errors": [ - "SyntaxError: Bad character escape sequence (1:4)" + { + "$$ babel internal serialized type": "Error", + "message": "Bad character escape sequence (1:4)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "InvalidEscapeSequence" + } ], "program": { "type": "Program", @@ -17,11 +23,11 @@ "value": { "type": "DirectiveLiteral", "start":0,"end":6,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":6}}, - "value": "\\u{}", "extra": { "raw": "\"\\u{}\"", "rawValue": "\\u{}" - } + }, + "value": "\\u{}" } } ] diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/218/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/218/output.json index a5b7bb95f356..6dbc63656e0d 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/218/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/218/output.json @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":9,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":9}}, "errors": [ - "SyntaxError: Bad character escape sequence (1:4)" + { + "$$ babel internal serialized type": "Error", + "message": "Bad character escape sequence (1:4)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "InvalidEscapeSequence" + } ], "program": { "type": "Program", @@ -17,11 +23,11 @@ "value": { "type": "DirectiveLiteral", "start":0,"end":9,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":9}}, - "value": "\\u{FFFF", "extra": { "raw": "\"\\u{FFFF\"", "rawValue": "\\u{FFFF" - } + }, + "value": "\\u{FFFF" } } ] diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/219/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/219/output.json index 5c0123d27a42..0d15a96ffec7 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/219/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/219/output.json @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":9,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":9}}, "errors": [ - "SyntaxError: Bad character escape sequence (1:4)" + { + "$$ babel internal serialized type": "Error", + "message": "Bad character escape sequence (1:4)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "InvalidEscapeSequence" + } ], "program": { "type": "Program", @@ -17,11 +23,11 @@ "value": { "type": "DirectiveLiteral", "start":0,"end":9,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":9}}, - "value": "\\u{FFZ}", "extra": { "raw": "\"\\u{FFZ}\"", "rawValue": "\\u{FFZ}" - } + }, + "value": "\\u{FFZ}" } } ] 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 146edec02ca3..d06a6b4d45a3 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/220/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/220/output.json @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "Invalid left-hand side in assignment expression (1:0)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "InvalidLhs" + } ], "program": { "type": "Program", 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 6e2bf85797f6..06eb9a75cae6 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/221/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/221/output.json @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "Invalid left-hand side in array destructuring pattern (1:1)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "InvalidLhs" + } ], "program": { "type": "Program", 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 c220984197b1..d32591de339d 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/222/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/222/output.json @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "Invalid left-hand side in object destructuring pattern (1:7)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "InvalidLhs" + } ], "program": { "type": "Program", @@ -16,6 +22,10 @@ "expression": { "type": "AssignmentExpression", "start":1,"end":16,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":16}}, + "extra": { + "parenthesized": true, + "parenStart": 0 + }, "operator": "=", "left": { "type": "ObjectPattern", @@ -52,10 +62,6 @@ "raw": "42" }, "value": 42 - }, - "extra": { - "parenthesized": true, - "parenStart": 0 } } } diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/223/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/223/output.json index 475564c6683c..e5d65965ecaf 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/223/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/223/output.json @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "Object pattern can't contain getter or setter (1:7)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "PatternHasAccessor" + } ], "program": { "type": "Program", @@ -16,6 +22,10 @@ "expression": { "type": "AssignmentExpression", "start":1,"end":19,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":19}}, + "extra": { + "parenthesized": true, + "parenStart": 0 + }, "operator": "=", "left": { "type": "ObjectPattern", @@ -53,10 +63,6 @@ "raw": "0" }, "value": 0 - }, - "extra": { - "parenthesized": true, - "parenStart": 0 } } } diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/224/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/224/output.json index 5596ed9f7855..a4f7d5edfcf6 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/224/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/224/output.json @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":8,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":5}}, "errors": [ - "SyntaxError: Missing semicolon (2:3)" + { + "$$ babel internal serialized type": "Error", + "message": "Missing semicolon (2:3)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "MissingSemicolon" + } ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/225/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/225/output.json index 4cd6d09cff99..256cf5493f1c 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/225/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/225/output.json @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":10,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":7}}, "errors": [ - "SyntaxError: Missing semicolon (2:5)" + { + "$$ babel internal serialized type": "Error", + "message": "Missing semicolon (2:5)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "MissingSemicolon" + } ], "program": { "type": "Program", 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 dfaa426cebd5..55f87f67d208 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/226/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/226/output.json @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":21,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":21}}, "errors": [ - "SyntaxError: Unexpected keyword 'default' (1:9)" + { + "$$ babel internal serialized type": "Error", + "message": "Unexpected keyword 'default' (1:9)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "UnexpectedKeyword" + } ], "program": { "type": "Program", 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 ddf1b38b6ab3..6d1f238bf7d5 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/227/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/227/output.json @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":59,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":59}}, "errors": [ - "SyntaxError: Binding 'eval' in strict mode (1:44)" + { + "$$ babel internal serialized type": "Error", + "message": "Binding 'eval' in strict mode (1:44)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "StrictEvalArgumentsBinding" + } ], "program": { "type": "Program", @@ -31,6 +37,10 @@ "expression": { "type": "ObjectExpression", "start":33,"end":55,"loc":{"start":{"line":1,"column":33},"end":{"line":1,"column":55}}, + "extra": { + "parenthesized": true, + "parenStart": 32 + }, "properties": [ { "type": "ObjectProperty", @@ -81,11 +91,7 @@ "directives": [] } } - ], - "extra": { - "parenthesized": true, - "parenStart": 32 - } + ] } } ], @@ -96,11 +102,11 @@ "value": { "type": "DirectiveLiteral", "start":18,"end":30,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":30}}, - "value": "use strict", "extra": { "raw": "'use strict'", "rawValue": "use strict" - } + }, + "value": "use strict" } } ] diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/228/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/228/output.json index 54c485732104..e120b3fb5ee1 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/228/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/228/output.json @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":49,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":49}}, "errors": [ - "SyntaxError: Argument name clash (1:37)" + { + "$$ babel internal serialized type": "Error", + "message": "Argument name clash (1:37)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "ParamDupe" + } ], "program": { "type": "Program", @@ -31,6 +37,10 @@ "expression": { "type": "ObjectExpression", "start":30,"end":45,"loc":{"start":{"line":1,"column":30},"end":{"line":1,"column":45}}, + "extra": { + "parenthesized": true, + "parenStart": 29 + }, "properties": [ { "type": "ObjectMethod", @@ -65,11 +75,7 @@ "directives": [] } } - ], - "extra": { - "parenthesized": true, - "parenStart": 29 - } + ] } } ], @@ -80,11 +86,11 @@ "value": { "type": "DirectiveLiteral", "start":15,"end":27,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":27}}, - "value": "use strict", "extra": { "raw": "\"use strict\"", "rawValue": "use strict" - } + }, + "value": "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 d30f2d17c2b5..cace64a31453 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/229/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/229/output.json @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":9,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":9}}, "errors": [ - "SyntaxError: Unexpected keyword 'super' (1:4)" + { + "$$ babel internal serialized type": "Error", + "message": "Unexpected keyword 'super' (1:4)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "UnexpectedKeyword" + } ], "program": { "type": "Program", 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 1a676c59c021..431df1fc9654 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/230/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/230/output.json @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":11,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":11}}, "errors": [ - "SyntaxError: Unexpected keyword 'default' (1:4)" + { + "$$ babel internal serialized type": "Error", + "message": "Unexpected keyword 'default' (1:4)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "UnexpectedKeyword" + } ], "program": { "type": "Program", 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 0e0111a35a2f..2fb13aa6fa8d 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/231/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/231/output.json @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":11,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":11}}, "errors": [ - "SyntaxError: Unexpected keyword 'default' (1:4)" + { + "$$ babel internal serialized type": "Error", + "message": "Unexpected keyword 'default' (1:4)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "UnexpectedKeyword" + } ], "program": { "type": "Program", 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 154ac5251e77..a2bbcfd9924b 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/232/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/232/output.json @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":17,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":17}}, "errors": [ - "SyntaxError: Unexpected keyword 'default' (1:6)" + { + "$$ babel internal serialized type": "Error", + "message": "Unexpected keyword 'default' (1:6)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "UnexpectedKeyword" + } ], "program": { "type": "Program", 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 115652eea1e5..a37873add32c 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/233/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/233/output.json @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "Assigning to 'eval' in strict mode (1:20)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "StrictEvalArguments" + } ], "program": { "type": "Program", @@ -16,6 +22,10 @@ "expression": { "type": "AssignmentExpression", "start":15,"end":32,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":32}}, + "extra": { + "parenthesized": true, + "parenStart": 14 + }, "operator": "=", "left": { "type": "ObjectPattern", @@ -44,10 +54,6 @@ "type": "Identifier", "start":29,"end":32,"loc":{"start":{"line":1,"column":29},"end":{"line":1,"column":32},"identifierName":"obj"}, "name": "obj" - }, - "extra": { - "parenthesized": true, - "parenStart": 14 } } } @@ -59,11 +65,11 @@ "value": { "type": "DirectiveLiteral", "start":0,"end":12,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":12}}, - "value": "use strict", "extra": { "raw": "\"use strict\"", "rawValue": "use strict" - } + }, + "value": "use strict" } } ] diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/234/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/234/output.json index 5521e0e9a34f..10d1d38970c2 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/234/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/234/output.json @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "Assigning to 'arguments' in strict mode (1:20)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "StrictEvalArguments" + } ], "program": { "type": "Program", @@ -16,6 +22,10 @@ "expression": { "type": "AssignmentExpression", "start":15,"end":37,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":37}}, + "extra": { + "parenthesized": true, + "parenStart": 14 + }, "operator": "=", "left": { "type": "ObjectPattern", @@ -44,10 +54,6 @@ "type": "Identifier", "start":34,"end":37,"loc":{"start":{"line":1,"column":34},"end":{"line":1,"column":37},"identifierName":"obj"}, "name": "obj" - }, - "extra": { - "parenthesized": true, - "parenStart": 14 } } } @@ -59,11 +65,11 @@ "value": { "type": "DirectiveLiteral", "start":0,"end":12,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":12}}, - "value": "use strict", "extra": { "raw": "\"use strict\"", "rawValue": "use strict" - } + }, + "value": "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 ae24a82b749c..0a07ec62f09f 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/235/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/235/output.json @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "for-in loop variable declaration may not have an initializer (1:5)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "ForInOfLoopInitializer" + } ], "program": { "type": "Program", 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 70e5c2df0d16..fdad99a47ba2 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/236/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/236/output.json @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "for-of loop variable declaration may not have an initializer (1:5)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "ForInOfLoopInitializer" + } ], "program": { "type": "Program", 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 cca401d0d14b..d4e7bca942e9 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/242/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/242/output.json @@ -2,8 +2,20 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "Assigning to 'eval' in strict mode (1:15)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "StrictEvalArguments" + }, + { + "$$ babel internal serialized type": "Error", + "message": "Binding 'eval' in strict mode (1:15)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "StrictEvalArgumentsBinding" + } ], "program": { "type": "Program", @@ -59,11 +71,11 @@ "value": { "type": "DirectiveLiteral", "start":0,"end":12,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":12}}, - "value": "use strict", "extra": { "raw": "\"use strict\"", "rawValue": "use strict" - } + }, + "value": "use strict" } } ] diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/243/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/243/output.json index 8e8d8419af7a..c4507e879b96 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/243/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/243/output.json @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":24,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":24}}, "errors": [ - "SyntaxError: Binding 'eval' in strict mode (1:14)" + { + "$$ babel internal serialized type": "Error", + "message": "Binding 'eval' in strict mode (1:14)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "StrictEvalArgumentsBinding" + } ], "program": { "type": "Program", @@ -45,11 +51,11 @@ "value": { "type": "DirectiveLiteral", "start":0,"end":12,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":12}}, - "value": "use strict", "extra": { "raw": "\"use strict\"", "rawValue": "use strict" - } + }, + "value": "use strict" } } ] diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/244/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/244/output.json index 5a18ea14d881..4ad129e4818d 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/244/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/244/output.json @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":29,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":29}}, "errors": [ - "SyntaxError: Binding 'arguments' in strict mode (1:14)" + { + "$$ babel internal serialized type": "Error", + "message": "Binding 'arguments' in strict mode (1:14)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "StrictEvalArgumentsBinding" + } ], "program": { "type": "Program", @@ -45,11 +51,11 @@ "value": { "type": "DirectiveLiteral", "start":0,"end":12,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":12}}, - "value": "use strict", "extra": { "raw": "\"use strict\"", "rawValue": "use strict" - } + }, + "value": "use strict" } } ] diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/245/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/245/output.json index c5a150d343ad..bdd2ce3e0b2a 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/245/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/245/output.json @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":29,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":29}}, "errors": [ - "SyntaxError: Binding 'eval' in strict mode (1:15)" + { + "$$ babel internal serialized type": "Error", + "message": "Binding 'eval' in strict mode (1:15)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "StrictEvalArgumentsBinding" + } ], "program": { "type": "Program", @@ -50,11 +56,11 @@ "value": { "type": "DirectiveLiteral", "start":0,"end":12,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":12}}, - "value": "use strict", "extra": { "raw": "\"use strict\"", "rawValue": "use strict" - } + }, + "value": "use strict" } } ] diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/246/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/246/output.json index 402704e9deb8..52f5d278d5d9 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/246/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/246/output.json @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":34,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":34}}, "errors": [ - "SyntaxError: Binding 'arguments' in strict mode (1:15)" + { + "$$ babel internal serialized type": "Error", + "message": "Binding 'arguments' in strict mode (1:15)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "StrictEvalArgumentsBinding" + } ], "program": { "type": "Program", @@ -50,11 +56,11 @@ "value": { "type": "DirectiveLiteral", "start":0,"end":12,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":12}}, - "value": "use strict", "extra": { "raw": "\"use strict\"", "rawValue": "use strict" - } + }, + "value": "use strict" } } ] diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/247/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/247/output.json index db4f4a90fe06..e7debb9c61ba 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/247/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/247/output.json @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":34,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":34}}, "errors": [ - "SyntaxError: Binding 'eval' in strict mode (1:15)" + { + "$$ babel internal serialized type": "Error", + "message": "Binding 'eval' in strict mode (1:15)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "StrictEvalArgumentsBinding" + } ], "program": { "type": "Program", @@ -63,11 +69,11 @@ "value": { "type": "DirectiveLiteral", "start":0,"end":12,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":12}}, - "value": "use strict", "extra": { "raw": "\"use strict\"", "rawValue": "use strict" - } + }, + "value": "use strict" } } ] diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/248/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/248/output.json index e552560189df..a7a0bf29dfd9 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/248/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/248/output.json @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":26,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":26}}, "errors": [ - "SyntaxError: Argument name clash (1:18)" + { + "$$ babel internal serialized type": "Error", + "message": "Argument name clash (1:18)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "ParamDupe" + } ], "program": { "type": "Program", @@ -50,11 +56,11 @@ "value": { "type": "DirectiveLiteral", "start":0,"end":12,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":12}}, - "value": "use strict", "extra": { "raw": "\"use strict\"", "rawValue": "use strict" - } + }, + "value": "use strict" } } ] diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/249/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/249/output.json index 70812a59cc6a..ecc913951ae7 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/249/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/249/output.json @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "Legacy octal literals are not allowed in strict mode (1:21)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "StrictOctalLiteral" + } ], "program": { "type": "Program", @@ -45,11 +51,11 @@ "value": { "type": "DirectiveLiteral", "start":0,"end":12,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":12}}, - "value": "use strict", "extra": { "raw": "\"use strict\"", "rawValue": "use strict" - } + }, + "value": "use strict" } } ] 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 6b624a3ee404..d1c21b579eb8 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/251/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/251/output.json @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "Binding invalid left-hand side in function parameter list (1:1)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "InvalidLhsBinding" + } ], "program": { "type": "Program", 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 06d87dffa42f..44dd5b3f0c28 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/252/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/252/output.json @@ -2,8 +2,20 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "Binding invalid left-hand side in function parameter list (1:1)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "InvalidLhsBinding" + }, + { + "$$ babel internal serialized type": "Error", + "message": "Binding invalid left-hand side in function parameter list (1:5)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "InvalidLhsBinding" + } ], "program": { "type": "Program", 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 bdb28643723e..7f27cec799bd 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/280/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/280/output.json @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":36,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":36}}, "errors": [ - "SyntaxError: Argument name clash (1:30)" + { + "$$ babel internal serialized type": "Error", + "message": "Argument name clash (1:30)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "ParamDupe" + } ], "program": { "type": "Program", @@ -33,6 +39,9 @@ { "type": "ObjectProperty", "start":30,"end":31,"loc":{"start":{"line":1,"column":30},"end":{"line":1,"column":31}}, + "extra": { + "shorthand": true + }, "method": false, "key": { "type": "Identifier", @@ -45,9 +54,6 @@ "type": "Identifier", "start":30,"end":31,"loc":{"start":{"line":1,"column":30},"end":{"line":1,"column":31},"identifierName":"a"}, "name": "a" - }, - "extra": { - "shorthand": true } } ] @@ -68,11 +74,11 @@ "value": { "type": "DirectiveLiteral", "start":0,"end":12,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":12}}, - "value": "use strict", "extra": { "raw": "\"use strict\"", "rawValue": "use strict" - } + }, + "value": "use strict" } } ] diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/281/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/281/output.json index f2543aba9796..08e96c73ca9c 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/281/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/281/output.json @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":56,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":56}}, "errors": [ - "SyntaxError: Argument name clash (1:47)" + { + "$$ babel internal serialized type": "Error", + "message": "Argument name clash (1:47)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "ParamDupe" + } ], "program": { "type": "Program", @@ -43,6 +49,9 @@ { "type": "ObjectProperty", "start":32,"end":33,"loc":{"start":{"line":1,"column":32},"end":{"line":1,"column":33}}, + "extra": { + "shorthand": true + }, "method": false, "key": { "type": "Identifier", @@ -55,9 +64,6 @@ "type": "Identifier", "start":32,"end":33,"loc":{"start":{"line":1,"column":32},"end":{"line":1,"column":33},"identifierName":"a"}, "name": "a" - }, - "extra": { - "shorthand": true } } ] @@ -91,6 +97,9 @@ { "type": "ObjectProperty", "start":47,"end":48,"loc":{"start":{"line":1,"column":47},"end":{"line":1,"column":48}}, + "extra": { + "shorthand": true + }, "method": false, "key": { "type": "Identifier", @@ -103,9 +112,6 @@ "type": "Identifier", "start":47,"end":48,"loc":{"start":{"line":1,"column":47},"end":{"line":1,"column":48},"identifierName":"a"}, "name": "a" - }, - "extra": { - "shorthand": true } } ] @@ -131,11 +137,11 @@ "value": { "type": "DirectiveLiteral", "start":0,"end":12,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":12}}, - "value": "use strict", "extra": { "raw": "\"use strict\"", "rawValue": "use strict" - } + }, + "value": "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 dba83d09de2a..dc496af9a5da 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/284/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/284/output.json @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "Binding invalid left-hand side in array destructuring pattern (1:3)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "InvalidLhsBinding" + } ], "program": { "type": "Program", 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 38f67c246355..30b68f995581 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/289/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/289/output.json @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":32,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":32}}, "errors": [ - "SyntaxError: Binding 'eval' in strict mode (1:5)" + { + "$$ babel internal serialized type": "Error", + "message": "Binding 'eval' in strict mode (1:5)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "StrictEvalArgumentsBinding" + } ], "program": { "type": "Program", @@ -16,6 +22,10 @@ "expression": { "type": "ObjectExpression", "start":1,"end":30,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":30}}, + "extra": { + "parenthesized": true, + "parenStart": 0 + }, "properties": [ { "type": "ObjectMethod", @@ -49,21 +59,17 @@ "value": { "type": "DirectiveLiteral", "start":13,"end":25,"loc":{"start":{"line":1,"column":13},"end":{"line":1,"column":25}}, - "value": "use strict", "extra": { "raw": "\"use strict\"", "rawValue": "use strict" - } + }, + "value": "use strict" } } ] } } - ], - "extra": { - "parenthesized": true, - "parenStart": 0 - } + ] } } ], diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/290/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/290/output.json index 2eb965567548..1b1b7b53e414 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/290/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/290/output.json @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":27,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":27}}, "errors": [ - "SyntaxError: Invalid escape sequence in template (1:23)" + { + "$$ babel internal serialized type": "Error", + "message": "Invalid escape sequence in template (1:23)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "InvalidEscapeSequenceTemplate" + } ], "program": { "type": "Program", @@ -53,11 +59,11 @@ "value": { "type": "DirectiveLiteral", "start":0,"end":12,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":12}}, - "value": "use strict", "extra": { "raw": "\"use strict\"", "rawValue": "use strict" - } + }, + "value": "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 c87a88a757b7..a06283560a09 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/291/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/291/output.json @@ -2,8 +2,20 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "'import' and 'export' may only appear at the top level (1:7)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "UnexpectedImportExport" + }, + { + "$$ babel internal serialized type": "Error", + "message": "'import' and 'export' may appear only with 'sourceType: \"module\"' (1:7)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SOURCETYPE_MODULE_REQUIRED", + "reasonCode": "ImportOutsideModule" + } ], "program": { "type": "Program", 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 8515329a04e1..670bc9388a4b 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/296/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/296/output.json @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":26,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":26}}, "errors": [ - "SyntaxError: Binding 'eval' in strict mode (1:15)" + { + "$$ babel internal serialized type": "Error", + "message": "Binding 'eval' in strict mode (1:15)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "StrictEvalArgumentsBinding" + } ], "program": { "type": "Program", @@ -45,11 +51,11 @@ "value": { "type": "DirectiveLiteral", "start":0,"end":12,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":12}}, - "value": "use strict", "extra": { "raw": "\"use strict\"", "rawValue": "use strict" - } + }, + "value": "use strict" } } ] diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/297/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/297/output.json index 16f6411a562b..2bcc358aad83 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/297/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/297/output.json @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":30,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":30}}, "errors": [ - "SyntaxError: Binding 'eval' in strict mode (1:1)" + { + "$$ babel internal serialized type": "Error", + "message": "Binding 'eval' in strict mode (1:1)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "StrictEvalArgumentsBinding" + } ], "program": { "type": "Program", @@ -51,11 +57,11 @@ "value": { "type": "DirectiveLiteral", "start":12,"end":24,"loc":{"start":{"line":1,"column":12},"end":{"line":1,"column":24}}, - "value": "use strict", "extra": { "raw": "\"use strict\"", "rawValue": "use strict" - } + }, + "value": "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 86c9ce21554e..f80225d2599c 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/298/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/298/output.json @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "Object pattern can't contain getter or setter (1:7)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "PatternHasAccessor" + } ], "program": { "type": "Program", 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 95055f68cba7..987618f060c5 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/324/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/324/output.json @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "Complex binding patterns require an initialization value (1:7)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "DeclarationMissingInitializer" + } ], "program": { "type": "Program", 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 357a7e282e79..eb8c1ad6d931 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/325/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/325/output.json @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "Complex binding patterns require an initialization value (1:7)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "DeclarationMissingInitializer" + } ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/328/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/328/output.json index 71a9cb4c6532..dbf234b76a80 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/328/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/328/output.json @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":18,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":18}}, "errors": [ - "SyntaxError: Missing semicolon (1:10)" + { + "$$ babel internal serialized type": "Error", + "message": "Missing semicolon (1:10)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "MissingSemicolon" + } ], "program": { "type": "Program", 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 7e613e65e9f4..f2857b3c5b8e 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/329/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/329/output.json @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "Lexical declaration cannot appear in a single-statement context (1:9)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "UnexpectedLexicalDeclaration" + } ], "program": { "type": "Program", 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 c604d5892ae5..8375b3f6169e 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/332/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/332/output.json @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "Assigning to 'eval' in strict mode (1:18)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "StrictEvalArguments" + } ], "program": { "type": "Program", @@ -47,11 +53,11 @@ "value": { "type": "DirectiveLiteral", "start":0,"end":12,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":12}}, - "value": "use strict", "extra": { "raw": "'use strict'", "rawValue": "use strict" - } + }, + "value": "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 56ed13d09fb8..c0a40e233906 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/334/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/334/output.json @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "Assigning to 'eval' in strict mode (1:4)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "StrictEvalArguments" + } ], "program": { "type": "Program", 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 0f3359c66524..356aeb33e657 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/339/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/339/output.json @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":5,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":5}}, "errors": [ - "SyntaxError: Invalid escape sequence in template (1:2)" + { + "$$ babel internal serialized type": "Error", + "message": "Invalid escape sequence in template (1:2)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "InvalidEscapeSequenceTemplate" + } ], "program": { "type": "Program", 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 7cde5ed76296..71677268e6ff 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/344/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/344/output.json @@ -2,8 +2,20 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "super is only allowed in object methods and classes (1:0)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "UnexpectedSuper" + }, + { + "$$ babel internal serialized type": "Error", + "message": "super can only be used with function calls (i.e. super()) or in property accesses (i.e. super.prop or super[prop]) (1:0)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "UnsupportedSuper" + } ], "program": { "type": "Program", 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 875ae6923bec..02f7c5001aa6 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/347/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/347/output.json @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "setter must have exactly one formal parameter (1:10)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "BadSetterArity" + } ], "program": { "type": "Program", 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 e976347b716a..033b7cf2b0bb 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/348/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/348/output.json @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":32,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":32}}, "errors": [ - "SyntaxError: Redefinition of __proto__ property (1:17)" + { + "$$ babel internal serialized type": "Error", + "message": "Redefinition of __proto__ property (1:17)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "DuplicateProto" + } ], "program": { "type": "Program", @@ -16,6 +22,10 @@ "expression": { "type": "ObjectExpression", "start":1,"end":31,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":31}}, + "extra": { + "parenthesized": true, + "parenStart": 0 + }, "properties": [ { "type": "ObjectProperty", @@ -59,11 +69,7 @@ "value": 2 } } - ], - "extra": { - "parenthesized": true, - "parenStart": 0 - } + ] } } ], diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/349/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/349/output.json index f3676a82d6ff..24a3e6967ab3 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/349/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/349/output.json @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":34,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":34}}, "errors": [ - "SyntaxError: Redefinition of __proto__ property (1:19)" + { + "$$ babel internal serialized type": "Error", + "message": "Redefinition of __proto__ property (1:19)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "DuplicateProto" + } ], "program": { "type": "Program", @@ -16,6 +22,10 @@ "expression": { "type": "ObjectExpression", "start":1,"end":33,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":33}}, + "extra": { + "parenthesized": true, + "parenStart": 0 + }, "properties": [ { "type": "ObjectProperty", @@ -63,11 +73,7 @@ "value": 2 } } - ], - "extra": { - "parenthesized": true, - "parenStart": 0 - } + ] } } ], 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 ba52d9ef6dd4..db71572b6717 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/357/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/357/output.json @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":14,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":14}}, "errors": [ - "SyntaxError: Unexpected reserved word 'await' (1:0)" + { + "$$ babel internal serialized type": "Error", + "message": "Unexpected reserved word 'await' (1:0)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "UnexpectedReservedWord" + } ], "program": { "type": "Program", 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 a178730ecfdb..e3a58e7a957f 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/359/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/359/output.json @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":20,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":20}}, "errors": [ - "SyntaxError: Unexpected reserved word 'await' (1:6)" + { + "$$ babel internal serialized type": "Error", + "message": "Unexpected reserved word 'await' (1:6)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "UnexpectedReservedWord" + } ], "program": { "type": "Program", 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 f36b09894784..ebfeed35ce14 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/361/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/361/output.json @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":24,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":24}}, "errors": [ - "SyntaxError: Unexpected reserved word 'await' (1:8)" + { + "$$ babel internal serialized type": "Error", + "message": "Unexpected reserved word 'await' (1:8)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "UnexpectedReservedWord" + } ], "program": { "type": "Program", 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 0c3cf49c0481..0111ef24d103 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/363/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/363/output.json @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":26,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":26}}, "errors": [ - "SyntaxError: Unexpected reserved word 'await' (1:15)" + { + "$$ babel internal serialized type": "Error", + "message": "Unexpected reserved word 'await' (1:15)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "UnexpectedReservedWord" + } ], "program": { "type": "Program", 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 23b41eb517f9..d1a170031ca7 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/365/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/365/output.json @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":19,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":19}}, "errors": [ - "SyntaxError: Unexpected reserved word 'await' (1:9)" + { + "$$ babel internal serialized type": "Error", + "message": "Unexpected reserved word 'await' (1:9)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "UnexpectedReservedWord" + } ], "program": { "type": "Program", 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 5473a1cc88a4..b60936b2e812 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/367/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/367/output.json @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":14,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":14}}, "errors": [ - "SyntaxError: Unexpected reserved word 'await' (1:6)" + { + "$$ babel internal serialized type": "Error", + "message": "Unexpected reserved word 'await' (1:6)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "UnexpectedReservedWord" + } ], "program": { "type": "Program", 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 600dd2bbb964..1e134a4f3389 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/368/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/368/output.json @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":13,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":13}}, "errors": [ - "SyntaxError: Unexpected reserved word 'enum' (1:0)" + { + "$$ babel internal serialized type": "Error", + "message": "Unexpected reserved word 'enum' (1:0)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "UnexpectedReservedWord" + } ], "program": { "type": "Program", 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 5dcad3446852..8db452073333 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/369/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/369/output.json @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":13,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":13}}, "errors": [ - "SyntaxError: Unexpected reserved word 'enum' (1:0)" + { + "$$ babel internal serialized type": "Error", + "message": "Unexpected reserved word 'enum' (1:0)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "UnexpectedReservedWord" + } ], "program": { "type": "Program", 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 58ec7c24759d..4d2ac449c77b 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/37/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/37/output.json @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":13,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":13}}, "errors": [ - "SyntaxError: Binding member expression (1:2)" + { + "$$ babel internal serialized type": "Error", + "message": "Binding member expression (1:2)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "InvalidPropertyBindingPattern" + } ], "program": { "type": "Program", @@ -32,12 +38,12 @@ "start":2,"end":3,"loc":{"start":{"line":1,"column":2},"end":{"line":1,"column":3},"identifierName":"a"}, "name": "a" }, + "computed": false, "property": { "type": "Identifier", "start":4,"end":5,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":5},"identifierName":"a"}, "name": "a" - }, - "computed": false + } } ] } 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 d702eecd622a..920c02414f87 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/370/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/370/output.json @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":19,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":19}}, "errors": [ - "SyntaxError: Unexpected reserved word 'enum' (1:6)" + { + "$$ babel internal serialized type": "Error", + "message": "Unexpected reserved word 'enum' (1:6)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "UnexpectedReservedWord" + } ], "program": { "type": "Program", 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 4333b93e5890..33177dc3ef4d 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/371/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/371/output.json @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":19,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":19}}, "errors": [ - "SyntaxError: Unexpected reserved word 'enum' (1:6)" + { + "$$ babel internal serialized type": "Error", + "message": "Unexpected reserved word 'enum' (1:6)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "UnexpectedReservedWord" + } ], "program": { "type": "Program", 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 6521ee477c9a..967b1fac25f0 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/372/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/372/output.json @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":23,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":23}}, "errors": [ - "SyntaxError: Unexpected reserved word 'enum' (1:8)" + { + "$$ babel internal serialized type": "Error", + "message": "Unexpected reserved word 'enum' (1:8)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "UnexpectedReservedWord" + } ], "program": { "type": "Program", @@ -24,6 +30,9 @@ { "type": "ObjectProperty", "start":8,"end":12,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":12}}, + "extra": { + "shorthand": true + }, "method": false, "key": { "type": "Identifier", @@ -36,9 +45,6 @@ "type": "Identifier", "start":8,"end":12,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":12},"identifierName":"enum"}, "name": "enum" - }, - "extra": { - "shorthand": true } } ] diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/373/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/373/output.json index dfeea9b4cd37..4e32e07e6728 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/373/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/373/output.json @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":23,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":23}}, "errors": [ - "SyntaxError: Unexpected reserved word 'enum' (1:8)" + { + "$$ babel internal serialized type": "Error", + "message": "Unexpected reserved word 'enum' (1:8)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "UnexpectedReservedWord" + } ], "program": { "type": "Program", @@ -24,6 +30,9 @@ { "type": "ObjectProperty", "start":8,"end":12,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":12}}, + "extra": { + "shorthand": true + }, "method": false, "key": { "type": "Identifier", @@ -36,9 +45,6 @@ "type": "Identifier", "start":8,"end":12,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":12},"identifierName":"enum"}, "name": "enum" - }, - "extra": { - "shorthand": true } } ] diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/374/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/374/output.json index 19654730cb8b..24de7c4ae5fe 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/374/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/374/output.json @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":25,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":25}}, "errors": [ - "SyntaxError: Unexpected reserved word 'enum' (1:15)" + { + "$$ babel internal serialized type": "Error", + "message": "Unexpected reserved word 'enum' (1:15)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "UnexpectedReservedWord" + } ], "program": { "type": "Program", @@ -28,6 +34,9 @@ { "type": "ObjectProperty", "start":15,"end":19,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":19}}, + "extra": { + "shorthand": true + }, "method": false, "key": { "type": "Identifier", @@ -40,9 +49,6 @@ "type": "Identifier", "start":15,"end":19,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":19},"identifierName":"enum"}, "name": "enum" - }, - "extra": { - "shorthand": true } } ] diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/375/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/375/output.json index f01eb7211de7..630da8a8c6de 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/375/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/375/output.json @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":25,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":25}}, "errors": [ - "SyntaxError: Unexpected reserved word 'enum' (1:15)" + { + "$$ babel internal serialized type": "Error", + "message": "Unexpected reserved word 'enum' (1:15)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "UnexpectedReservedWord" + } ], "program": { "type": "Program", @@ -28,6 +34,9 @@ { "type": "ObjectProperty", "start":15,"end":19,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":19}}, + "extra": { + "shorthand": true + }, "method": false, "key": { "type": "Identifier", @@ -40,9 +49,6 @@ "type": "Identifier", "start":15,"end":19,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":19},"identifierName":"enum"}, "name": "enum" - }, - "extra": { - "shorthand": true } } ] diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/376/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/376/output.json index 322f8bc8c738..7cc99feef0c8 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/376/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/376/output.json @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":18,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":18}}, "errors": [ - "SyntaxError: Unexpected reserved word 'enum' (1:9)" + { + "$$ babel internal serialized type": "Error", + "message": "Unexpected reserved word 'enum' (1:9)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "UnexpectedReservedWord" + } ], "program": { "type": "Program", 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 4b207d606d1a..c0ea912e1017 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/377/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/377/output.json @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":18,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":18}}, "errors": [ - "SyntaxError: Unexpected reserved word 'enum' (1:9)" + { + "$$ babel internal serialized type": "Error", + "message": "Unexpected reserved word 'enum' (1:9)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "UnexpectedReservedWord" + } ], "program": { "type": "Program", 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 c7c70afe77b1..098b06faf26e 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/378/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/378/output.json @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":13,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":13}}, "errors": [ - "SyntaxError: Unexpected reserved word 'enum' (1:6)" + { + "$$ babel internal serialized type": "Error", + "message": "Unexpected reserved word 'enum' (1:6)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "UnexpectedReservedWord" + } ], "program": { "type": "Program", 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 168f8d9cc006..e9c072af270b 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/379/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/379/output.json @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":13,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":13}}, "errors": [ - "SyntaxError: Unexpected reserved word 'enum' (1:6)" + { + "$$ babel internal serialized type": "Error", + "message": "Unexpected reserved word 'enum' (1:6)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "UnexpectedReservedWord" + } ], "program": { "type": "Program", 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 58ec7c24759d..4d2ac449c77b 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/395/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/395/output.json @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":13,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":13}}, "errors": [ - "SyntaxError: Binding member expression (1:2)" + { + "$$ babel internal serialized type": "Error", + "message": "Binding member expression (1:2)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "InvalidPropertyBindingPattern" + } ], "program": { "type": "Program", @@ -32,12 +38,12 @@ "start":2,"end":3,"loc":{"start":{"line":1,"column":2},"end":{"line":1,"column":3},"identifierName":"a"}, "name": "a" }, + "computed": false, "property": { "type": "Identifier", "start":4,"end":5,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":5},"identifierName":"a"}, "name": "a" - }, - "computed": false + } } ] } 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 ced2dbfb6771..d62fde15af9d 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 @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "Can not use 'yield' as identifier inside a generator (2:11)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "YieldBindingIdentifier" + } ], "program": { "type": "Program", 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 0026ac0e9383..5ba08bf2b410 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 @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "Can not use 'yield' as identifier inside a generator (1:11)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "YieldBindingIdentifier" + } ], "program": { "type": "Program", 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 8b8e3b1ff8ae..344b5482befe 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 @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":34,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":34}}, "errors": [ - "SyntaxError: Binding 'yield' in strict mode (1:9)" + { + "$$ babel internal serialized type": "Error", + "message": "Binding 'yield' in strict mode (1:9)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "StrictEvalArgumentsBinding" + } ], "program": { "type": "Program", @@ -32,11 +38,11 @@ "value": { "type": "DirectiveLiteral", "start":19,"end":31,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":31}}, - "value": "use strict", "extra": { "raw": "\"use strict\"", "rawValue": "use strict" - } + }, + "value": "use strict" } } ] diff --git a/packages/babel-parser/test/fixtures/es2015/yield/function-name-strict/output.json b/packages/babel-parser/test/fixtures/es2015/yield/function-name-strict/output.json index bd1a0267017c..e9c30182048e 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 @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":33,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":19}}, "errors": [ - "SyntaxError: Unexpected reserved word 'yield' (2:9)" + { + "$$ babel internal serialized type": "Error", + "message": "Unexpected reserved word 'yield' (2:9)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "UnexpectedReservedWord" + } ], "program": { "type": "Program", @@ -36,11 +42,11 @@ "value": { "type": "DirectiveLiteral", "start":0,"end":12,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":12}}, - "value": "use strict", "extra": { "raw": "\"use strict\"", "rawValue": "use strict" - } + }, + "value": "use strict" } } ] diff --git a/packages/babel-parser/test/fixtures/es2015/yield/in-global-scope/output.json b/packages/babel-parser/test/fixtures/es2015/yield/in-global-scope/output.json index 2a5530c8fc99..e9b0e5fa8c7b 100644 --- a/packages/babel-parser/test/fixtures/es2015/yield/in-global-scope/output.json +++ b/packages/babel-parser/test/fixtures/es2015/yield/in-global-scope/output.json @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":8,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":8}}, "errors": [ - "SyntaxError: Missing semicolon (1:5)" + { + "$$ babel internal serialized type": "Error", + "message": "Missing semicolon (1:5)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "MissingSemicolon" + } ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2015/yield/in-plain-function/output.json b/packages/babel-parser/test/fixtures/es2015/yield/in-plain-function/output.json index 45281e703a8d..f797bf87d2c3 100644 --- a/packages/babel-parser/test/fixtures/es2015/yield/in-plain-function/output.json +++ b/packages/babel-parser/test/fixtures/es2015/yield/in-plain-function/output.json @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":26,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":26}}, "errors": [ - "SyntaxError: Missing semicolon (1:20)" + { + "$$ babel internal serialized type": "Error", + "message": "Missing semicolon (1:20)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "MissingSemicolon" + } ], "program": { "type": "Program", 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 77197bbbb687..b903007db26e 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 @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":39,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "errors": [ - "SyntaxError: Yield expression is not allowed in formal parameters (2:7)" + { + "$$ babel internal serialized type": "Error", + "message": "Yield expression is not allowed in formal parameters (2:7)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "YieldInParameter" + } ], "program": { "type": "Program", 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 b6212ca370e7..0e79440c3d50 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 @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":53,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "errors": [ - "SyntaxError: Yield expression is not allowed in formal parameters (2:15)" + { + "$$ babel internal serialized type": "Error", + "message": "Yield expression is not allowed in formal parameters (2:15)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "YieldInParameter" + } ], "program": { "type": "Program", 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 92abf570fec1..517a8a0f1acd 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 @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":42,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "errors": [ - "SyntaxError: Yield expression is not allowed in formal parameters (2:7)" + { + "$$ babel internal serialized type": "Error", + "message": "Yield expression is not allowed in formal parameters (2:7)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "YieldInParameter" + } ], "program": { "type": "Program", 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 a9f7f41d1765..46db70f527c6 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 @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":49,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "errors": [ - "SyntaxError: Yield expression is not allowed in formal parameters (2:17)" + { + "$$ babel internal serialized type": "Error", + "message": "Yield expression is not allowed in formal parameters (2:17)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "YieldInParameter" + } ], "program": { "type": "Program", 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 8b2983892bd4..385655562717 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 @@ -2,8 +2,20 @@ "type": "File", "start":0,"end":47,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "errors": [ - "SyntaxError: Yield expression is not allowed in formal parameters (2:8)", - "SyntaxError: Binding invalid left-hand side in function parameter list (2:8)" + { + "$$ babel internal serialized type": "Error", + "message": "Yield expression is not allowed in formal parameters (2:8)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "YieldInParameter" + }, + { + "$$ babel internal serialized type": "Error", + "message": "Binding invalid left-hand side in function parameter list (2:8)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "InvalidLhsBinding" + } ], "program": { "type": "Program", 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 8c51b841eecd..02d56b1570c8 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 @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":41,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "errors": [ - "SyntaxError: Yield expression is not allowed in formal parameters (2:8)" + { + "$$ babel internal serialized type": "Error", + "message": "Yield expression is not allowed in formal parameters (2:8)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "YieldInParameter" + } ], "program": { "type": "Program", 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 098f7106d0b2..9fb3998795dd 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 @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":27,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":27}}, "errors": [ - "SyntaxError: Yield expression is not allowed in formal parameters (1:15)" + { + "$$ babel internal serialized type": "Error", + "message": "Yield expression is not allowed in formal parameters (1:15)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "YieldInParameter" + } ], "program": { "type": "Program", 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 bc481c3d0271..d84307a322cc 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 @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":26,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":26}}, "errors": [ - "SyntaxError: Yield expression is not allowed in formal parameters (1:17)" + { + "$$ babel internal serialized type": "Error", + "message": "Yield expression is not allowed in formal parameters (1:17)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "YieldInParameter" + } ], "program": { "type": "Program", 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 edd07f81cc72..4661591c7b22 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 @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":39,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":25}}, "errors": [ - "SyntaxError: Unexpected reserved word 'yield' (2:16)" + { + "$$ babel internal serialized type": "Error", + "message": "Unexpected reserved word 'yield' (2:16)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "UnexpectedReservedWord" + } ], "program": { "type": "Program", @@ -51,11 +57,11 @@ "value": { "type": "DirectiveLiteral", "start":0,"end":12,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":12}}, - "value": "use strict", "extra": { "raw": "\"use strict\"", "rawValue": "use strict" - } + }, + "value": "use strict" } } ] 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 f84aed5d2e6d..c1aa432db66b 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 @@ -2,8 +2,20 @@ "type": "File", "start":0,"end":35,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "errors": [ - "SyntaxError: Yield expression is not allowed in formal parameters (2:3)", - "SyntaxError: Binding invalid left-hand side in function parameter list (2:3)" + { + "$$ babel internal serialized type": "Error", + "message": "Yield expression is not allowed in formal parameters (2:3)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "YieldInParameter" + }, + { + "$$ babel internal serialized type": "Error", + "message": "Binding invalid left-hand side in function parameter list (2:3)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "InvalidLhsBinding" + } ], "program": { "type": "Program", 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 0599a5ca99f6..136195105026 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 @@ -2,8 +2,20 @@ "type": "File", "start":0,"end":38,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "errors": [ - "SyntaxError: Yield expression is not allowed in formal parameters (2:3)", - "SyntaxError: Binding invalid left-hand side in function parameter list (2:3)" + { + "$$ babel internal serialized type": "Error", + "message": "Yield expression is not allowed in formal parameters (2:3)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "YieldInParameter" + }, + { + "$$ babel internal serialized type": "Error", + "message": "Binding invalid left-hand side in function parameter list (2:3)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "InvalidLhsBinding" + } ], "program": { "type": "Program", 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 9487db4a5868..ebc1aa9b3fab 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 @@ -2,8 +2,20 @@ "type": "File", "start":0,"end":41,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "errors": [ - "SyntaxError: Yield expression is not allowed in formal parameters (2:9)", - "SyntaxError: Binding invalid left-hand side in function parameter list (2:9)" + { + "$$ babel internal serialized type": "Error", + "message": "Yield expression is not allowed in formal parameters (2:9)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "YieldInParameter" + }, + { + "$$ babel internal serialized type": "Error", + "message": "Binding invalid left-hand side in function parameter list (2:9)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "InvalidLhsBinding" + } ], "program": { "type": "Program", 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 94529c93e1bf..0157c14e8148 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 @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "Can not use 'yield' as identifier inside a generator (1:11)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "YieldBindingIdentifier" + } ], "program": { "type": "Program", @@ -16,6 +22,10 @@ "expression": { "type": "ObjectExpression", "start":1,"end":22,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":22}}, + "extra": { + "parenthesized": true, + "parenStart": 0 + }, "properties": [ { "type": "ObjectMethod", @@ -45,11 +55,7 @@ "directives": [] } } - ], - "extra": { - "parenthesized": true, - "parenStart": 0 - } + ] } } ], 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 e26adaef5ce4..8d4a3aa406e7 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 @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "Can not use 'yield' as identifier inside a generator (1:13)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "YieldBindingIdentifier" + } ], "program": { "type": "Program", 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 a5d721d8ece0..d8f3e30033b6 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 @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":36,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":36}}, "errors": [ - "SyntaxError: Binding 'yield' in strict mode (1:12)" + { + "$$ babel internal serialized type": "Error", + "message": "Binding 'yield' in strict mode (1:12)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "StrictEvalArgumentsBinding" + } ], "program": { "type": "Program", @@ -38,11 +44,11 @@ "value": { "type": "DirectiveLiteral", "start":21,"end":33,"loc":{"start":{"line":1,"column":21},"end":{"line":1,"column":33}}, - "value": "use strict", "extra": { "raw": "\"use strict\"", "rawValue": "use strict" - } + }, + "value": "use strict" } } ] diff --git a/packages/babel-parser/test/fixtures/es2015/yield/parameter-name-strict/output.json b/packages/babel-parser/test/fixtures/es2015/yield/parameter-name-strict/output.json index e6116f716d19..5afd116c111f 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 @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":35,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":21}}, "errors": [ - "SyntaxError: Unexpected reserved word 'yield' (2:12)" + { + "$$ babel internal serialized type": "Error", + "message": "Unexpected reserved word 'yield' (2:12)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "UnexpectedReservedWord" + } ], "program": { "type": "Program", @@ -42,11 +48,11 @@ "value": { "type": "DirectiveLiteral", "start":0,"end":12,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":12}}, - "value": "use strict", "extra": { "raw": "\"use strict\"", "rawValue": "use strict" - } + }, + "value": "use strict" } } ] 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 180112bb930e..273482f9640b 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 @@ -2,8 +2,20 @@ "type": "File", "start":0,"end":33,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":33}}, "errors": [ - "SyntaxError: Yield expression is not allowed in formal parameters (1:17)", - "SyntaxError: Yield expression is not allowed in formal parameters (1:24)" + { + "$$ babel internal serialized type": "Error", + "message": "Yield expression is not allowed in formal parameters (1:17)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "YieldInParameter" + }, + { + "$$ babel internal serialized type": "Error", + "message": "Yield expression is not allowed in formal parameters (1:24)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "YieldInParameter" + } ], "program": { "type": "Program", 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 c0305a64da32..fe8e9baf1ac9 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 @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "Illegal expression. Wrap left hand side or entire exponentiation in parentheses. (1:1)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "UnexpectedTokenUnaryExponentiation" + } ], "program": { "type": "Program", 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 b71f64505f0f..717ca65423a7 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 @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "Illegal expression. Wrap left hand side or entire exponentiation in parentheses. (1:2)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "UnexpectedTokenUnaryExponentiation" + } ], "program": { "type": "Program", 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 510475c7e450..65543e4288e0 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 @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "Illegal expression. Wrap left hand side or entire exponentiation in parentheses. (1:2)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "UnexpectedTokenUnaryExponentiation" + } ], "program": { "type": "Program", @@ -16,6 +22,10 @@ "expression": { "type": "BinaryExpression", "start":1,"end":8,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":8}}, + "extra": { + "parenthesized": true, + "parenStart": 0 + }, "left": { "type": "UnaryExpression", "start":1,"end":3,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":3}}, @@ -40,10 +50,6 @@ "raw": "6" }, "value": 6 - }, - "extra": { - "parenthesized": true, - "parenStart": 0 } } } 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 d0582d584014..1f957c7b8e6c 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 @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "Illegal expression. Wrap left hand side or entire exponentiation in parentheses. (1:1)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "UnexpectedTokenUnaryExponentiation" + } ], "program": { "type": "Program", 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 33d3d6fe7f0c..e62fa0dd4a65 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 @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "Illegal expression. Wrap left hand side or entire exponentiation in parentheses. (1:2)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "UnexpectedTokenUnaryExponentiation" + } ], "program": { "type": "Program", 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 d034afbc9b42..fd28898611b1 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 @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "Illegal 'use strict' directive in function with non-simple parameter list (1:0)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "IllegalLanguageModeDirective" + } ], "program": { "type": "Program", @@ -58,11 +64,11 @@ "value": { "type": "DirectiveLiteral", "start":42,"end":54,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":14}}, - "value": "use strict", "extra": { "raw": "\"use strict\"", "rawValue": "use strict" - } + }, + "value": "use strict" } } ] diff --git a/packages/babel-parser/test/fixtures/es2016/simple-parameter-list/array-pattern/output.json b/packages/babel-parser/test/fixtures/es2016/simple-parameter-list/array-pattern/output.json index 35fd2a0adb9e..c27a0379b2f4 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 @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "Illegal 'use strict' directive in function with non-simple parameter list (1:0)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "IllegalLanguageModeDirective" + } ], "program": { "type": "Program", @@ -49,11 +55,11 @@ "value": { "type": "DirectiveLiteral", "start":37,"end":49,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":14}}, - "value": "use strict", "extra": { "raw": "\"use strict\"", "rawValue": "use strict" - } + }, + "value": "use strict" } } ] diff --git a/packages/babel-parser/test/fixtures/es2016/simple-parameter-list/arrow-function/output.json b/packages/babel-parser/test/fixtures/es2016/simple-parameter-list/arrow-function/output.json index e10dbf8aa28a..34cdf1d2fa66 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 @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "Illegal 'use strict' directive in function with non-simple parameter list (1:8)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "IllegalLanguageModeDirective" + } ], "program": { "type": "Program", @@ -55,11 +61,11 @@ "value": { "type": "DirectiveLiteral", "start":30,"end":42,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":14}}, - "value": "use strict", "extra": { "raw": "\"use strict\"", "rawValue": "use strict" - } + }, + "value": "use strict" } } ] diff --git a/packages/babel-parser/test/fixtures/es2016/simple-parameter-list/async-arrow-function/output.json b/packages/babel-parser/test/fixtures/es2016/simple-parameter-list/async-arrow-function/output.json index 2b90608b4c2a..4b8d345de07e 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 @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "Illegal 'use strict' directive in function with non-simple parameter list (1:8)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "IllegalLanguageModeDirective" + } ], "program": { "type": "Program", @@ -55,11 +61,11 @@ "value": { "type": "DirectiveLiteral", "start":36,"end":48,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":14}}, - "value": "use strict", "extra": { "raw": "\"use strict\"", "rawValue": "use strict" - } + }, + "value": "use strict" } } ] diff --git a/packages/babel-parser/test/fixtures/es2016/simple-parameter-list/async-function/output.json b/packages/babel-parser/test/fixtures/es2016/simple-parameter-list/async-function/output.json index 7e82b95fea8c..dbe90e02ecd7 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 @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "Illegal 'use strict' directive in function with non-simple parameter list (1:0)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "IllegalLanguageModeDirective" + } ], "program": { "type": "Program", @@ -47,11 +53,11 @@ "value": { "type": "DirectiveLiteral", "start":35,"end":47,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":14}}, - "value": "use strict", "extra": { "raw": "\"use strict\"", "rawValue": "use strict" - } + }, + "value": "use strict" } } ] diff --git a/packages/babel-parser/test/fixtures/es2016/simple-parameter-list/default/output.json b/packages/babel-parser/test/fixtures/es2016/simple-parameter-list/default/output.json index f07a72ed5d2f..a6ac74ae3c0b 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 @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "Illegal 'use strict' directive in function with non-simple parameter list (1:0)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "IllegalLanguageModeDirective" + } ], "program": { "type": "Program", @@ -47,11 +53,11 @@ "value": { "type": "DirectiveLiteral", "start":29,"end":41,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":14}}, - "value": "use strict", "extra": { "raw": "\"use strict\"", "rawValue": "use strict" - } + }, + "value": "use strict" } } ] diff --git a/packages/babel-parser/test/fixtures/es2016/simple-parameter-list/generator-function/output.json b/packages/babel-parser/test/fixtures/es2016/simple-parameter-list/generator-function/output.json index a75e2062efad..6fd125c54e3a 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 @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "Illegal 'use strict' directive in function with non-simple parameter list (1:0)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "IllegalLanguageModeDirective" + } ], "program": { "type": "Program", @@ -47,11 +53,11 @@ "value": { "type": "DirectiveLiteral", "start":30,"end":42,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":14}}, - "value": "use strict", "extra": { "raw": "\"use strict\"", "rawValue": "use strict" - } + }, + "value": "use strict" } } ] diff --git a/packages/babel-parser/test/fixtures/es2016/simple-parameter-list/generator-method/output.json b/packages/babel-parser/test/fixtures/es2016/simple-parameter-list/generator-method/output.json index 2838eba94dbe..83a2231a27b3 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 @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "Illegal 'use strict' directive in function with non-simple parameter list (2:5)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "IllegalLanguageModeDirective" + } ], "program": { "type": "Program", @@ -67,11 +73,11 @@ "value": { "type": "DirectiveLiteral", "start":38,"end":50,"loc":{"start":{"line":3,"column":4},"end":{"line":3,"column":16}}, - "value": "use strict", "extra": { "raw": "\"use strict\"", "rawValue": "use strict" - } + }, + "value": "use strict" } } ] diff --git a/packages/babel-parser/test/fixtures/es2016/simple-parameter-list/method/output.json b/packages/babel-parser/test/fixtures/es2016/simple-parameter-list/method/output.json index 496683da2364..c1347246c155 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 @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "Illegal 'use strict' directive in function with non-simple parameter list (2:3)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "IllegalLanguageModeDirective" + } ], "program": { "type": "Program", @@ -67,11 +73,11 @@ "value": { "type": "DirectiveLiteral", "start":36,"end":48,"loc":{"start":{"line":3,"column":4},"end":{"line":3,"column":16}}, - "value": "use strict", "extra": { "raw": "\"use strict\"", "rawValue": "use strict" - } + }, + "value": "use strict" } } ] diff --git a/packages/babel-parser/test/fixtures/es2016/simple-parameter-list/object-pattern-default/output.json b/packages/babel-parser/test/fixtures/es2016/simple-parameter-list/object-pattern-default/output.json index ce4565e35ae4..191bf1bcd49b 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 @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "Illegal 'use strict' directive in function with non-simple parameter list (1:0)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "IllegalLanguageModeDirective" + } ], "program": { "type": "Program", @@ -31,6 +37,9 @@ { "type": "ObjectProperty", "start":13,"end":20,"loc":{"start":{"line":1,"column":13},"end":{"line":1,"column":20}}, + "extra": { + "shorthand": true + }, "method": false, "key": { "type": "Identifier", @@ -43,14 +52,14 @@ "type": "Identifier", "start":13,"end":20,"loc":{"start":{"line":1,"column":13},"end":{"line":1,"column":20},"identifierName":"option1"}, "name": "option1" - }, - "extra": { - "shorthand": true } }, { "type": "ObjectProperty", "start":22,"end":29,"loc":{"start":{"line":1,"column":22},"end":{"line":1,"column":29}}, + "extra": { + "shorthand": true + }, "method": false, "key": { "type": "Identifier", @@ -63,9 +72,6 @@ "type": "Identifier", "start":22,"end":29,"loc":{"start":{"line":1,"column":22},"end":{"line":1,"column":29},"identifierName":"option2"}, "name": "option2" - }, - "extra": { - "shorthand": true } } ] @@ -88,11 +94,11 @@ "value": { "type": "DirectiveLiteral", "start":42,"end":54,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":14}}, - "value": "use strict", "extra": { "raw": "\"use strict\"", "rawValue": "use strict" - } + }, + "value": "use strict" } } ] diff --git a/packages/babel-parser/test/fixtures/es2016/simple-parameter-list/object-pattern/output.json b/packages/babel-parser/test/fixtures/es2016/simple-parameter-list/object-pattern/output.json index c51370c9d607..6e3d8c0c6ed7 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 @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "Illegal 'use strict' directive in function with non-simple parameter list (1:0)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "IllegalLanguageModeDirective" + } ], "program": { "type": "Program", @@ -28,6 +34,9 @@ { "type": "ObjectProperty", "start":13,"end":20,"loc":{"start":{"line":1,"column":13},"end":{"line":1,"column":20}}, + "extra": { + "shorthand": true + }, "method": false, "key": { "type": "Identifier", @@ -40,14 +49,14 @@ "type": "Identifier", "start":13,"end":20,"loc":{"start":{"line":1,"column":13},"end":{"line":1,"column":20},"identifierName":"option1"}, "name": "option1" - }, - "extra": { - "shorthand": true } }, { "type": "ObjectProperty", "start":22,"end":29,"loc":{"start":{"line":1,"column":22},"end":{"line":1,"column":29}}, + "extra": { + "shorthand": true + }, "method": false, "key": { "type": "Identifier", @@ -60,9 +69,6 @@ "type": "Identifier", "start":22,"end":29,"loc":{"start":{"line":1,"column":22},"end":{"line":1,"column":29},"identifierName":"option2"}, "name": "option2" - }, - "extra": { - "shorthand": true } } ] @@ -79,11 +85,11 @@ "value": { "type": "DirectiveLiteral", "start":37,"end":49,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":14}}, - "value": "use strict", "extra": { "raw": "\"use strict\"", "rawValue": "use strict" - } + }, + "value": "use strict" } } ] diff --git a/packages/babel-parser/test/fixtures/es2016/simple-parameter-list/rest/output.json b/packages/babel-parser/test/fixtures/es2016/simple-parameter-list/rest/output.json index 6287e339526c..37ade376fc17 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 @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "Illegal 'use strict' directive in function with non-simple parameter list (1:0)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "IllegalLanguageModeDirective" + } ], "program": { "type": "Program", @@ -42,11 +48,11 @@ "value": { "type": "DirectiveLiteral", "start":27,"end":39,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":14}}, - "value": "use strict", "extra": { "raw": "\"use strict\"", "rawValue": "use strict" - } + }, + "value": "use strict" } } ] diff --git a/packages/babel-parser/test/fixtures/es2017/async-arrow/parenthesized-array-pattern-nested-2/output.json b/packages/babel-parser/test/fixtures/es2017/async-arrow/parenthesized-array-pattern-nested-2/output.json index 690e665a2c86..f955eeda1603 100644 --- a/packages/babel-parser/test/fixtures/es2017/async-arrow/parenthesized-array-pattern-nested-2/output.json +++ b/packages/babel-parser/test/fixtures/es2017/async-arrow/parenthesized-array-pattern-nested-2/output.json @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":29,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":29}}, "errors": [ - "SyntaxError: Invalid parenthesized assignment pattern (1:9)" + { + "$$ babel internal serialized type": "Error", + "message": "Invalid parenthesized assignment pattern (1:9)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "InvalidParenthesizedAssignment" + } ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2017/async-arrow/parenthesized-array-pattern-nested/output.json b/packages/babel-parser/test/fixtures/es2017/async-arrow/parenthesized-array-pattern-nested/output.json index e2758e5bab29..dce666070db2 100644 --- a/packages/babel-parser/test/fixtures/es2017/async-arrow/parenthesized-array-pattern-nested/output.json +++ b/packages/babel-parser/test/fixtures/es2017/async-arrow/parenthesized-array-pattern-nested/output.json @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":34,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":34}}, "errors": [ - "SyntaxError: Invalid parenthesized assignment pattern (1:11)" + { + "$$ babel internal serialized type": "Error", + "message": "Invalid parenthesized assignment pattern (1:11)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "InvalidParenthesizedAssignment" + } ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2017/async-arrow/parenthesized-binding-identifier/output.json b/packages/babel-parser/test/fixtures/es2017/async-arrow/parenthesized-binding-identifier/output.json index 984ab4dbde4c..0bedd00a4c1c 100644 --- a/packages/babel-parser/test/fixtures/es2017/async-arrow/parenthesized-binding-identifier/output.json +++ b/packages/babel-parser/test/fixtures/es2017/async-arrow/parenthesized-binding-identifier/output.json @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":30,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":30}}, "errors": [ - "SyntaxError: Invalid parenthesized assignment pattern (1:18)" + { + "$$ babel internal serialized type": "Error", + "message": "Invalid parenthesized assignment pattern (1:18)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "InvalidParenthesizedAssignment" + } ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2017/async-arrow/parenthesized-binding-member-expression/output.json b/packages/babel-parser/test/fixtures/es2017/async-arrow/parenthesized-binding-member-expression/output.json index 9afdf9f5fa55..21f09e2fe7a3 100644 --- a/packages/babel-parser/test/fixtures/es2017/async-arrow/parenthesized-binding-member-expression/output.json +++ b/packages/babel-parser/test/fixtures/es2017/async-arrow/parenthesized-binding-member-expression/output.json @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":31,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":31}}, "errors": [ - "SyntaxError: Binding member expression (1:9)" + { + "$$ babel internal serialized type": "Error", + "message": "Binding member expression (1:9)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "InvalidPropertyBindingPattern" + } ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2017/async-arrow/parenthesized-binding-pattern/output.json b/packages/babel-parser/test/fixtures/es2017/async-arrow/parenthesized-binding-pattern/output.json index 2113ddb5a8da..a975ad35eb91 100644 --- a/packages/babel-parser/test/fixtures/es2017/async-arrow/parenthesized-binding-pattern/output.json +++ b/packages/babel-parser/test/fixtures/es2017/async-arrow/parenthesized-binding-pattern/output.json @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":32,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":32}}, "errors": [ - "SyntaxError: Invalid parenthesized assignment pattern (1:19)" + { + "$$ babel internal serialized type": "Error", + "message": "Invalid parenthesized assignment pattern (1:19)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "InvalidParenthesizedAssignment" + } ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2017/async-arrow/parenthesized-rest-array/output.json b/packages/babel-parser/test/fixtures/es2017/async-arrow/parenthesized-rest-array/output.json index 0d501cde269f..fc76756138a9 100644 --- a/packages/babel-parser/test/fixtures/es2017/async-arrow/parenthesized-rest-array/output.json +++ b/packages/babel-parser/test/fixtures/es2017/async-arrow/parenthesized-rest-array/output.json @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":35,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":35}}, "errors": [ - "SyntaxError: Invalid parenthesized assignment pattern (1:22)" + { + "$$ babel internal serialized type": "Error", + "message": "Invalid parenthesized assignment pattern (1:22)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "InvalidParenthesizedAssignment" + } ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2017/async-arrow/parenthesized-rest-object/output.json b/packages/babel-parser/test/fixtures/es2017/async-arrow/parenthesized-rest-object/output.json index 66f60ce4f6af..11d82d74b6be 100644 --- a/packages/babel-parser/test/fixtures/es2017/async-arrow/parenthesized-rest-object/output.json +++ b/packages/babel-parser/test/fixtures/es2017/async-arrow/parenthesized-rest-object/output.json @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":35,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":35}}, "errors": [ - "SyntaxError: Invalid parenthesized assignment pattern (1:22)" + { + "$$ babel internal serialized type": "Error", + "message": "Invalid parenthesized assignment pattern (1:22)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "InvalidParenthesizedAssignment" + } ], "program": { "type": "Program", 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 78391ab5a0e9..a82ca3e82ae3 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 @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "await* has been removed from the async functions proposal. Use Promise.all() instead. (2:2)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "ObsoleteAwaitStar" + } ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2017/async-functions/9/output.json b/packages/babel-parser/test/fixtures/es2017/async-functions/9/output.json index 27d691134ed7..cb1aa8c6de4a 100644 --- a/packages/babel-parser/test/fixtures/es2017/async-functions/9/output.json +++ b/packages/babel-parser/test/fixtures/es2017/async-functions/9/output.json @@ -2,7 +2,12 @@ "type": "File", "start":0,"end":40,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":40}}, "errors": [ - "SyntaxError: 'await' is only allowed within async functions (1:24)" + { + "$$ babel internal serialized type": "Error", + "message": "'await' is only allowed within async functions (1:24)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR" + } ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2017/async-functions/allow-await-outside-function-throw/output.json b/packages/babel-parser/test/fixtures/es2017/async-functions/allow-await-outside-function-throw/output.json index 8f13d165a4be..46606ece00f1 100644 --- a/packages/babel-parser/test/fixtures/es2017/async-functions/allow-await-outside-function-throw/output.json +++ b/packages/babel-parser/test/fixtures/es2017/async-functions/allow-await-outside-function-throw/output.json @@ -2,7 +2,12 @@ "type": "File", "start":0,"end":33,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "errors": [ - "SyntaxError: 'await' is only allowed within async functions (2:9)" + { + "$$ babel internal serialized type": "Error", + "message": "'await' is only allowed within async functions (2:9)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR" + } ], "program": { "type": "Program", 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 09b554179dcb..5232eb811a93 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 @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":17,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":17}}, "errors": [ - "SyntaxError: Can not use 'await' as identifier inside an async function (1:6)" + { + "$$ babel internal serialized type": "Error", + "message": "Can not use 'await' as identifier inside an async function (1:6)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "AwaitBindingIdentifier" + } ], "program": { "type": "Program", 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 db893c17265e..f2372374d475 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 @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "Can not use 'await' as identifier inside an async function (1:16)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "AwaitBindingIdentifier" + } ], "program": { "type": "Program", @@ -16,6 +22,10 @@ "expression": { "type": "FunctionExpression", "start":1,"end":26,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":26}}, + "extra": { + "parenthesized": true, + "parenStart": 0 + }, "id": { "type": "Identifier", "start":16,"end":21,"loc":{"start":{"line":1,"column":16},"end":{"line":1,"column":21},"identifierName":"await"}, @@ -29,10 +39,6 @@ "start":24,"end":26,"loc":{"start":{"line":1,"column":24},"end":{"line":1,"column":26}}, "body": [], "directives": [] - }, - "extra": { - "parenthesized": true, - "parenStart": 0 } } } diff --git a/packages/babel-parser/test/fixtures/es2017/async-functions/await-binding-inside-arrow-params-inside-async-arrow-params/output.json b/packages/babel-parser/test/fixtures/es2017/async-functions/await-binding-inside-arrow-params-inside-async-arrow-params/output.json index eda5cd44dbcc..bc9100863651 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 @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":36,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":36}}, "errors": [ - "SyntaxError: Can not use 'await' as identifier inside an async function (1:14)" + { + "$$ babel internal serialized type": "Error", + "message": "Can not use 'await' as identifier inside an async function (1:14)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "AwaitBindingIdentifier" + } ], "program": { "type": "Program", 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 1f579129c72b..c4b80192db9d 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 @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "Can not use 'await' as identifier inside an async function (2:11)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "AwaitBindingIdentifier" + } ], "program": { "type": "Program", 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 9f22c79e0538..d433fc856c80 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 @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":63,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "errors": [ - "SyntaxError: await is not allowed in async function parameters (2:23)" + { + "$$ babel internal serialized type": "Error", + "message": "await is not allowed in async function parameters (2:23)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "AwaitExpressionFormalParameter" + } ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2017/async-functions/await-inside-arrow-expression-disallowed/output.json b/packages/babel-parser/test/fixtures/es2017/async-functions/await-inside-arrow-expression-disallowed/output.json index 506ce33b909e..a39060663420 100644 --- a/packages/babel-parser/test/fixtures/es2017/async-functions/await-inside-arrow-expression-disallowed/output.json +++ b/packages/babel-parser/test/fixtures/es2017/async-functions/await-inside-arrow-expression-disallowed/output.json @@ -2,7 +2,12 @@ "type": "File", "start":0,"end":17,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":17}}, "errors": [ - "SyntaxError: 'await' is only allowed within async functions (1:8)" + { + "$$ babel internal serialized type": "Error", + "message": "'await' is only allowed within async functions (1:8)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR" + } ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2017/async-functions/await-inside-parameters-of-async-arrow-function/output.json b/packages/babel-parser/test/fixtures/es2017/async-functions/await-inside-parameters-of-async-arrow-function/output.json index 287f8eae4418..066f5b4ec647 100644 --- a/packages/babel-parser/test/fixtures/es2017/async-functions/await-inside-parameters-of-async-arrow-function/output.json +++ b/packages/babel-parser/test/fixtures/es2017/async-functions/await-inside-parameters-of-async-arrow-function/output.json @@ -2,8 +2,19 @@ "type": "File", "start":0,"end":26,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":26}}, "errors": [ - "SyntaxError: 'await' is only allowed within async functions (1:11)", - "SyntaxError: await is not allowed in async function parameters (1:11)" + { + "$$ babel internal serialized type": "Error", + "message": "'await' is only allowed within async functions (1:11)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR" + }, + { + "$$ babel internal serialized type": "Error", + "message": "await is not allowed in async function parameters (1:11)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "AwaitExpressionFormalParameter" + } ], "program": { "type": "Program", 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 9f925a342f48..c08b2a97b39a 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 @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":46,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "errors": [ - "SyntaxError: await is not allowed in async function parameters (2:7)" + { + "$$ babel internal serialized type": "Error", + "message": "await is not allowed in async function parameters (2:7)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "AwaitExpressionFormalParameter" + } ], "program": { "type": "Program", 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 e24dce562a95..f2c3b2fc522a 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 @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":52,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "errors": [ - "SyntaxError: await is not allowed in async function parameters (2:13)" + { + "$$ babel internal serialized type": "Error", + "message": "await is not allowed in async function parameters (2:13)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "AwaitExpressionFormalParameter" + } ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2017/async-functions/await-inside-parameters-of-nested-function/output.json b/packages/babel-parser/test/fixtures/es2017/async-functions/await-inside-parameters-of-nested-function/output.json index 444930868eef..b155ab451ec2 100644 --- a/packages/babel-parser/test/fixtures/es2017/async-functions/await-inside-parameters-of-nested-function/output.json +++ b/packages/babel-parser/test/fixtures/es2017/async-functions/await-inside-parameters-of-nested-function/output.json @@ -2,8 +2,19 @@ "type": "File", "start":0,"end":55,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "errors": [ - "SyntaxError: 'await' is only allowed within async functions (2:19)", - "SyntaxError: await is not allowed in async function parameters (2:19)" + { + "$$ babel internal serialized type": "Error", + "message": "'await' is only allowed within async functions (2:19)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR" + }, + { + "$$ babel internal serialized type": "Error", + "message": "await is not allowed in async function parameters (2:19)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "AwaitExpressionFormalParameter" + } ], "program": { "type": "Program", 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 fcf89fb5daef..323d6efc0e2e 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 @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "await is not allowed in async function parameters (1:22)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "AwaitExpressionFormalParameter" + } ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2017/async-functions/invalid-await-with-object-exp-in-function/output.json b/packages/babel-parser/test/fixtures/es2017/async-functions/invalid-await-with-object-exp-in-function/output.json index cd71c7cea376..5afef4145b90 100644 --- a/packages/babel-parser/test/fixtures/es2017/async-functions/invalid-await-with-object-exp-in-function/output.json +++ b/packages/babel-parser/test/fixtures/es2017/async-functions/invalid-await-with-object-exp-in-function/output.json @@ -2,7 +2,12 @@ "type": "File", "start":0,"end":35,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "errors": [ - "SyntaxError: 'await' is only allowed within async functions (2:2)" + { + "$$ babel internal serialized type": "Error", + "message": "'await' is only allowed within async functions (2:2)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR" + } ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2017/async-functions/invalid-escape-await/output.json b/packages/babel-parser/test/fixtures/es2017/async-functions/invalid-escape-await/output.json index 7a8990917905..32d3ca899453 100644 --- a/packages/babel-parser/test/fixtures/es2017/async-functions/invalid-escape-await/output.json +++ b/packages/babel-parser/test/fixtures/es2017/async-functions/invalid-escape-await/output.json @@ -2,8 +2,20 @@ "type": "File", "start":0,"end":35,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":35}}, "errors": [ - "SyntaxError: Can not use 'await' as identifier inside an async function (1:20)", - "SyntaxError: Missing semicolon (1:30)" + { + "$$ babel internal serialized type": "Error", + "message": "Can not use 'await' as identifier inside an async function (1:20)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "AwaitBindingIdentifier" + }, + { + "$$ babel internal serialized type": "Error", + "message": "Missing semicolon (1:30)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "MissingSemicolon" + } ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2017/async-functions/invalid-escape-export-dflt-async-function/output.json b/packages/babel-parser/test/fixtures/es2017/async-functions/invalid-escape-export-dflt-async-function/output.json index 93d68bf0ca6a..07887c881969 100644 --- a/packages/babel-parser/test/fixtures/es2017/async-functions/invalid-escape-export-dflt-async-function/output.json +++ b/packages/babel-parser/test/fixtures/es2017/async-functions/invalid-escape-export-dflt-async-function/output.json @@ -2,8 +2,20 @@ "type": "File", "start":0,"end":50,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":50}}, "errors": [ - "SyntaxError: Missing semicolon (1:25)", - "SyntaxError: 'await' is only allowed within async functions (1:41)" + { + "$$ babel internal serialized type": "Error", + "message": "Missing semicolon (1:25)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "MissingSemicolon" + }, + { + "$$ babel internal serialized type": "Error", + "message": "'await' is only allowed within async functions (1:41)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "UnexpectedReservedWord" + } ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2017/async-functions/invalid-escape-sequence-arrow/output.json b/packages/babel-parser/test/fixtures/es2017/async-functions/invalid-escape-sequence-arrow/output.json index 66a170b05abf..617329b1ba85 100644 --- a/packages/babel-parser/test/fixtures/es2017/async-functions/invalid-escape-sequence-arrow/output.json +++ b/packages/babel-parser/test/fixtures/es2017/async-functions/invalid-escape-sequence-arrow/output.json @@ -2,8 +2,19 @@ "type": "File", "start":0,"end":27,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":27}}, "errors": [ - "SyntaxError: Missing semicolon (1:10)", - "SyntaxError: 'await' is only allowed within async functions (1:18)" + { + "$$ babel internal serialized type": "Error", + "message": "Missing semicolon (1:10)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "MissingSemicolon" + }, + { + "$$ babel internal serialized type": "Error", + "message": "'await' is only allowed within async functions (1:18)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR" + } ], "program": { "type": "Program", 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 139be62a2f65..b4c2a5ef1449 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 @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "Async functions can only be declared at the top level or inside a block (1:10)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "AsyncFunctionInSingleStatementContext" + } ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2017/async-functions/invalid-parens-async-func/output.json b/packages/babel-parser/test/fixtures/es2017/async-functions/invalid-parens-async-func/output.json index 456b35386a38..2499be8ca9ee 100644 --- a/packages/babel-parser/test/fixtures/es2017/async-functions/invalid-parens-async-func/output.json +++ b/packages/babel-parser/test/fixtures/es2017/async-functions/invalid-parens-async-func/output.json @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":25,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":25}}, "errors": [ - "SyntaxError: Missing semicolon (1:7)" + { + "$$ babel internal serialized type": "Error", + "message": "Missing semicolon (1:7)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "MissingSemicolon" + } ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2017/async-functions/multiple-await-in-async-arrow-params/output.json b/packages/babel-parser/test/fixtures/es2017/async-functions/multiple-await-in-async-arrow-params/output.json index a110b8160114..211eab9ca540 100644 --- a/packages/babel-parser/test/fixtures/es2017/async-functions/multiple-await-in-async-arrow-params/output.json +++ b/packages/babel-parser/test/fixtures/es2017/async-functions/multiple-await-in-async-arrow-params/output.json @@ -2,8 +2,20 @@ "type": "File", "start":0,"end":46,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":46}}, "errors": [ - "SyntaxError: Can not use 'await' as identifier inside an async function (1:15)", - "SyntaxError: Can not use 'await' as identifier inside an async function (1:30)" + { + "$$ babel internal serialized type": "Error", + "message": "Can not use 'await' as identifier inside an async function (1:15)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "AwaitBindingIdentifier" + }, + { + "$$ babel internal serialized type": "Error", + "message": "Can not use 'await' as identifier inside an async function (1:30)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "AwaitBindingIdentifier" + } ], "program": { "type": "Program", @@ -124,4 +136,4 @@ ], "directives": [] } -} +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/es2017/async-functions/newline-before-arrow/output.json b/packages/babel-parser/test/fixtures/es2017/async-functions/newline-before-arrow/output.json index 19ade021f45f..bd5199c061c6 100644 --- a/packages/babel-parser/test/fixtures/es2017/async-functions/newline-before-arrow/output.json +++ b/packages/babel-parser/test/fixtures/es2017/async-functions/newline-before-arrow/output.json @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":12,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":4}}, "errors": [ - "SyntaxError: No line break is allowed before '=>' (2:2)" + { + "$$ babel internal serialized type": "Error", + "message": "No line break is allowed before '=>' (2:2)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "LineTerminatorBeforeArrow" + } ], "program": { "type": "Program", @@ -36,4 +42,4 @@ ], "directives": [] } -} +} \ No newline at end of file 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 abbe3abb2682..a5cb42e91567 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 @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "Constructor can't be an async function (2:8)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "ConstructorIsAsync" + } ], "program": { "type": "Program", 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 630b3e12ebc1..aad7b889a5a1 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 @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "Unexpected trailing comma after rest element (1:11)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "RestTrailingComma" + } ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2017/trailing-function-commas/5/output.json b/packages/babel-parser/test/fixtures/es2017/trailing-function-commas/5/output.json index 8b4d3abd36f3..b97f439fc283 100644 --- a/packages/babel-parser/test/fixtures/es2017/trailing-function-commas/5/output.json +++ b/packages/babel-parser/test/fixtures/es2017/trailing-function-commas/5/output.json @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":7,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":7}}, "errors": [ - "SyntaxError: Unexpected token ',' (1:5)" + { + "$$ babel internal serialized type": "Error", + "message": "Unexpected token ',' (1:5)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "UnexpectedToken" + } ], "program": { "type": "Program", @@ -16,14 +22,14 @@ "expression": { "type": "CallExpression", "start":0,"end":6,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":6}}, + "extra": { + "trailingComma": 4 + }, "callee": { "type": "Identifier", "start":0,"end":3,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":3},"identifierName":"log"}, "name": "log" }, - "extra": { - "trailingComma": 4 - }, "arguments": [ null ] diff --git a/packages/babel-parser/test/fixtures/es2018/object-rest-spread/11/output.json b/packages/babel-parser/test/fixtures/es2018/object-rest-spread/11/output.json index 9107e6623d36..4b9202b61907 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 @@ -2,8 +2,20 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "Identifier 'foo' has already been declared (2:23)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "VarRedeclaration" + }, + { + "$$ babel internal serialized type": "Error", + "message": "`foo` has already been exported. Exported identifiers must be unique. (2:23)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "DuplicateExport" + } ], "program": { "type": "Program", @@ -61,6 +73,9 @@ { "type": "ObjectProperty", "start":37,"end":40,"loc":{"start":{"line":2,"column":15},"end":{"line":2,"column":18}}, + "extra": { + "shorthand": true + }, "method": false, "key": { "type": "Identifier", @@ -73,9 +88,6 @@ "type": "Identifier", "start":37,"end":40,"loc":{"start":{"line":2,"column":15},"end":{"line":2,"column":18},"identifierName":"bar"}, "name": "bar" - }, - "extra": { - "shorthand": true } }, { diff --git a/packages/babel-parser/test/fixtures/es2018/object-rest-spread/12/output.json b/packages/babel-parser/test/fixtures/es2018/object-rest-spread/12/output.json index ff6a186270d8..0860aba135c5 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 @@ -2,8 +2,20 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "Identifier 'bar' has already been declared (2:13)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "VarRedeclaration" + }, + { + "$$ babel internal serialized type": "Error", + "message": "`bar` has already been exported. Exported identifiers must be unique. (2:13)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "DuplicateExport" + } ], "program": { "type": "Program", @@ -30,6 +42,9 @@ { "type": "ObjectProperty", "start":15,"end":18,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":18}}, + "extra": { + "shorthand": true + }, "method": false, "key": { "type": "Identifier", @@ -42,9 +57,6 @@ "type": "Identifier", "start":15,"end":18,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":18},"identifierName":"foo"}, "name": "foo" - }, - "extra": { - "shorthand": true } }, { diff --git a/packages/babel-parser/test/fixtures/es2018/object-rest-spread/13/output.json b/packages/babel-parser/test/fixtures/es2018/object-rest-spread/13/output.json index 4488d18649b4..ee0cc075bcde 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 @@ -2,8 +2,20 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "Identifier 'foo' has already been declared (2:30)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "VarRedeclaration" + }, + { + "$$ babel internal serialized type": "Error", + "message": "`foo` has already been exported. Exported identifiers must be unique. (2:30)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "DuplicateExport" + } ], "program": { "type": "Program", @@ -76,6 +88,9 @@ { "type": "ObjectProperty", "start":44,"end":47,"loc":{"start":{"line":2,"column":22},"end":{"line":2,"column":25}}, + "extra": { + "shorthand": true + }, "method": false, "key": { "type": "Identifier", @@ -88,9 +103,6 @@ "type": "Identifier", "start":44,"end":47,"loc":{"start":{"line":2,"column":22},"end":{"line":2,"column":25},"identifierName":"baz"}, "name": "baz" - }, - "extra": { - "shorthand": true } }, { diff --git a/packages/babel-parser/test/fixtures/es2018/object-rest-spread/14/output.json b/packages/babel-parser/test/fixtures/es2018/object-rest-spread/14/output.json index e3429dd5577b..ce4cc60f3754 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 @@ -2,8 +2,20 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "Identifier 'foo' has already been declared (2:29)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "VarRedeclaration" + }, + { + "$$ babel internal serialized type": "Error", + "message": "`foo` has already been exported. Exported identifiers must be unique. (2:29)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "DuplicateExport" + } ], "program": { "type": "Program", @@ -70,6 +82,9 @@ { "type": "ObjectProperty", "start":43,"end":46,"loc":{"start":{"line":2,"column":21},"end":{"line":2,"column":24}}, + "extra": { + "shorthand": true + }, "method": false, "key": { "type": "Identifier", @@ -82,9 +97,6 @@ "type": "Identifier", "start":43,"end":46,"loc":{"start":{"line":2,"column":21},"end":{"line":2,"column":24},"identifierName":"baz"}, "name": "baz" - }, - "extra": { - "shorthand": true } }, { diff --git a/packages/babel-parser/test/fixtures/es2018/object-rest-spread/15/output.json b/packages/babel-parser/test/fixtures/es2018/object-rest-spread/15/output.json index ebce9c22593d..7860d6439722 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 @@ -2,8 +2,20 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "Identifier 'foo' has already been declared (2:30)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "VarRedeclaration" + }, + { + "$$ babel internal serialized type": "Error", + "message": "`foo` has already been exported. Exported identifiers must be unique. (2:30)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "DuplicateExport" + } ], "program": { "type": "Program", @@ -74,6 +86,9 @@ { "type": "ObjectProperty", "start":44,"end":47,"loc":{"start":{"line":2,"column":22},"end":{"line":2,"column":25}}, + "extra": { + "shorthand": true + }, "method": false, "key": { "type": "Identifier", @@ -86,9 +101,6 @@ "type": "Identifier", "start":44,"end":47,"loc":{"start":{"line":2,"column":22},"end":{"line":2,"column":25},"identifierName":"baz"}, "name": "baz" - }, - "extra": { - "shorthand": true } }, { diff --git a/packages/babel-parser/test/fixtures/es2018/object-rest-spread/18/output.json b/packages/babel-parser/test/fixtures/es2018/object-rest-spread/18/output.json index 5f904177a72c..b59d42618a48 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 @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":14,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":14}}, "errors": [ - "SyntaxError: Invalid rest operator's argument (1:5)" + { + "$$ babel internal serialized type": "Error", + "message": "Invalid rest operator's argument (1:5)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "InvalidRestAssignmentPattern" + } ], "program": { "type": "Program", @@ -16,6 +22,10 @@ "expression": { "type": "AssignmentExpression", "start":1,"end":13,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":13}}, + "extra": { + "parenthesized": true, + "parenStart": 0 + }, "operator": "=", "left": { "type": "ObjectPattern", @@ -36,10 +46,6 @@ "type": "ObjectExpression", "start":11,"end":13,"loc":{"start":{"line":1,"column":11},"end":{"line":1,"column":13}}, "properties": [] - }, - "extra": { - "parenthesized": true, - "parenStart": 0 } } } diff --git a/packages/babel-parser/test/fixtures/es2018/object-rest-spread/21/output.json b/packages/babel-parser/test/fixtures/es2018/object-rest-spread/21/output.json index 53d79afbca84..e5f463a16f37 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 @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":17,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":17}}, "errors": [ - "SyntaxError: Invalid rest operator's argument (1:5)" + { + "$$ babel internal serialized type": "Error", + "message": "Invalid rest operator's argument (1:5)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "InvalidRestAssignmentPattern" + } ], "program": { "type": "Program", @@ -16,6 +22,10 @@ "expression": { "type": "AssignmentExpression", "start":1,"end":16,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":16}}, + "extra": { + "parenthesized": true, + "parenStart": 0 + }, "operator": "=", "left": { "type": "ObjectPattern", @@ -49,10 +59,6 @@ "type": "ObjectExpression", "start":14,"end":16,"loc":{"start":{"line":1,"column":14},"end":{"line":1,"column":16}}, "properties": [] - }, - "extra": { - "parenthesized": true, - "parenStart": 0 } } } diff --git a/packages/babel-parser/test/fixtures/es2018/object-rest-spread/24/output.json b/packages/babel-parser/test/fixtures/es2018/object-rest-spread/24/output.json index 95a5979a014e..fe3e8f897bcc 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 @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":14,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":14}}, "errors": [ - "SyntaxError: Invalid rest operator's argument (1:5)" + { + "$$ babel internal serialized type": "Error", + "message": "Invalid rest operator's argument (1:5)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "InvalidRestAssignmentPattern" + } ], "program": { "type": "Program", @@ -16,6 +22,10 @@ "expression": { "type": "AssignmentExpression", "start":1,"end":13,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":13}}, + "extra": { + "parenthesized": true, + "parenStart": 0 + }, "operator": "=", "left": { "type": "ObjectPattern", @@ -36,10 +46,6 @@ "type": "ObjectExpression", "start":11,"end":13,"loc":{"start":{"line":1,"column":11},"end":{"line":1,"column":13}}, "properties": [] - }, - "extra": { - "parenthesized": true, - "parenStart": 0 } } } diff --git a/packages/babel-parser/test/fixtures/es2018/object-rest-spread/8/output.json b/packages/babel-parser/test/fixtures/es2018/object-rest-spread/8/output.json index 507c8b34b2b7..07867e0b5205 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 @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "Unexpected trailing comma after rest element (1:16)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "RestTrailingComma" + } ], "program": { "type": "Program", @@ -20,10 +26,16 @@ "id": { "type": "ObjectPattern", "start":4,"end":19,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":19}}, + "extra": { + "trailingComma": 16 + }, "properties": [ { "type": "ObjectProperty", "start":6,"end":7,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":7}}, + "extra": { + "shorthand": true + }, "method": false, "key": { "type": "Identifier", @@ -36,14 +48,14 @@ "type": "Identifier", "start":6,"end":7,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":7},"identifierName":"x"}, "name": "x" - }, - "extra": { - "shorthand": true } }, { "type": "ObjectProperty", "start":9,"end":10,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":10}}, + "extra": { + "shorthand": true + }, "method": false, "key": { "type": "Identifier", @@ -56,9 +68,6 @@ "type": "Identifier", "start":9,"end":10,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":10},"identifierName":"y"}, "name": "y" - }, - "extra": { - "shorthand": true } }, { @@ -70,10 +79,7 @@ "name": "z" } } - ], - "extra": { - "trailingComma": 16 - } + ] }, "init": { "type": "Identifier", 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 65fe5c762cc1..7a4ea93ea27d 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 @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":4,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":4}}, "errors": [ - "SyntaxError: Invalid BigIntLiteral (1:0)" + { + "$$ babel internal serialized type": "Error", + "message": "Invalid BigIntLiteral (1:0)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "InvalidBigIntLiteral" + } ], "program": { "type": "Program", 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 ece9adc5b936..6d4e09691bef 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 @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":4,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":4}}, "errors": [ - "SyntaxError: Invalid BigIntLiteral (1:0)" + { + "$$ babel internal serialized type": "Error", + "message": "Invalid BigIntLiteral (1:0)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "InvalidBigIntLiteral" + } ], "program": { "type": "Program", 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 c7ff73f0e76a..8077ecfb58df 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 @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":4,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":4}}, "errors": [ - "SyntaxError: Invalid BigIntLiteral (1:0)" + { + "$$ babel internal serialized type": "Error", + "message": "Invalid BigIntLiteral (1:0)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "InvalidBigIntLiteral" + } ], "program": { "type": "Program", 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 8f1e2836cd40..934609f56eee 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 @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":7,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":7}}, "errors": [ - "SyntaxError: Invalid BigIntLiteral (1:0)" + { + "$$ babel internal serialized type": "Error", + "message": "Invalid BigIntLiteral (1:0)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "InvalidBigIntLiteral" + } ], "program": { "type": "Program", 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 2a5318f72b14..ad708d82cbf8 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 @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":49,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "errors": [ - "SyntaxError: The only valid meta property for import is import.meta (2:16)" + { + "$$ babel internal serialized type": "Error", + "message": "The only valid meta property for import is import.meta (2:16)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "UnsupportedMetaProperty" + } ], "program": { "type": "Program", 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 11c9e8f7db62..f08df586f6ff 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 @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":14,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":14}}, "errors": [ - "SyntaxError: ... is not allowed in import() (1:7)" + { + "$$ babel internal serialized type": "Error", + "message": "... is not allowed in import() (1:7)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "ImportCallSpreadArgument" + } ], "program": { "type": "Program", 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 246d3d373cb5..5216a5aecfbd 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 @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":18,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":18}}, "errors": [ - "SyntaxError: Cannot use new with import(...) (1:4)" + { + "$$ babel internal serialized type": "Error", + "message": "Cannot use new with import(...) (1:4)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "ImportCallNotNewExpression" + } ], "program": { "type": "Program", 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 6e5fa8365696..d81deb129f80 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 @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "Trailing comma is disallowed inside import(...) arguments (1:12)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "ImportCallArgumentTrailingComma" + } ], "program": { "type": "Program", @@ -16,13 +22,13 @@ "expression": { "type": "CallExpression", "start":0,"end":14,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":14}}, + "extra": { + "trailingComma": 12 + }, "callee": { "type": "Import", "start":0,"end":6,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":6}} }, - "extra": { - "trailingComma": 12 - }, "arguments": [ { "type": "StringLiteral", diff --git a/packages/babel-parser/test/fixtures/es2020/dynamic-import/multiple-args/output.json b/packages/babel-parser/test/fixtures/es2020/dynamic-import/multiple-args/output.json index 0c67a4f67b22..fdf4cba8d363 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 @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":30,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":30}}, "errors": [ - "SyntaxError: import() requires exactly one argument (1:0)" + { + "$$ babel internal serialized type": "Error", + "message": "import() requires exactly one argument (1:0)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "ImportCallArity" + } ], "program": { "type": "Program", 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 fe2978c702f4..7abb14d65ea7 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 @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":9,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":9}}, "errors": [ - "SyntaxError: import() requires exactly one argument (1:0)" + { + "$$ babel internal serialized type": "Error", + "message": "import() requires exactly one argument (1:0)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "ImportCallArity" + } ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2020/import-meta/error-in-script/output.json b/packages/babel-parser/test/fixtures/es2020/import-meta/error-in-script/output.json index 003b67cda8cb..686f3bdf54ca 100644 --- a/packages/babel-parser/test/fixtures/es2020/import-meta/error-in-script/output.json +++ b/packages/babel-parser/test/fixtures/es2020/import-meta/error-in-script/output.json @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "import.meta may appear only with 'sourceType: \"module\"' (1:10)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SOURCETYPE_MODULE_REQUIRED", + "reasonCode": "ImportMetaOutsideModule" + } ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2020/import-meta/no-other-prop-names/output.json b/packages/babel-parser/test/fixtures/es2020/import-meta/no-other-prop-names/output.json index c03b9e7046c7..95d54ba661f4 100644 --- a/packages/babel-parser/test/fixtures/es2020/import-meta/no-other-prop-names/output.json +++ b/packages/babel-parser/test/fixtures/es2020/import-meta/no-other-prop-names/output.json @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "The only valid meta property for import is import.meta (1:7)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "UnsupportedMetaProperty" + } ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2020/import-meta/not-assignable/output.json b/packages/babel-parser/test/fixtures/es2020/import-meta/not-assignable/output.json index 5e1510e58fe0..b9d764a31dbb 100644 --- a/packages/babel-parser/test/fixtures/es2020/import-meta/not-assignable/output.json +++ b/packages/babel-parser/test/fixtures/es2020/import-meta/not-assignable/output.json @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "Invalid left-hand side in assignment expression (1:0)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "InvalidLhs" + } ], "program": { "type": "Program", 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 c5497bf4eb8d..ac0b4b564e3e 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 @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "constructors in/after an Optional Chain are not allowed (1:10)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "OptionalChainingNoNew" + } ], "program": { "type": "Program", @@ -27,20 +33,20 @@ "start":4,"end":5,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":5},"identifierName":"C"}, "name": "C" }, + "computed": false, "property": { "type": "Identifier", "start":7,"end":8,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":8},"identifierName":"b"}, "name": "b" }, - "computed": false, "optional": true }, + "computed": false, "property": { "type": "Identifier", "start":9,"end":10,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":10},"identifierName":"d"}, "name": "d" }, - "computed": false, "optional": false }, "arguments": [] 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 5039bd06d927..385d58d8c476 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 @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "constructors in/after an Optional Chain are not allowed (1:7)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "OptionalChainingNoNew" + } ], "program": { "type": "Program", 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 dc31af9de392..51acbcc87b12 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 @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "super can only be used with function calls (i.e. super()) or in property accesses (i.e. super.prop or super[prop]) (3:15)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "UnsupportedSuper" + } ], "program": { "type": "Program", @@ -52,12 +58,12 @@ "type": "Super", "start":33,"end":38,"loc":{"start":{"line":3,"column":15},"end":{"line":3,"column":20}} }, + "computed": false, "property": { "type": "Identifier", "start":40,"end":41,"loc":{"start":{"line":3,"column":22},"end":{"line":3,"column":23},"identifierName":"b"}, "name": "b" }, - "computed": false, "optional": true } } 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 393e2fd7451f..564e817bb0b3 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 @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "super can only be used with function calls (i.e. super()) or in property accesses (i.e. super.prop or super[prop]) (3:15)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "UnsupportedSuper" + } ], "program": { "type": "Program", @@ -55,12 +61,12 @@ "type": "Super", "start":36,"end":41,"loc":{"start":{"line":3,"column":15},"end":{"line":3,"column":20}} }, + "computed": false, "property": { "type": "Identifier", "start":43,"end":44,"loc":{"start":{"line":3,"column":22},"end":{"line":3,"column":23},"identifierName":"c"}, "name": "c" }, - "computed": false, "optional": true } } 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 344f3d26b695..39af690c411a 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 @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "Tagged Template Literals are not allowed in optionalChain (1:0)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "OptionalChainingNoTemplate" + } ], "program": { "type": "Program", @@ -24,12 +30,12 @@ "start":0,"end":1,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":1},"identifierName":"a"}, "name": "a" }, + "computed": false, "property": { "type": "Identifier", "start":3,"end":4,"loc":{"start":{"line":1,"column":3},"end":{"line":1,"column":4},"identifierName":"b"}, "name": "b" }, - "computed": false, "optional": true }, "quasi": { diff --git a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-0/output.json b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-0/output.json index f71e62cf63d4..499feb8ce073 100644 --- a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-0/output.json +++ b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-0/output.json @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "A numeric separator is only allowed between two digits (1:1)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "UnexpectedNumericSeparator" + } ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-1/output.json b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-1/output.json index a685b94be015..d10d9688bce6 100644 --- a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-1/output.json +++ b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-1/output.json @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "A numeric separator is only allowed between two digits (1:3)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "UnexpectedNumericSeparator" + } ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-10/output.json b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-10/output.json index c32319f375dd..709c1bcfb340 100644 --- a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-10/output.json +++ b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-10/output.json @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "A numeric separator is only allowed between two digits (1:5)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "UnexpectedNumericSeparator" + } ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-100/output.json b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-100/output.json index 7ee60b71ca15..48f40592e3e3 100644 --- a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-100/output.json +++ b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-100/output.json @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "A numeric separator is only allowed between two digits (1:2)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "UnexpectedNumericSeparator" + } ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-101/output.json b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-101/output.json index 242847410a0f..e8327b818025 100644 --- a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-101/output.json +++ b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-101/output.json @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "A numeric separator is only allowed between two digits (1:4)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "UnexpectedNumericSeparator" + } ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-102/output.json b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-102/output.json index aedcced6b5b5..31db804a5b27 100644 --- a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-102/output.json +++ b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-102/output.json @@ -2,8 +2,20 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "A numeric separator is only allowed between two digits (1:4)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "UnexpectedNumericSeparator" + }, + { + "$$ babel internal serialized type": "Error", + "message": "A numeric separator is only allowed between two digits (1:5)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "UnexpectedNumericSeparator" + } ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-103/output.json b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-103/output.json index 6fc9be0b380a..0fb82b976793 100644 --- a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-103/output.json +++ b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-103/output.json @@ -2,8 +2,20 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "A numeric separator is only allowed between two digits (1:2)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "UnexpectedNumericSeparator" + }, + { + "$$ babel internal serialized type": "Error", + "message": "A numeric separator is only allowed between two digits (1:3)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "UnexpectedNumericSeparator" + } ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-104/output.json b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-104/output.json index fa1525dea3eb..8071c05a9f35 100644 --- a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-104/output.json +++ b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-104/output.json @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "A numeric separator is only allowed between two digits (1:4)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "UnexpectedNumericSeparator" + } ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-105/output.json b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-105/output.json index 8c94785d66b3..6b01169ff71b 100644 --- a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-105/output.json +++ b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-105/output.json @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "A numeric separator is only allowed between two digits (1:5)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "UnexpectedNumericSeparator" + } ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-106/output.json b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-106/output.json index 83b95a090610..7c6f9a2a7615 100644 --- a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-106/output.json +++ b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-106/output.json @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "A numeric separator is only allowed between two digits (1:6)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "UnexpectedNumericSeparator" + } ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-107/output.json b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-107/output.json index fcf5f8cc4e08..fe0ea36c2609 100644 --- a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-107/output.json +++ b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-107/output.json @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "A numeric separator is only allowed between two digits (1:6)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "UnexpectedNumericSeparator" + } ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-108/output.json b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-108/output.json index fac7984d5639..88b7c658c0e0 100644 --- a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-108/output.json +++ b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-108/output.json @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "A numeric separator is only allowed between two digits (1:7)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "UnexpectedNumericSeparator" + } ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-109/output.json b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-109/output.json index 245a9416a843..fbae1f85f854 100644 --- a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-109/output.json +++ b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-109/output.json @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "A numeric separator is only allowed between two digits (1:7)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "UnexpectedNumericSeparator" + } ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-11/output.json b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-11/output.json index 3ce69cd5a8b1..7fe350183427 100644 --- a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-11/output.json +++ b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-11/output.json @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "A numeric separator is only allowed between two digits (1:5)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "UnexpectedNumericSeparator" + } ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-110/output.json b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-110/output.json index 1694c85af975..a95a0f60a92d 100644 --- a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-110/output.json +++ b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-110/output.json @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "A numeric separator is only allowed between two digits (1:6)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "UnexpectedNumericSeparator" + } ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-111/output.json b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-111/output.json index e033ff3657a7..ca0895cf1b2a 100644 --- a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-111/output.json +++ b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-111/output.json @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "A numeric separator is only allowed between two digits (1:6)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "UnexpectedNumericSeparator" + } ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-112/output.json b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-112/output.json index 5aebc0f50b72..4a2cb2f2c95e 100644 --- a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-112/output.json +++ b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-112/output.json @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "A numeric separator is only allowed between two digits (1:3)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "UnexpectedNumericSeparator" + } ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-113/output.json b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-113/output.json index e8db639c568a..daa60a51464c 100644 --- a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-113/output.json +++ b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-113/output.json @@ -2,9 +2,27 @@ "type": "File", "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)", - "SyntaxError: A numeric separator is only allowed between two digits (1:8)" + { + "$$ babel internal serialized type": "Error", + "message": "A numeric separator is only allowed between two digits (1:3)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "UnexpectedNumericSeparator" + }, + { + "$$ babel internal serialized type": "Error", + "message": "A numeric separator is only allowed between two digits (1:4)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "UnexpectedNumericSeparator" + }, + { + "$$ babel internal serialized type": "Error", + "message": "A numeric separator is only allowed between two digits (1:8)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "UnexpectedNumericSeparator" + } ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-114/output.json b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-114/output.json index 9d692b713f67..4813df9bb7d7 100644 --- a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-114/output.json +++ b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-114/output.json @@ -2,9 +2,27 @@ "type": "File", "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)", - "SyntaxError: A numeric separator is only allowed between two digits (1:6)" + { + "$$ babel internal serialized type": "Error", + "message": "A numeric separator is only allowed between two digits (1:3)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "UnexpectedNumericSeparator" + }, + { + "$$ babel internal serialized type": "Error", + "message": "A numeric separator is only allowed between two digits (1:5)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "UnexpectedNumericSeparator" + }, + { + "$$ babel internal serialized type": "Error", + "message": "A numeric separator is only allowed between two digits (1:6)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "UnexpectedNumericSeparator" + } ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-115/output.json b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-115/output.json index 0b12f49112ee..9bf0d56ae8b1 100644 --- a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-115/output.json +++ b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-115/output.json @@ -2,8 +2,20 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "A numeric separator is only allowed between two digits (1:3)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "UnexpectedNumericSeparator" + }, + { + "$$ babel internal serialized type": "Error", + "message": "A numeric separator is only allowed between two digits (1:7)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "UnexpectedNumericSeparator" + } ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-116/output.json b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-116/output.json index 2629abd0deed..dda959f9bf34 100644 --- a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-116/output.json +++ b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-116/output.json @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "A numeric separator is only allowed between two digits (1:3)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "UnexpectedNumericSeparator" + } ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-117/output.json b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-117/output.json index f6817e0b226a..d27e89da40b8 100644 --- a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-117/output.json +++ b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-117/output.json @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "A numeric separator is only allowed between two digits (1:3)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "UnexpectedNumericSeparator" + } ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-118/output.json b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-118/output.json index 1a2378d0b09f..7b8372b0ad90 100644 --- a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-118/output.json +++ b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-118/output.json @@ -2,8 +2,20 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "A numeric separator is only allowed between two digits (1:3)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "UnexpectedNumericSeparator" + }, + { + "$$ babel internal serialized type": "Error", + "message": "A numeric separator is only allowed between two digits (1:8)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "UnexpectedNumericSeparator" + } ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-119/output.json b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-119/output.json index fce3fc757812..061c84feec3a 100644 --- a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-119/output.json +++ b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-119/output.json @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "A numeric separator is only allowed between two digits (1:3)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "UnexpectedNumericSeparator" + } ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-12/output.json b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-12/output.json index 6900ec7205d8..a515aa35d096 100644 --- a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-12/output.json +++ b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-12/output.json @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "A numeric separator is only allowed between two digits (1:2)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "UnexpectedNumericSeparator" + } ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-120/output.json b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-120/output.json index 987d9624eb59..208ed3d0a6a4 100644 --- a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-120/output.json +++ b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-120/output.json @@ -2,8 +2,20 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "A numeric separator is only allowed between two digits (1:3)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "UnexpectedNumericSeparator" + }, + { + "$$ babel internal serialized type": "Error", + "message": "A numeric separator is only allowed between two digits (1:8)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "UnexpectedNumericSeparator" + } ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-121/output.json b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-121/output.json index 6fd12b2edcec..a70e1fe91945 100644 --- a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-121/output.json +++ b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-121/output.json @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "A numeric separator is only allowed between two digits (1:7)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "UnexpectedNumericSeparator" + } ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-122/output.json b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-122/output.json index 004e40f97bb0..b929c243911f 100644 --- a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-122/output.json +++ b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-122/output.json @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "A numeric separator is only allowed between two digits (1:6)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "UnexpectedNumericSeparator" + } ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-123/output.json b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-123/output.json index 2fcbd10c8038..206d02742382 100644 --- a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-123/output.json +++ b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-123/output.json @@ -2,8 +2,20 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "A numeric separator is only allowed between two digits (1:3)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "UnexpectedNumericSeparator" + }, + { + "$$ babel internal serialized type": "Error", + "message": "A numeric separator is only allowed between two digits (1:7)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "UnexpectedNumericSeparator" + } ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-124/output.json b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-124/output.json index cd4cd6ffeb61..168a21e16f64 100644 --- a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-124/output.json +++ b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-124/output.json @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "A numeric separator is only allowed between two digits (1:2)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "UnexpectedNumericSeparator" + } ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-125/output.json b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-125/output.json index a6ea0dbbc145..32387261ca45 100644 --- a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-125/output.json +++ b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-125/output.json @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "A numeric separator is only allowed between two digits (1:4)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "UnexpectedNumericSeparator" + } ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-126/output.json b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-126/output.json index 4e0a0023c3b5..b20c897c6d42 100644 --- a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-126/output.json +++ b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-126/output.json @@ -2,8 +2,20 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "A numeric separator is only allowed between two digits (1:4)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "UnexpectedNumericSeparator" + }, + { + "$$ babel internal serialized type": "Error", + "message": "A numeric separator is only allowed between two digits (1:5)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "UnexpectedNumericSeparator" + } ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-127/output.json b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-127/output.json index 01995ddd7541..914df7976521 100644 --- a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-127/output.json +++ b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-127/output.json @@ -2,8 +2,20 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "A numeric separator is only allowed between two digits (1:2)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "UnexpectedNumericSeparator" + }, + { + "$$ babel internal serialized type": "Error", + "message": "A numeric separator is only allowed between two digits (1:3)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "UnexpectedNumericSeparator" + } ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-128/output.json b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-128/output.json index 58bb3e5decf4..5d5b2c52f21c 100644 --- a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-128/output.json +++ b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-128/output.json @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "A numeric separator is only allowed between two digits (1:4)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "UnexpectedNumericSeparator" + } ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-129/output.json b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-129/output.json index 54d3a1050e08..79948e30b80a 100644 --- a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-129/output.json +++ b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-129/output.json @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "A numeric separator is only allowed between two digits (1:5)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "UnexpectedNumericSeparator" + } ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-13/output.json b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-13/output.json index ded88989d1ad..187d3c282586 100644 --- a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-13/output.json +++ b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-13/output.json @@ -2,9 +2,27 @@ "type": "File", "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)", - "SyntaxError: A numeric separator is only allowed between two digits (1:7)" + { + "$$ babel internal serialized type": "Error", + "message": "A numeric separator is only allowed between two digits (1:2)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "UnexpectedNumericSeparator" + }, + { + "$$ babel internal serialized type": "Error", + "message": "A numeric separator is only allowed between two digits (1:3)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "UnexpectedNumericSeparator" + }, + { + "$$ babel internal serialized type": "Error", + "message": "A numeric separator is only allowed between two digits (1:7)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "UnexpectedNumericSeparator" + } ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-130/output.json b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-130/output.json index 6eb72f741765..ae6dbe2f9209 100644 --- a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-130/output.json +++ b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-130/output.json @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "A numeric separator is only allowed between two digits (1:6)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "UnexpectedNumericSeparator" + } ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-131/output.json b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-131/output.json index f97788382071..0568504f282b 100644 --- a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-131/output.json +++ b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-131/output.json @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "A numeric separator is only allowed between two digits (1:6)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "UnexpectedNumericSeparator" + } ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-132/output.json b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-132/output.json index bf350c9fd06a..d292afec97bb 100644 --- a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-132/output.json +++ b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-132/output.json @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "A numeric separator is only allowed between two digits (1:7)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "UnexpectedNumericSeparator" + } ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-133/output.json b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-133/output.json index e06df9501114..be8882943b01 100644 --- a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-133/output.json +++ b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-133/output.json @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "A numeric separator is only allowed between two digits (1:7)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "UnexpectedNumericSeparator" + } ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-134/output.json b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-134/output.json index bb0df5540a94..f832e2d92f70 100644 --- a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-134/output.json +++ b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-134/output.json @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "A numeric separator is only allowed between two digits (1:6)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "UnexpectedNumericSeparator" + } ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-135/output.json b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-135/output.json index 4484f2592a62..a89a54c381cb 100644 --- a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-135/output.json +++ b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-135/output.json @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "A numeric separator is only allowed between two digits (1:6)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "UnexpectedNumericSeparator" + } ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-136/output.json b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-136/output.json index 5b86c977671a..8f5058dc0b6a 100644 --- a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-136/output.json +++ b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-136/output.json @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "A numeric separator is only allowed between two digits (1:3)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "UnexpectedNumericSeparator" + } ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-137/output.json b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-137/output.json index 0a7efd31a5f0..6f55d88576a0 100644 --- a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-137/output.json +++ b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-137/output.json @@ -2,9 +2,27 @@ "type": "File", "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)", - "SyntaxError: A numeric separator is only allowed between two digits (1:8)" + { + "$$ babel internal serialized type": "Error", + "message": "A numeric separator is only allowed between two digits (1:3)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "UnexpectedNumericSeparator" + }, + { + "$$ babel internal serialized type": "Error", + "message": "A numeric separator is only allowed between two digits (1:4)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "UnexpectedNumericSeparator" + }, + { + "$$ babel internal serialized type": "Error", + "message": "A numeric separator is only allowed between two digits (1:8)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "UnexpectedNumericSeparator" + } ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-138/output.json b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-138/output.json index 7e5e1b87de3d..d7379594174c 100644 --- a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-138/output.json +++ b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-138/output.json @@ -2,9 +2,27 @@ "type": "File", "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)", - "SyntaxError: A numeric separator is only allowed between two digits (1:6)" + { + "$$ babel internal serialized type": "Error", + "message": "A numeric separator is only allowed between two digits (1:3)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "UnexpectedNumericSeparator" + }, + { + "$$ babel internal serialized type": "Error", + "message": "A numeric separator is only allowed between two digits (1:5)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "UnexpectedNumericSeparator" + }, + { + "$$ babel internal serialized type": "Error", + "message": "A numeric separator is only allowed between two digits (1:6)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "UnexpectedNumericSeparator" + } ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-139/output.json b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-139/output.json index a904876ecc6b..f375fe0c4b47 100644 --- a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-139/output.json +++ b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-139/output.json @@ -2,8 +2,20 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "A numeric separator is only allowed between two digits (1:3)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "UnexpectedNumericSeparator" + }, + { + "$$ babel internal serialized type": "Error", + "message": "A numeric separator is only allowed between two digits (1:7)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "UnexpectedNumericSeparator" + } ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-14/output.json b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-14/output.json index 9b87ecd61c19..0f08405687bc 100644 --- a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-14/output.json +++ b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-14/output.json @@ -2,9 +2,27 @@ "type": "File", "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)", - "SyntaxError: A numeric separator is only allowed between two digits (1:5)" + { + "$$ babel internal serialized type": "Error", + "message": "A numeric separator is only allowed between two digits (1:2)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "UnexpectedNumericSeparator" + }, + { + "$$ babel internal serialized type": "Error", + "message": "A numeric separator is only allowed between two digits (1:4)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "UnexpectedNumericSeparator" + }, + { + "$$ babel internal serialized type": "Error", + "message": "A numeric separator is only allowed between two digits (1:5)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "UnexpectedNumericSeparator" + } ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-140/output.json b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-140/output.json index 09eda4f99df0..27adc128d9af 100644 --- a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-140/output.json +++ b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-140/output.json @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "A numeric separator is only allowed between two digits (1:3)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "UnexpectedNumericSeparator" + } ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-141/output.json b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-141/output.json index 1fa9b9b565c7..c2e4fc8318c5 100644 --- a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-141/output.json +++ b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-141/output.json @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "A numeric separator is only allowed between two digits (1:3)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "UnexpectedNumericSeparator" + } ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-142/output.json b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-142/output.json index ab2be9d065cc..309eb034ffe0 100644 --- a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-142/output.json +++ b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-142/output.json @@ -2,8 +2,20 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "A numeric separator is only allowed between two digits (1:3)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "UnexpectedNumericSeparator" + }, + { + "$$ babel internal serialized type": "Error", + "message": "A numeric separator is only allowed between two digits (1:8)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "UnexpectedNumericSeparator" + } ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-143/output.json b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-143/output.json index 2f01f1cdfce4..5398688888b4 100644 --- a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-143/output.json +++ b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-143/output.json @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "A numeric separator is only allowed between two digits (1:3)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "UnexpectedNumericSeparator" + } ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-144/output.json b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-144/output.json index 19996c619dbd..b8673f5f2713 100644 --- a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-144/output.json +++ b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-144/output.json @@ -2,8 +2,20 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "A numeric separator is only allowed between two digits (1:3)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "UnexpectedNumericSeparator" + }, + { + "$$ babel internal serialized type": "Error", + "message": "A numeric separator is only allowed between two digits (1:8)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "UnexpectedNumericSeparator" + } ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-145/output.json b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-145/output.json index 73d0352df20d..809cad9c7d73 100644 --- a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-145/output.json +++ b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-145/output.json @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "A numeric separator is only allowed between two digits (1:7)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "UnexpectedNumericSeparator" + } ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-146/output.json b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-146/output.json index 26e13a153248..7f7aab7c5d0a 100644 --- a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-146/output.json +++ b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-146/output.json @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "A numeric separator is only allowed between two digits (1:6)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "UnexpectedNumericSeparator" + } ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-147/output.json b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-147/output.json index 21d200a0d6d5..eabc234c4db2 100644 --- a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-147/output.json +++ b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-147/output.json @@ -2,8 +2,20 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "A numeric separator is only allowed between two digits (1:3)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "UnexpectedNumericSeparator" + }, + { + "$$ babel internal serialized type": "Error", + "message": "A numeric separator is only allowed between two digits (1:7)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "UnexpectedNumericSeparator" + } ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-15/output.json b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-15/output.json index c0679de758a8..69431f318cd0 100644 --- a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-15/output.json +++ b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-15/output.json @@ -2,8 +2,20 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "A numeric separator is only allowed between two digits (1:2)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "UnexpectedNumericSeparator" + }, + { + "$$ babel internal serialized type": "Error", + "message": "A numeric separator is only allowed between two digits (1:6)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "UnexpectedNumericSeparator" + } ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-16/output.json b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-16/output.json index 67f7f4463321..2ae8b45d8fec 100644 --- a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-16/output.json +++ b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-16/output.json @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "A numeric separator is only allowed between two digits (1:2)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "UnexpectedNumericSeparator" + } ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-17/output.json b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-17/output.json index e641715002d1..c9b41e9c7f8e 100644 --- a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-17/output.json +++ b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-17/output.json @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "A numeric separator is only allowed between two digits (1:2)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "UnexpectedNumericSeparator" + } ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-18/output.json b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-18/output.json index c9862c7c7459..30c3ddc6f960 100644 --- a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-18/output.json +++ b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-18/output.json @@ -2,8 +2,20 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "A numeric separator is only allowed between two digits (1:2)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "UnexpectedNumericSeparator" + }, + { + "$$ babel internal serialized type": "Error", + "message": "A numeric separator is only allowed between two digits (1:7)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "UnexpectedNumericSeparator" + } ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-19/output.json b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-19/output.json index 59ef8dcfe7df..1321dc08471d 100644 --- a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-19/output.json +++ b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-19/output.json @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "A numeric separator is only allowed between two digits (1:2)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "UnexpectedNumericSeparator" + } ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-2/output.json b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-2/output.json index 259a3f3a14a0..03fc91f8848b 100644 --- a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-2/output.json +++ b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-2/output.json @@ -2,8 +2,20 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "A numeric separator is only allowed between two digits (1:3)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "UnexpectedNumericSeparator" + }, + { + "$$ babel internal serialized type": "Error", + "message": "A numeric separator is only allowed between two digits (1:4)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "UnexpectedNumericSeparator" + } ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-20/output.json b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-20/output.json index f83fa6ea3e6d..3f1e70c2a353 100644 --- a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-20/output.json +++ b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-20/output.json @@ -2,8 +2,20 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "A numeric separator is only allowed between two digits (1:2)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "UnexpectedNumericSeparator" + }, + { + "$$ babel internal serialized type": "Error", + "message": "A numeric separator is only allowed between two digits (1:7)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "UnexpectedNumericSeparator" + } ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-21/output.json b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-21/output.json index 7390d0e73cb8..6f50d775425a 100644 --- a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-21/output.json +++ b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-21/output.json @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "A numeric separator is only allowed between two digits (1:6)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "UnexpectedNumericSeparator" + } ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-22/output.json b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-22/output.json index f3aadce6c706..f191154987df 100644 --- a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-22/output.json +++ b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-22/output.json @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "A numeric separator is only allowed between two digits (1:5)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "UnexpectedNumericSeparator" + } ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-23/output.json b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-23/output.json index 482160a3f26d..1f273f15db04 100644 --- a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-23/output.json +++ b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-23/output.json @@ -2,8 +2,20 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "A numeric separator is only allowed between two digits (1:2)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "UnexpectedNumericSeparator" + }, + { + "$$ babel internal serialized type": "Error", + "message": "A numeric separator is only allowed between two digits (1:6)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "UnexpectedNumericSeparator" + } ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-25/output.json b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-25/output.json index ea8fc8c204fb..d27373459568 100644 --- a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-25/output.json +++ b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-25/output.json @@ -2,8 +2,20 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "A numeric separator is only allowed between two digits (1:4)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "UnexpectedNumericSeparator" + }, + { + "$$ babel internal serialized type": "Error", + "message": "Expected number in radix 8 (1:5)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "InvalidDigit" + } ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-26/output.json b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-26/output.json index 9a263fd785be..a69a1831244d 100644 --- a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-26/output.json +++ b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-26/output.json @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":5,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":5}}, "errors": [ - "SyntaxError: Expected number in radix 2 (1:2)" + { + "$$ babel internal serialized type": "Error", + "message": "Expected number in radix 2 (1:2)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "InvalidDigit" + } ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-28/output.json b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-28/output.json index 4fa0a1810fd5..dcab7c60303c 100644 --- a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-28/output.json +++ b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-28/output.json @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "A numeric separator is only allowed between two digits (1:1)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "UnexpectedNumericSeparator" + } ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-29/output.json b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-29/output.json index 0d67691d81ba..0e640fd3d122 100644 --- a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-29/output.json +++ b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-29/output.json @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "A numeric separator is only allowed between two digits (1:3)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "UnexpectedNumericSeparator" + } ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-3/output.json b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-3/output.json index 872895190ff4..f71aed46e4eb 100644 --- a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-3/output.json +++ b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-3/output.json @@ -2,8 +2,20 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "A numeric separator is only allowed between two digits (1:1)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "UnexpectedNumericSeparator" + }, + { + "$$ babel internal serialized type": "Error", + "message": "A numeric separator is only allowed between two digits (1:2)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "UnexpectedNumericSeparator" + } ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-30/output.json b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-30/output.json index 1743eab00fbd..41e2f462b357 100644 --- a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-30/output.json +++ b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-30/output.json @@ -2,8 +2,20 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "A numeric separator is only allowed between two digits (1:3)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "UnexpectedNumericSeparator" + }, + { + "$$ babel internal serialized type": "Error", + "message": "A numeric separator is only allowed between two digits (1:4)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "UnexpectedNumericSeparator" + } ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-31/output.json b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-31/output.json index 836a76bd99c4..acaa23bf7fac 100644 --- a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-31/output.json +++ b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-31/output.json @@ -2,8 +2,20 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "A numeric separator is only allowed between two digits (1:1)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "UnexpectedNumericSeparator" + }, + { + "$$ babel internal serialized type": "Error", + "message": "A numeric separator is only allowed between two digits (1:2)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "UnexpectedNumericSeparator" + } ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-32/output.json b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-32/output.json index e9cfbc456cb3..d8e876f06f66 100644 --- a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-32/output.json +++ b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-32/output.json @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "A numeric separator is only allowed between two digits (1:3)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "UnexpectedNumericSeparator" + } ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-33/output.json b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-33/output.json index 0e74e29feaae..dc6a83b34fcc 100644 --- a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-33/output.json +++ b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-33/output.json @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "A numeric separator is only allowed between two digits (1:4)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "UnexpectedNumericSeparator" + } ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-34/output.json b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-34/output.json index 269b48e7fb28..0d092682d2b0 100644 --- a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-34/output.json +++ b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-34/output.json @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "A numeric separator is only allowed between two digits (1:5)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "UnexpectedNumericSeparator" + } ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-35/output.json b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-35/output.json index d9086f100064..60c0366aff7d 100644 --- a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-35/output.json +++ b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-35/output.json @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "A numeric separator is only allowed between two digits (1:5)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "UnexpectedNumericSeparator" + } ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-36/output.json b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-36/output.json index 12858208a0d3..46b8abc883a6 100644 --- a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-36/output.json +++ b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-36/output.json @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "A numeric separator is only allowed between two digits (1:6)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "UnexpectedNumericSeparator" + } ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-37/output.json b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-37/output.json index 2128458509f4..435f90a4b9d0 100644 --- a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-37/output.json +++ b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-37/output.json @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "A numeric separator is only allowed between two digits (1:6)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "UnexpectedNumericSeparator" + } ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-38/output.json b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-38/output.json index 195c69a6e0d1..2182762ad58c 100644 --- a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-38/output.json +++ b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-38/output.json @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "A numeric separator is only allowed between two digits (1:5)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "UnexpectedNumericSeparator" + } ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-39/output.json b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-39/output.json index 98b20b22a343..e2b86edae9d3 100644 --- a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-39/output.json +++ b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-39/output.json @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "A numeric separator is only allowed between two digits (1:5)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "UnexpectedNumericSeparator" + } ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-4/output.json b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-4/output.json index 96e6972816cb..2e6cba02529e 100644 --- a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-4/output.json +++ b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-4/output.json @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "A numeric separator is only allowed between two digits (1:3)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "UnexpectedNumericSeparator" + } ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-40/output.json b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-40/output.json index bae33528af8b..701f33e92880 100644 --- a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-40/output.json +++ b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-40/output.json @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "A numeric separator is only allowed between two digits (1:2)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "UnexpectedNumericSeparator" + } ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-41/output.json b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-41/output.json index e08b97681236..3ffbacdfa67a 100644 --- a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-41/output.json +++ b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-41/output.json @@ -2,9 +2,27 @@ "type": "File", "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)", - "SyntaxError: A numeric separator is only allowed between two digits (1:7)" + { + "$$ babel internal serialized type": "Error", + "message": "A numeric separator is only allowed between two digits (1:2)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "UnexpectedNumericSeparator" + }, + { + "$$ babel internal serialized type": "Error", + "message": "A numeric separator is only allowed between two digits (1:3)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "UnexpectedNumericSeparator" + }, + { + "$$ babel internal serialized type": "Error", + "message": "A numeric separator is only allowed between two digits (1:7)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "UnexpectedNumericSeparator" + } ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-42/output.json b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-42/output.json index 17b25f9fb301..fb950ee87115 100644 --- a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-42/output.json +++ b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-42/output.json @@ -2,9 +2,27 @@ "type": "File", "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)", - "SyntaxError: A numeric separator is only allowed between two digits (1:5)" + { + "$$ babel internal serialized type": "Error", + "message": "A numeric separator is only allowed between two digits (1:2)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "UnexpectedNumericSeparator" + }, + { + "$$ babel internal serialized type": "Error", + "message": "A numeric separator is only allowed between two digits (1:4)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "UnexpectedNumericSeparator" + }, + { + "$$ babel internal serialized type": "Error", + "message": "A numeric separator is only allowed between two digits (1:5)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "UnexpectedNumericSeparator" + } ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-43/output.json b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-43/output.json index 37fb1b9d9006..746dcb6a27cc 100644 --- a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-43/output.json +++ b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-43/output.json @@ -2,8 +2,20 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "A numeric separator is only allowed between two digits (1:2)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "UnexpectedNumericSeparator" + }, + { + "$$ babel internal serialized type": "Error", + "message": "A numeric separator is only allowed between two digits (1:6)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "UnexpectedNumericSeparator" + } ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-44/output.json b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-44/output.json index 0c576d51f4f7..c092ab045260 100644 --- a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-44/output.json +++ b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-44/output.json @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "A numeric separator is only allowed between two digits (1:2)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "UnexpectedNumericSeparator" + } ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-45/output.json b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-45/output.json index f26f8dd544e9..9d5e170e4daa 100644 --- a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-45/output.json +++ b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-45/output.json @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "A numeric separator is only allowed between two digits (1:2)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "UnexpectedNumericSeparator" + } ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-46/output.json b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-46/output.json index c721e170501c..c9ab1025a3ad 100644 --- a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-46/output.json +++ b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-46/output.json @@ -2,8 +2,20 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "A numeric separator is only allowed between two digits (1:2)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "UnexpectedNumericSeparator" + }, + { + "$$ babel internal serialized type": "Error", + "message": "A numeric separator is only allowed between two digits (1:7)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "UnexpectedNumericSeparator" + } ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-47/output.json b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-47/output.json index 32b05f9776a4..537e84791cd7 100644 --- a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-47/output.json +++ b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-47/output.json @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "A numeric separator is only allowed between two digits (1:2)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "UnexpectedNumericSeparator" + } ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-48/output.json b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-48/output.json index 370cad5f22d0..f9ea2f69b223 100644 --- a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-48/output.json +++ b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-48/output.json @@ -2,8 +2,20 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "A numeric separator is only allowed between two digits (1:2)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "UnexpectedNumericSeparator" + }, + { + "$$ babel internal serialized type": "Error", + "message": "A numeric separator is only allowed between two digits (1:7)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "UnexpectedNumericSeparator" + } ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-49/output.json b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-49/output.json index 7302b58872fe..e00def41d32b 100644 --- a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-49/output.json +++ b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-49/output.json @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "A numeric separator is only allowed between two digits (1:6)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "UnexpectedNumericSeparator" + } ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-5/output.json b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-5/output.json index 104bab8bfb71..cfa3dfa99d1e 100644 --- a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-5/output.json +++ b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-5/output.json @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "A numeric separator is only allowed between two digits (1:4)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "UnexpectedNumericSeparator" + } ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-50/output.json b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-50/output.json index 1696b7203671..c9ff6e2141ee 100644 --- a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-50/output.json +++ b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-50/output.json @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "A numeric separator is only allowed between two digits (1:5)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "UnexpectedNumericSeparator" + } ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-51/output.json b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-51/output.json index 4a170306f9d8..c8dff4f4780f 100644 --- a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-51/output.json +++ b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-51/output.json @@ -2,8 +2,20 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "A numeric separator is only allowed between two digits (1:2)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "UnexpectedNumericSeparator" + }, + { + "$$ babel internal serialized type": "Error", + "message": "A numeric separator is only allowed between two digits (1:6)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "UnexpectedNumericSeparator" + } ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-52/output.json b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-52/output.json index ef36209f39e2..5dffdb11ebef 100644 --- a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-52/output.json +++ b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-52/output.json @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "A numeric separator is only allowed between two digits (1:1)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "UnexpectedNumericSeparator" + } ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-53/output.json b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-53/output.json index b59406105388..ce8d6ebee8a0 100644 --- a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-53/output.json +++ b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-53/output.json @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "A numeric separator is only allowed between two digits (1:3)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "UnexpectedNumericSeparator" + } ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-54/output.json b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-54/output.json index a240786ccdd3..b58f0566b57c 100644 --- a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-54/output.json +++ b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-54/output.json @@ -2,8 +2,20 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "A numeric separator is only allowed between two digits (1:3)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "UnexpectedNumericSeparator" + }, + { + "$$ babel internal serialized type": "Error", + "message": "A numeric separator is only allowed between two digits (1:4)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "UnexpectedNumericSeparator" + } ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-55/output.json b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-55/output.json index 327ca0646199..5521e9d6bf69 100644 --- a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-55/output.json +++ b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-55/output.json @@ -2,8 +2,20 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "A numeric separator is only allowed between two digits (1:1)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "UnexpectedNumericSeparator" + }, + { + "$$ babel internal serialized type": "Error", + "message": "A numeric separator is only allowed between two digits (1:2)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "UnexpectedNumericSeparator" + } ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-56/output.json b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-56/output.json index a1f3a2f79773..13e40b289b3c 100644 --- a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-56/output.json +++ b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-56/output.json @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "A numeric separator is only allowed between two digits (1:3)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "UnexpectedNumericSeparator" + } ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-57/output.json b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-57/output.json index 5be8427a63dc..33c21aac3bf3 100644 --- a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-57/output.json +++ b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-57/output.json @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "A numeric separator is only allowed between two digits (1:4)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "UnexpectedNumericSeparator" + } ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-58/output.json b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-58/output.json index be530847849d..b35fc0602847 100644 --- a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-58/output.json +++ b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-58/output.json @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "A numeric separator is only allowed between two digits (1:5)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "UnexpectedNumericSeparator" + } ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-59/output.json b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-59/output.json index 8946a1d3dfa7..1f95665c5239 100644 --- a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-59/output.json +++ b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-59/output.json @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "A numeric separator is only allowed between two digits (1:5)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "UnexpectedNumericSeparator" + } ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-6/output.json b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-6/output.json index 47194a33cc24..5d1972de75c5 100644 --- a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-6/output.json +++ b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-6/output.json @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "A numeric separator is only allowed between two digits (1:5)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "UnexpectedNumericSeparator" + } ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-60/output.json b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-60/output.json index 2fcf0f2e7170..332642db511b 100644 --- a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-60/output.json +++ b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-60/output.json @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "A numeric separator is only allowed between two digits (1:6)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "UnexpectedNumericSeparator" + } ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-61/output.json b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-61/output.json index 7b94176ac8a8..04880b4931e0 100644 --- a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-61/output.json +++ b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-61/output.json @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "A numeric separator is only allowed between two digits (1:6)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "UnexpectedNumericSeparator" + } ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-62/output.json b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-62/output.json index 9ccb458bc25c..659eca38dc37 100644 --- a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-62/output.json +++ b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-62/output.json @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "A numeric separator is only allowed between two digits (1:5)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "UnexpectedNumericSeparator" + } ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-63/output.json b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-63/output.json index 270a3c6f1257..c04bbd205c11 100644 --- a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-63/output.json +++ b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-63/output.json @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "A numeric separator is only allowed between two digits (1:5)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "UnexpectedNumericSeparator" + } ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-64/output.json b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-64/output.json index f11b9f23a562..d6169ad7bbe8 100644 --- a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-64/output.json +++ b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-64/output.json @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "A numeric separator is only allowed between two digits (1:2)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "UnexpectedNumericSeparator" + } ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-65/output.json b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-65/output.json index b115442a128e..ee8367e0239b 100644 --- a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-65/output.json +++ b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-65/output.json @@ -2,9 +2,27 @@ "type": "File", "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)", - "SyntaxError: A numeric separator is only allowed between two digits (1:7)" + { + "$$ babel internal serialized type": "Error", + "message": "A numeric separator is only allowed between two digits (1:2)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "UnexpectedNumericSeparator" + }, + { + "$$ babel internal serialized type": "Error", + "message": "A numeric separator is only allowed between two digits (1:3)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "UnexpectedNumericSeparator" + }, + { + "$$ babel internal serialized type": "Error", + "message": "A numeric separator is only allowed between two digits (1:7)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "UnexpectedNumericSeparator" + } ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-66/output.json b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-66/output.json index 8460ef9ed922..d90d8c1cbfb6 100644 --- a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-66/output.json +++ b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-66/output.json @@ -2,9 +2,27 @@ "type": "File", "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)", - "SyntaxError: A numeric separator is only allowed between two digits (1:5)" + { + "$$ babel internal serialized type": "Error", + "message": "A numeric separator is only allowed between two digits (1:2)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "UnexpectedNumericSeparator" + }, + { + "$$ babel internal serialized type": "Error", + "message": "A numeric separator is only allowed between two digits (1:4)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "UnexpectedNumericSeparator" + }, + { + "$$ babel internal serialized type": "Error", + "message": "A numeric separator is only allowed between two digits (1:5)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "UnexpectedNumericSeparator" + } ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-67/output.json b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-67/output.json index af0c11230973..56b5b806a97f 100644 --- a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-67/output.json +++ b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-67/output.json @@ -2,8 +2,20 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "A numeric separator is only allowed between two digits (1:2)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "UnexpectedNumericSeparator" + }, + { + "$$ babel internal serialized type": "Error", + "message": "A numeric separator is only allowed between two digits (1:6)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "UnexpectedNumericSeparator" + } ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-68/output.json b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-68/output.json index b4baab71f704..720dfc5dda1e 100644 --- a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-68/output.json +++ b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-68/output.json @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "A numeric separator is only allowed between two digits (1:2)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "UnexpectedNumericSeparator" + } ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-69/output.json b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-69/output.json index 67b40a81583e..6091429aab82 100644 --- a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-69/output.json +++ b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-69/output.json @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "A numeric separator is only allowed between two digits (1:2)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "UnexpectedNumericSeparator" + } ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-7/output.json b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-7/output.json index d332a8378d0b..6e31ba689675 100644 --- a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-7/output.json +++ b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-7/output.json @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "A numeric separator is only allowed between two digits (1:5)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "UnexpectedNumericSeparator" + } ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-70/output.json b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-70/output.json index 7e2e98b195ab..905a11d8b179 100644 --- a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-70/output.json +++ b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-70/output.json @@ -2,8 +2,20 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "A numeric separator is only allowed between two digits (1:2)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "UnexpectedNumericSeparator" + }, + { + "$$ babel internal serialized type": "Error", + "message": "A numeric separator is only allowed between two digits (1:7)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "UnexpectedNumericSeparator" + } ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-71/output.json b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-71/output.json index 1e722211301b..35ff5ff1794e 100644 --- a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-71/output.json +++ b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-71/output.json @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "A numeric separator is only allowed between two digits (1:2)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "UnexpectedNumericSeparator" + } ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-72/output.json b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-72/output.json index b6fc5e3e25ec..35cce81a45a9 100644 --- a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-72/output.json +++ b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-72/output.json @@ -2,8 +2,20 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "A numeric separator is only allowed between two digits (1:2)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "UnexpectedNumericSeparator" + }, + { + "$$ babel internal serialized type": "Error", + "message": "A numeric separator is only allowed between two digits (1:7)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "UnexpectedNumericSeparator" + } ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-73/output.json b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-73/output.json index 87cbb9e74aaf..7ec18a926a1d 100644 --- a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-73/output.json +++ b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-73/output.json @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "A numeric separator is only allowed between two digits (1:6)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "UnexpectedNumericSeparator" + } ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-74/output.json b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-74/output.json index e13589825cfd..643c296bc5db 100644 --- a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-74/output.json +++ b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-74/output.json @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "A numeric separator is only allowed between two digits (1:5)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "UnexpectedNumericSeparator" + } ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-75/output.json b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-75/output.json index 99aaeee03660..5b802b3d8d78 100644 --- a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-75/output.json +++ b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-75/output.json @@ -2,8 +2,20 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "A numeric separator is only allowed between two digits (1:2)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "UnexpectedNumericSeparator" + }, + { + "$$ babel internal serialized type": "Error", + "message": "A numeric separator is only allowed between two digits (1:6)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "UnexpectedNumericSeparator" + } ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-76/output.json b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-76/output.json index 6a5210632fdb..e686427b8647 100644 --- a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-76/output.json +++ b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-76/output.json @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "A numeric separator is only allowed between two digits (1:2)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "UnexpectedNumericSeparator" + } ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-77/output.json b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-77/output.json index 3daf76e31921..d08caf2ad3b2 100644 --- a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-77/output.json +++ b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-77/output.json @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "A numeric separator is only allowed between two digits (1:4)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "UnexpectedNumericSeparator" + } ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-78/output.json b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-78/output.json index 945775d56e14..f9fcaad13657 100644 --- a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-78/output.json +++ b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-78/output.json @@ -2,8 +2,20 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "A numeric separator is only allowed between two digits (1:4)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "UnexpectedNumericSeparator" + }, + { + "$$ babel internal serialized type": "Error", + "message": "A numeric separator is only allowed between two digits (1:5)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "UnexpectedNumericSeparator" + } ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-79/output.json b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-79/output.json index 961a9442c741..e40ee0df54b1 100644 --- a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-79/output.json +++ b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-79/output.json @@ -2,8 +2,20 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "A numeric separator is only allowed between two digits (1:2)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "UnexpectedNumericSeparator" + }, + { + "$$ babel internal serialized type": "Error", + "message": "A numeric separator is only allowed between two digits (1:3)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "UnexpectedNumericSeparator" + } ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-8/output.json b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-8/output.json index ac19c3b8fef1..34929c70dbef 100644 --- a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-8/output.json +++ b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-8/output.json @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "A numeric separator is only allowed between two digits (1:6)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "UnexpectedNumericSeparator" + } ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-80/output.json b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-80/output.json index 5ac02a810421..569ce154c725 100644 --- a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-80/output.json +++ b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-80/output.json @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "A numeric separator is only allowed between two digits (1:4)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "UnexpectedNumericSeparator" + } ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-81/output.json b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-81/output.json index f85156325dbc..a2906d4cf403 100644 --- a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-81/output.json +++ b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-81/output.json @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "A numeric separator is only allowed between two digits (1:5)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "UnexpectedNumericSeparator" + } ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-82/output.json b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-82/output.json index 63db3421d887..e1693577835a 100644 --- a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-82/output.json +++ b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-82/output.json @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "A numeric separator is only allowed between two digits (1:6)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "UnexpectedNumericSeparator" + } ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-83/output.json b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-83/output.json index 34de6f803594..5b3608ef857a 100644 --- a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-83/output.json +++ b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-83/output.json @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "A numeric separator is only allowed between two digits (1:6)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "UnexpectedNumericSeparator" + } ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-84/output.json b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-84/output.json index bd892f5bef65..6075b79e90fd 100644 --- a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-84/output.json +++ b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-84/output.json @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "A numeric separator is only allowed between two digits (1:7)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "UnexpectedNumericSeparator" + } ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-85/output.json b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-85/output.json index 4ed7d8e9c017..9146e1d68377 100644 --- a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-85/output.json +++ b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-85/output.json @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "A numeric separator is only allowed between two digits (1:7)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "UnexpectedNumericSeparator" + } ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-86/output.json b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-86/output.json index 2038ff8d78f1..9cd7291b97ef 100644 --- a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-86/output.json +++ b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-86/output.json @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "A numeric separator is only allowed between two digits (1:6)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "UnexpectedNumericSeparator" + } ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-87/output.json b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-87/output.json index 593809dbd35d..489da3edc004 100644 --- a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-87/output.json +++ b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-87/output.json @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "A numeric separator is only allowed between two digits (1:6)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "UnexpectedNumericSeparator" + } ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-88/output.json b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-88/output.json index 67a557a8d3eb..f1415272cacc 100644 --- a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-88/output.json +++ b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-88/output.json @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "A numeric separator is only allowed between two digits (1:3)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "UnexpectedNumericSeparator" + } ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-89/output.json b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-89/output.json index 8a9f3fe0cf90..4046e696f1c3 100644 --- a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-89/output.json +++ b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-89/output.json @@ -2,9 +2,27 @@ "type": "File", "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)", - "SyntaxError: A numeric separator is only allowed between two digits (1:8)" + { + "$$ babel internal serialized type": "Error", + "message": "A numeric separator is only allowed between two digits (1:3)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "UnexpectedNumericSeparator" + }, + { + "$$ babel internal serialized type": "Error", + "message": "A numeric separator is only allowed between two digits (1:4)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "UnexpectedNumericSeparator" + }, + { + "$$ babel internal serialized type": "Error", + "message": "A numeric separator is only allowed between two digits (1:8)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "UnexpectedNumericSeparator" + } ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-9/output.json b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-9/output.json index 28cdddee6c6e..ca0ae465ffea 100644 --- a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-9/output.json +++ b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-9/output.json @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "A numeric separator is only allowed between two digits (1:6)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "UnexpectedNumericSeparator" + } ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-90/output.json b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-90/output.json index a46838420e3c..d9a87fab38c0 100644 --- a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-90/output.json +++ b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-90/output.json @@ -2,9 +2,27 @@ "type": "File", "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)", - "SyntaxError: A numeric separator is only allowed between two digits (1:6)" + { + "$$ babel internal serialized type": "Error", + "message": "A numeric separator is only allowed between two digits (1:3)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "UnexpectedNumericSeparator" + }, + { + "$$ babel internal serialized type": "Error", + "message": "A numeric separator is only allowed between two digits (1:5)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "UnexpectedNumericSeparator" + }, + { + "$$ babel internal serialized type": "Error", + "message": "A numeric separator is only allowed between two digits (1:6)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "UnexpectedNumericSeparator" + } ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-91/output.json b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-91/output.json index a4f7ce2d86b8..a85795cc3af4 100644 --- a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-91/output.json +++ b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-91/output.json @@ -2,8 +2,20 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "A numeric separator is only allowed between two digits (1:3)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "UnexpectedNumericSeparator" + }, + { + "$$ babel internal serialized type": "Error", + "message": "A numeric separator is only allowed between two digits (1:7)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "UnexpectedNumericSeparator" + } ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-92/output.json b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-92/output.json index 238b8d7eb92f..c0085250e6ec 100644 --- a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-92/output.json +++ b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-92/output.json @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "A numeric separator is only allowed between two digits (1:3)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "UnexpectedNumericSeparator" + } ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-93/output.json b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-93/output.json index aca4cb9eaa84..64a637c1baa9 100644 --- a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-93/output.json +++ b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-93/output.json @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "A numeric separator is only allowed between two digits (1:3)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "UnexpectedNumericSeparator" + } ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-94/output.json b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-94/output.json index 0f6ee969f91e..14db7c20d295 100644 --- a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-94/output.json +++ b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-94/output.json @@ -2,8 +2,20 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "A numeric separator is only allowed between two digits (1:3)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "UnexpectedNumericSeparator" + }, + { + "$$ babel internal serialized type": "Error", + "message": "A numeric separator is only allowed between two digits (1:8)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "UnexpectedNumericSeparator" + } ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-95/output.json b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-95/output.json index ebeef35878ea..6d40696ad95b 100644 --- a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-95/output.json +++ b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-95/output.json @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "A numeric separator is only allowed between two digits (1:3)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "UnexpectedNumericSeparator" + } ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-96/output.json b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-96/output.json index 90ccb24c1270..d64475d0bdb3 100644 --- a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-96/output.json +++ b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-96/output.json @@ -2,8 +2,20 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "A numeric separator is only allowed between two digits (1:3)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "UnexpectedNumericSeparator" + }, + { + "$$ babel internal serialized type": "Error", + "message": "A numeric separator is only allowed between two digits (1:8)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "UnexpectedNumericSeparator" + } ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-97/output.json b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-97/output.json index d354fd52d7e1..3df22de4a58c 100644 --- a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-97/output.json +++ b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-97/output.json @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "A numeric separator is only allowed between two digits (1:7)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "UnexpectedNumericSeparator" + } ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-98/output.json b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-98/output.json index fb6a3801249c..e3f78e26ca0b 100644 --- a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-98/output.json +++ b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-98/output.json @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "A numeric separator is only allowed between two digits (1:6)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "UnexpectedNumericSeparator" + } ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-99/output.json b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-99/output.json index a54bd3bbf50a..a21236f74426 100644 --- a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-99/output.json +++ b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-99/output.json @@ -2,8 +2,20 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "A numeric separator is only allowed between two digits (1:3)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "UnexpectedNumericSeparator" + }, + { + "$$ babel internal serialized type": "Error", + "message": "A numeric separator is only allowed between two digits (1:7)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "UnexpectedNumericSeparator" + } ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-hex/output.json b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-hex/output.json index e0ca2b4b003e..09432e19d203 100644 --- a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-hex/output.json +++ b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-hex/output.json @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "Numeric separators are not allowed inside unicode escape sequences or hex escape sequences (1:4)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "NumericSeparatorInEscapeSequence" + } ], "program": { "type": "Program", @@ -17,11 +23,11 @@ "value": { "type": "DirectiveLiteral", "start":0,"end":7,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":7}}, - "value": "\\x1_0", "extra": { "raw": "\"\\x1_0\"", "rawValue": "\\x1_0" - } + }, + "value": "\\x1_0" } } ] diff --git a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-leading-zero/output.json b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-leading-zero/output.json index 1d2d8a1aa2ae..49e2fd60217c 100644 --- a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-leading-zero/output.json +++ b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-leading-zero/output.json @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "Numeric separator can not be used after leading 0 (1:1)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "ZeroDigitNumericSeparator" + } ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-legacy-octal-literal/output.json b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-legacy-octal-literal/output.json index 2571dfafd4f8..9a0fd76c53fe 100644 --- a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-legacy-octal-literal/output.json +++ b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-legacy-octal-literal/output.json @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "Numeric separator can not be used after leading 0 (1:2)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "ZeroDigitNumericSeparator" + } ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-non-octal-decimal-int/output.json b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-non-octal-decimal-int/output.json index 1c28d1ead346..03f002849ae0 100644 --- a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-non-octal-decimal-int/output.json +++ b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-non-octal-decimal-int/output.json @@ -2,8 +2,20 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "Numeric separator can not be used after leading 0 (1:2)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "ZeroDigitNumericSeparator" + }, + { + "$$ babel internal serialized type": "Error", + "message": "Invalid BigIntLiteral (1:0)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "InvalidBigIntLiteral" + } ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-unicode-2/output.json b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-unicode-2/output.json index 8dbcd31afd33..c2f38f82948f 100644 --- a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-unicode-2/output.json +++ b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-unicode-2/output.json @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "Numeric separators are not allowed inside unicode escape sequences or hex escape sequences (1:5)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "NumericSeparatorInEscapeSequence" + } ], "program": { "type": "Program", @@ -17,11 +23,11 @@ "value": { "type": "DirectiveLiteral", "start":0,"end":9,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":9}}, - "value": "\\u12_34", "extra": { "raw": "\"\\u12_34\"", "rawValue": "\\u12_34" - } + }, + "value": "\\u12_34" } } ] diff --git a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-unicode/output.json b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-unicode/output.json index f7497689fd8d..98d801ae947c 100644 --- a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-unicode/output.json +++ b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-unicode/output.json @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "Numeric separators are not allowed inside unicode escape sequences or hex escape sequences (1:6)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "NumericSeparatorInEscapeSequence" + } ], "program": { "type": "Program", @@ -17,11 +23,11 @@ "value": { "type": "DirectiveLiteral", "start":0,"end":12,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":12}}, - "value": "\\u{1F_639}", "extra": { "raw": "\"\\u{1F_639}\"", "rawValue": "\\u{1F_639}" - } + }, + "value": "\\u{1F_639}" } } ] 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 94ce8601abd3..44a1c119396f 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 @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":32,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":32}}, "errors": [ - "SyntaxError: Argument name clash (1:14)" + { + "$$ babel internal serialized type": "Error", + "message": "Argument name clash (1:14)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "ParamDupe" + } ], "program": { "type": "Program", @@ -43,11 +49,11 @@ "value": { "type": "DirectiveLiteral", "start":18,"end":30,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":30}}, - "value": "use strict", "extra": { "raw": "'use strict'", "rawValue": "use strict" - } + }, + "value": "use strict" } } ] 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 cd41333b8b6a..62c1bb5d6956 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 @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":18,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":18}}, "errors": [ - "SyntaxError: Argument name clash (1:11)" + { + "$$ babel internal serialized type": "Error", + "message": "Argument name clash (1:11)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "ParamDupe" + } ], "program": { "type": "Program", 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 2bcffbf3a427..053fdd66af8c 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 @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":34,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":20}}, "errors": [ - "SyntaxError: Argument name clash (2:14)" + { + "$$ babel internal serialized type": "Error", + "message": "Argument name clash (2:14)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "ParamDupe" + } ], "program": { "type": "Program", @@ -53,11 +59,11 @@ "value": { "type": "DirectiveLiteral", "start":0,"end":12,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":12}}, - "value": "use strict", "extra": { "raw": "\"use strict\"", "rawValue": "use strict" - } + }, + "value": "use strict" } } ] diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-array-pattern/dupe-param-2/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-array-pattern/dupe-param-2/output.json index cc0e0ad645c9..03b1e4556d71 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 @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":37,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":23}}, "errors": [ - "SyntaxError: Argument name clash (2:17)" + { + "$$ babel internal serialized type": "Error", + "message": "Argument name clash (2:17)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "ParamDupe" + } ], "program": { "type": "Program", @@ -57,11 +63,11 @@ "value": { "type": "DirectiveLiteral", "start":0,"end":12,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":12}}, - "value": "use strict", "extra": { "raw": "\"use strict\"", "rawValue": "use strict" - } + }, + "value": "use strict" } } ] diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-array-pattern/dupe-param-3/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-array-pattern/dupe-param-3/output.json index 22f0d1704663..ef9507ffa6aa 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 @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":39,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":25}}, "errors": [ - "SyntaxError: Argument name clash (2:19)" + { + "$$ babel internal serialized type": "Error", + "message": "Argument name clash (2:19)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "ParamDupe" + } ], "program": { "type": "Program", @@ -32,6 +38,9 @@ { "type": "ObjectProperty", "start":27,"end":28,"loc":{"start":{"line":2,"column":13},"end":{"line":2,"column":14}}, + "extra": { + "shorthand": true + }, "method": false, "key": { "type": "Identifier", @@ -44,9 +53,6 @@ "type": "Identifier", "start":27,"end":28,"loc":{"start":{"line":2,"column":13},"end":{"line":2,"column":14},"identifierName":"a"}, "name": "a" - }, - "extra": { - "shorthand": true } } ] @@ -78,11 +84,11 @@ "value": { "type": "DirectiveLiteral", "start":0,"end":12,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":12}}, - "value": "use strict", "extra": { "raw": "\"use strict\"", "rawValue": "use strict" - } + }, + "value": "use strict" } } ] 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 dfab13123cb4..46f64706978c 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 @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":16,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":16}}, "errors": [ - "SyntaxError: Argument name clash (1:7)" + { + "$$ babel internal serialized type": "Error", + "message": "Argument name clash (1:7)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "ParamDupe" + } ], "program": { "type": "Program", 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 54a0b8dc4637..b6edf59679ac 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 @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":12,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":12}}, "errors": [ - "SyntaxError: Argument name clash (1:4)" + { + "$$ babel internal serialized type": "Error", + "message": "Argument name clash (1:4)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "ParamDupe" + } ], "program": { "type": "Program", 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 3dcc69133bee..66a231ecfc67 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 @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":23,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":23}}, "errors": [ - "SyntaxError: Binding 'eval' in strict mode (1:0)" + { + "$$ babel internal serialized type": "Error", + "message": "Binding 'eval' in strict mode (1:0)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "StrictEvalArgumentsBinding" + } ], "program": { "type": "Program", @@ -37,11 +43,11 @@ "value": { "type": "DirectiveLiteral", "start":9,"end":21,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":21}}, - "value": "use strict", "extra": { "raw": "\"use strict\"", "rawValue": "use strict" - } + }, + "value": "use strict" } } ] diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-arrow-function/non-arrow-param-followed-by-arrow/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-arrow-function/non-arrow-param-followed-by-arrow/output.json index 9fb39c9ca6ef..e187d88c1248 100644 --- a/packages/babel-parser/test/fixtures/esprima/es2015-arrow-function/non-arrow-param-followed-by-arrow/output.json +++ b/packages/babel-parser/test/fixtures/esprima/es2015-arrow-function/non-arrow-param-followed-by-arrow/output.json @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":10,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":10}}, "errors": [ - "SyntaxError: Invalid parenthesized assignment pattern (1:2)" + { + "$$ babel internal serialized type": "Error", + "message": "Invalid parenthesized assignment pattern (1:2)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "InvalidParenthesizedAssignment" + } ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-arrow-function/non-arrow-param-followed-by-rest/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-arrow-function/non-arrow-param-followed-by-rest/output.json index 7aefdb8c93dc..24de55eb26d0 100644 --- a/packages/babel-parser/test/fixtures/esprima/es2015-arrow-function/non-arrow-param-followed-by-rest/output.json +++ b/packages/babel-parser/test/fixtures/esprima/es2015-arrow-function/non-arrow-param-followed-by-rest/output.json @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":16,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":16}}, "errors": [ - "SyntaxError: Invalid parenthesized assignment pattern (1:2)" + { + "$$ babel internal serialized type": "Error", + "message": "Invalid parenthesized assignment pattern (1:2)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "InvalidParenthesizedAssignment" + } ], "program": { "type": "Program", 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 2bdcc96c2d26..225286225ea8 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 @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":13,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":13}}, "errors": [ - "SyntaxError: Binding member expression (1:4)" + { + "$$ babel internal serialized type": "Error", + "message": "Binding member expression (1:4)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "InvalidPropertyBindingPattern" + } ], "program": { "type": "Program", @@ -43,6 +49,7 @@ "start":4,"end":5,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":5},"identifierName":"b"}, "name": "b" }, + "computed": true, "property": { "type": "NumericLiteral", "start":6,"end":7,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":7}}, @@ -51,8 +58,7 @@ "raw": "0" }, "value": 0 - }, - "computed": true + } } } ] 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 55af5740543d..ba340bb268d4 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 @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "Object pattern can't contain getter or setter (1:6)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "PatternHasAccessor" + } ], "program": { "type": "Program", 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 cb2922c87ca7..080d5463e635 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 @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":54,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":54}}, "errors": [ - "SyntaxError: Binding member expression (1:24)" + { + "$$ babel internal serialized type": "Error", + "message": "Binding member expression (1:24)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "InvalidPropertyBindingPattern" + } ], "program": { "type": "Program", @@ -123,6 +129,7 @@ "start":24,"end":25,"loc":{"start":{"line":1,"column":24},"end":{"line":1,"column":25},"identifierName":"b"}, "name": "b" }, + "computed": true, "property": { "type": "NumericLiteral", "start":26,"end":27,"loc":{"start":{"line":1,"column":26},"end":{"line":1,"column":27}}, @@ -131,8 +138,7 @@ "raw": "0" }, "value": 0 - }, - "computed": true + } } } ] diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-destructuring-assignment-object-pattern/invalid-lhs-01/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-destructuring-assignment-object-pattern/invalid-lhs-01/output.json index 41ad542d8b26..80cd91442495 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 @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "Invalid left-hand side in object destructuring pattern (1:4)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "InvalidLhs" + } ], "program": { "type": "Program", @@ -16,6 +22,10 @@ "expression": { "type": "AssignmentExpression", "start":1,"end":11,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":11}}, + "extra": { + "parenthesized": true, + "parenStart": 0 + }, "operator": "=", "left": { "type": "ObjectPattern", @@ -47,10 +57,6 @@ "raw": "0" }, "value": 0 - }, - "extra": { - "parenthesized": true, - "parenStart": 0 } } } diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-destructuring-assignment-object-pattern/invalid-lhs-02/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-destructuring-assignment-object-pattern/invalid-lhs-02/output.json index 7c1957004b43..047a3e3c0925 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 @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "Invalid left-hand side in object destructuring pattern (1:5)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "InvalidLhs" + } ], "program": { "type": "Program", @@ -16,6 +22,10 @@ "expression": { "type": "AssignmentExpression", "start":1,"end":14,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":14}}, + "extra": { + "parenthesized": true, + "parenStart": 0 + }, "operator": "=", "left": { "type": "ObjectPattern", @@ -47,10 +57,6 @@ "raw": "0" }, "value": 0 - }, - "extra": { - "parenthesized": true, - "parenStart": 0 } } } diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-destructuring-assignment-object-pattern/invalid-pattern-with-method/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-destructuring-assignment-object-pattern/invalid-pattern-with-method/output.json index 9ad5276de4e3..8a758f11f08b 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 @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "Object pattern can't contain methods (1:2)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "PatternHasMethod" + } ], "program": { "type": "Program", @@ -16,6 +22,10 @@ "expression": { "type": "AssignmentExpression", "start":1,"end":10,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":10}}, + "extra": { + "parenthesized": true, + "parenStart": 0 + }, "operator": "=", "left": { "type": "ObjectPattern", @@ -53,10 +63,6 @@ "raw": "0" }, "value": 0 - }, - "extra": { - "parenthesized": true, - "parenStart": 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 7f8cd55c22f0..936ff455435d 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 @@ -2,8 +2,20 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "Invalid parenthesized assignment pattern (1:1)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "InvalidParenthesizedAssignment" + }, + { + "$$ babel internal serialized type": "Error", + "message": "Invalid left-hand side in assignment expression (1:1)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "InvalidLhs" + } ], "program": { "type": "Program", @@ -21,6 +33,10 @@ "left": { "type": "SequenceExpression", "start":1,"end":4,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":4}}, + "extra": { + "parenthesized": true, + "parenStart": 0 + }, "expressions": [ { "type": "Identifier", @@ -32,15 +48,15 @@ "start":3,"end":4,"loc":{"start":{"line":1,"column":3},"end":{"line":1,"column":4},"identifierName":"b"}, "name": "b" } - ], - "extra": { - "parenthesized": true, - "parenStart": 0 - } + ] }, "right": { "type": "SequenceExpression", "start":7,"end":10,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":10}}, + "extra": { + "parenthesized": true, + "parenStart": 6 + }, "expressions": [ { "type": "Identifier", @@ -52,11 +68,7 @@ "start":9,"end":10,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":10},"identifierName":"d"}, "name": "d" } - ], - "extra": { - "parenthesized": true, - "parenStart": 6 - } + ] } } } diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-export-declaration/invalid-export-named-default/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-export-declaration/invalid-export-named-default/output.json index 8d53b1d88989..8cf29decfb41 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 @@ -2,8 +2,20 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "Unexpected keyword 'default' (1:8)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "UnexpectedKeyword" + }, + { + "$$ babel internal serialized type": "Error", + "message": "Export 'default' is not defined (1:8)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "ModuleExportUndefined" + } ], "program": { "type": "Program", 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 6ddebf209368..3bfb4cb2f352 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 @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "for-of loop variable declaration may not have an initializer (1:5)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "ForInOfLoopInitializer" + } ], "program": { "type": "Program", 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 a98d3e9a56df..ab3964ffce10 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 @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "for-of loop variable declaration may not have an initializer (1:5)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "ForInOfLoopInitializer" + } ], "program": { "type": "Program", 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 e48c18d4d102..9505951b7ae6 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 @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "Invalid left-hand side in for-of statement (1:5)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "InvalidLhs" + } ], "program": { "type": "Program", 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 9c90d03acc48..8c67dcdbdf81 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 @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "for-of loop variable declaration may not have an initializer (1:5)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "ForInOfLoopInitializer" + } ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-for-of/unexpected-number/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-for-of/unexpected-number/output.json index 5259253cdffb..a3a86bf94c4c 100644 --- a/packages/babel-parser/test/fixtures/esprima/es2015-for-of/unexpected-number/output.json +++ b/packages/babel-parser/test/fixtures/esprima/es2015-for-of/unexpected-number/output.json @@ -2,9 +2,27 @@ "type": "File", "start":0,"end":18,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":18}}, "errors": [ - "SyntaxError: Const declarations require an initialization value (1:13)", - "SyntaxError: Missing semicolon (1:13)", - "SyntaxError: Missing semicolon (1:16)" + { + "$$ babel internal serialized type": "Error", + "message": "Const declarations require an initialization value (1:13)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "DeclarationMissingInitializer" + }, + { + "$$ babel internal serialized type": "Error", + "message": "Missing semicolon (1:13)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "MissingSemicolon" + }, + { + "$$ babel internal serialized type": "Error", + "message": "Missing semicolon (1:16)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "MissingSemicolon" + } ], "program": { "type": "Program", 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 c59f2314f4c6..da2d3c3a7250 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 @@ -2,8 +2,20 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "Invalid Unicode escape (1:4)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "EscapedCharNotAnIdentifier" + }, + { + "$$ babel internal serialized type": "Error", + "message": "Invalid Unicode escape (1:10)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "EscapedCharNotAnIdentifier" + } ], "program": { "type": "Program", 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 3b41003b9891..7c0abfca2329 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 @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "'import' and 'export' may appear only with 'sourceType: \"module\"' (1:0)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SOURCETYPE_MODULE_REQUIRED", + "reasonCode": "ImportOutsideModule" + } ], "program": { "type": "Program", 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 8b141a65c33b..6bf377a6a320 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 @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "'import' and 'export' may appear only with 'sourceType: \"module\"' (1:0)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SOURCETYPE_MODULE_REQUIRED", + "reasonCode": "ImportOutsideModule" + } ], "program": { "type": "Program", 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 a6a8254f883c..e7c46df83e9c 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 @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "Complex binding patterns require an initialization value (1:6)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "DeclarationMissingInitializer" + } ], "program": { "type": "Program", 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 8ed4dab050de..a10932d41e0e 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 @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "for-in loop variable declaration may not have an initializer (1:5)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "ForInOfLoopInitializer" + } ], "program": { "type": "Program", 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 4602d099aa90..cfb6deb08c87 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 @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "for-in loop variable declaration may not have an initializer (1:5)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "ForInOfLoopInitializer" + } ], "program": { "type": "Program", 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 d5f6e644d765..c6354097b566 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 @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "new.target can only be used in functions (1:8)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "UnexpectedNewTarget" + } ], "program": { "type": "Program", 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 61fc62e13aca..c636de2dd763 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 @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "The only valid meta property for new is new.target (1:25)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "UnsupportedMetaProperty" + } ], "program": { "type": "Program", 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 ff24f919512d..2b4e5a2c0ff4 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 @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":58,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":58}}, "errors": [ - "SyntaxError: Redefinition of __proto__ property (1:39)" + { + "$$ babel internal serialized type": "Error", + "message": "Redefinition of __proto__ property (1:39)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "DuplicateProto" + } ], "program": { "type": "Program", @@ -16,6 +22,11 @@ "expression": { "type": "ObjectExpression", "start":1,"end":57,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":57}}, + "extra": { + "trailingComma": 54, + "parenthesized": true, + "parenStart": 0 + }, "properties": [ { "type": "ObjectMethod", @@ -75,12 +86,7 @@ "start":50,"end":54,"loc":{"start":{"line":1,"column":50},"end":{"line":1,"column":54}} } } - ], - "extra": { - "trailingComma": 54, - "parenthesized": true, - "parenStart": 0 - } + ] } } ], diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-object-initialiser/invalid-proto-identifier-literal/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-object-initialiser/invalid-proto-identifier-literal/output.json index 036a85e2ef45..e92b350712d8 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 @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":40,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":40}}, "errors": [ - "SyntaxError: Redefinition of __proto__ property (1:20)" + { + "$$ babel internal serialized type": "Error", + "message": "Redefinition of __proto__ property (1:20)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "DuplicateProto" + } ], "program": { "type": "Program", @@ -16,6 +22,10 @@ "expression": { "type": "ObjectExpression", "start":1,"end":39,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":39}}, + "extra": { + "parenthesized": true, + "parenStart": 0 + }, "properties": [ { "type": "ObjectProperty", @@ -53,11 +63,7 @@ "start":33,"end":37,"loc":{"start":{"line":1,"column":33},"end":{"line":1,"column":37}} } } - ], - "extra": { - "parenthesized": true, - "parenStart": 0 - } + ] } } ], diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-object-initialiser/invalid-proto-identifiers/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-object-initialiser/invalid-proto-identifiers/output.json index cea3f4803586..fc00aa5b762c 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 @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":38,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":38}}, "errors": [ - "SyntaxError: Redefinition of __proto__ property (1:20)" + { + "$$ babel internal serialized type": "Error", + "message": "Redefinition of __proto__ property (1:20)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "DuplicateProto" + } ], "program": { "type": "Program", @@ -16,6 +22,10 @@ "expression": { "type": "ObjectExpression", "start":1,"end":37,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":37}}, + "extra": { + "parenthesized": true, + "parenStart": 0 + }, "properties": [ { "type": "ObjectProperty", @@ -49,11 +59,7 @@ "start":31,"end":35,"loc":{"start":{"line":1,"column":31},"end":{"line":1,"column":35}} } } - ], - "extra": { - "parenthesized": true, - "parenStart": 0 - } + ] } } ], diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-object-initialiser/invalid-proto-literal-identifier/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-object-initialiser/invalid-proto-literal-identifier/output.json index f8a8b6f0e06f..fceca5fd2abd 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 @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":40,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":40}}, "errors": [ - "SyntaxError: Redefinition of __proto__ property (1:22)" + { + "$$ babel internal serialized type": "Error", + "message": "Redefinition of __proto__ property (1:22)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "DuplicateProto" + } ], "program": { "type": "Program", @@ -16,6 +22,10 @@ "expression": { "type": "ObjectExpression", "start":1,"end":39,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":39}}, + "extra": { + "parenthesized": true, + "parenStart": 0 + }, "properties": [ { "type": "ObjectProperty", @@ -53,11 +63,7 @@ "start":33,"end":37,"loc":{"start":{"line":1,"column":33},"end":{"line":1,"column":37}} } } - ], - "extra": { - "parenthesized": true, - "parenStart": 0 - } + ] } } ], diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-object-initialiser/invalid-proto-literals/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-object-initialiser/invalid-proto-literals/output.json index 6c50c95aa2f0..274b96ddffbf 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 @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":42,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":42}}, "errors": [ - "SyntaxError: Redefinition of __proto__ property (1:22)" + { + "$$ babel internal serialized type": "Error", + "message": "Redefinition of __proto__ property (1:22)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "DuplicateProto" + } ], "program": { "type": "Program", @@ -16,6 +22,10 @@ "expression": { "type": "ObjectExpression", "start":1,"end":41,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":41}}, + "extra": { + "parenthesized": true, + "parenStart": 0 + }, "properties": [ { "type": "ObjectProperty", @@ -57,11 +67,7 @@ "start":35,"end":39,"loc":{"start":{"line":1,"column":35},"end":{"line":1,"column":39}} } } - ], - "extra": { - "parenthesized": true, - "parenStart": 0 - } + ] } } ], diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-object-initialiser/invalid-proto-setter-literal-identifier/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-object-initialiser/invalid-proto-setter-literal-identifier/output.json index 9ee4dd7e6aab..e0e457878c26 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 @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":61,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":61}}, "errors": [ - "SyntaxError: Redefinition of __proto__ property (1:42)" + { + "$$ babel internal serialized type": "Error", + "message": "Redefinition of __proto__ property (1:42)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "DuplicateProto" + } ], "program": { "type": "Program", @@ -16,6 +22,11 @@ "expression": { "type": "ObjectExpression", "start":1,"end":60,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":60}}, + "extra": { + "trailingComma": 57, + "parenthesized": true, + "parenStart": 0 + }, "properties": [ { "type": "ObjectMethod", @@ -81,12 +92,7 @@ "start":53,"end":57,"loc":{"start":{"line":1,"column":53},"end":{"line":1,"column":57}} } } - ], - "extra": { - "trailingComma": 57, - "parenthesized": true, - "parenStart": 0 - } + ] } } ], diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-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 581568e109df..7653795fec1c 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 @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "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)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "SuperNotAllowed" + } ], "program": { "type": "Program", 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 6218e2b71584..3931b84172c6 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 @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":5,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":5}}, "errors": [ - "SyntaxError: Invalid escape sequence in template (1:2)" + { + "$$ babel internal serialized type": "Error", + "message": "Invalid escape sequence in template (1:2)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "InvalidEscapeSequenceTemplate" + } ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-expression/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-expression/output.json index 4ec3bf958e39..6908e16d890c 100644 --- a/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-expression/output.json +++ b/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-expression/output.json @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":25,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":25}}, "errors": [ - "SyntaxError: Missing semicolon (1:19)" + { + "$$ babel internal serialized type": "Error", + "message": "Missing semicolon (1:19)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "MissingSemicolon" + } ], "program": { "type": "Program", 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 4a49e72e639c..90c0645c1bae 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 @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":38,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":38}}, "errors": [ - "SyntaxError: Yield expression is not allowed in formal parameters (1:21)" + { + "$$ babel internal serialized type": "Error", + "message": "Yield expression is not allowed in formal parameters (1:21)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "YieldInParameter" + } ], "program": { "type": "Program", 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 15805a597743..a8e2c7bd7ef3 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 @@ -2,8 +2,20 @@ "type": "File", "start":0,"end":30,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":30}}, "errors": [ - "SyntaxError: Yield expression is not allowed in formal parameters (1:16)", - "SyntaxError: Binding invalid left-hand side in function parameter list (1:16)" + { + "$$ babel internal serialized type": "Error", + "message": "Yield expression is not allowed in formal parameters (1:16)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "YieldInParameter" + }, + { + "$$ babel internal serialized type": "Error", + "message": "Binding invalid left-hand side in function parameter list (1:16)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "InvalidLhsBinding" + } ], "program": { "type": "Program", 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 0b7873711fdc..321bec3660ee 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 @@ -2,8 +2,20 @@ "type": "File", "start":0,"end":39,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":39}}, "errors": [ - "SyntaxError: Yield expression is not allowed in formal parameters (1:25)", - "SyntaxError: Binding invalid left-hand side in function parameter list (1:25)" + { + "$$ babel internal serialized type": "Error", + "message": "Yield expression is not allowed in formal parameters (1:25)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "YieldInParameter" + }, + { + "$$ babel internal serialized type": "Error", + "message": "Binding invalid left-hand side in function parameter list (1:25)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "InvalidLhsBinding" + } ], "program": { "type": "Program", 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 02857ebe4be5..02418d135e3f 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 @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "Can not use 'yield' as identifier inside a generator (1:30)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "YieldBindingIdentifier" + } ], "program": { "type": "Program", 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 bbdafe45b1f9..0774c30932fe 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 @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "Can not use 'yield' as identifier inside a generator (1:26)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "YieldBindingIdentifier" + } ], "program": { "type": "Program", 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 03ac7846dcdc..7b1c72863204 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 @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":35,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":35}}, "errors": [ - "SyntaxError: Unexpected reserved word 'yield' (1:25)" + { + "$$ babel internal serialized type": "Error", + "message": "Unexpected reserved word 'yield' (1:25)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "UnexpectedReservedWord" + } ], "program": { "type": "Program", 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 4824a8b5211c..8303b2d2c7f9 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 @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "Can not use 'yield' as identifier inside a generator (1:10)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "YieldBindingIdentifier" + } ], "program": { "type": "Program", @@ -16,6 +22,10 @@ "expression": { "type": "FunctionExpression", "start":1,"end":19,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":19}}, + "extra": { + "parenthesized": true, + "parenStart": 0 + }, "id": { "type": "Identifier", "start":10,"end":15,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":15},"identifierName":"yield"}, @@ -29,10 +39,6 @@ "start":17,"end":19,"loc":{"start":{"line":1,"column":17},"end":{"line":1,"column":19}}, "body": [], "directives": [] - }, - "extra": { - "parenthesized": true, - "parenStart": 0 } } } diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-generator-expression-parameter/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-generator-expression-parameter/output.json index 4ace3553e7e6..ab69f4963516 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 @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "Can not use 'yield' as identifier inside a generator (1:12)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "YieldBindingIdentifier" + } ], "program": { "type": "Program", @@ -16,6 +22,10 @@ "expression": { "type": "FunctionExpression", "start":1,"end":20,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":20}}, + "extra": { + "parenthesized": true, + "parenStart": 0 + }, "id": null, "generator": true, "async": false, @@ -31,10 +41,6 @@ "start":18,"end":20,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":20}}, "body": [], "directives": [] - }, - "extra": { - "parenthesized": true, - "parenStart": 0 } } } diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-generator-expression-rest/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-generator-expression-rest/output.json index 2f778cc2fe3b..cd0984d16119 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 @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "Can not use 'yield' as identifier inside a generator (1:18)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "YieldBindingIdentifier" + } ], "program": { "type": "Program", @@ -16,6 +22,10 @@ "expression": { "type": "FunctionExpression", "start":1,"end":26,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":26}}, + "extra": { + "parenthesized": true, + "parenStart": 0 + }, "id": null, "generator": true, "async": false, @@ -40,10 +50,6 @@ "start":24,"end":26,"loc":{"start":{"line":1,"column":24},"end":{"line":1,"column":26}}, "body": [], "directives": [] - }, - "extra": { - "parenthesized": true, - "parenStart": 0 } } } diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-generator-function-declaration/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-generator-function-declaration/output.json index 81b4ea1bb52c..e87e3bc275c2 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 @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "Can not use 'yield' as identifier inside a generator (1:25)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "YieldBindingIdentifier" + } ], "program": { "type": "Program", 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 7f30d1206584..4bfba6e277d4 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 @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "Can not use 'yield' as identifier inside a generator (1:20)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "YieldBindingIdentifier" + } ], "program": { "type": "Program", 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 5746a0c95c79..a342b7e2e11a 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 @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "Can not use 'yield' as identifier inside a generator (1:12)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "YieldBindingIdentifier" + } ], "program": { "type": "Program", 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 aabcbd49fd0c..753c6e8fb786 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 @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "Can not use 'yield' as identifier inside a generator (1:24)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "YieldBindingIdentifier" + } ], "program": { "type": "Program", 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 6e1c91ec0ff4..32ff8cb20619 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 @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":58,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":58}}, "errors": [ - "SyntaxError: Unexpected reserved word 'yield' (1:46)" + { + "$$ babel internal serialized type": "Error", + "message": "Unexpected reserved word 'yield' (1:46)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "UnexpectedReservedWord" + } ], "program": { "type": "Program", @@ -71,11 +77,11 @@ "value": { "type": "DirectiveLiteral", "start":0,"end":12,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":12}}, - "value": "use strict", "extra": { "raw": "\"use strict\"", "rawValue": "use strict" - } + }, + "value": "use strict" } } ] diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-generator-strict-function-parameter/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-generator-strict-function-parameter/output.json index 84e6c9206347..808744de859a 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 @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":58,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":58}}, "errors": [ - "SyntaxError: Unexpected reserved word 'yield' (1:47)" + { + "$$ babel internal serialized type": "Error", + "message": "Unexpected reserved word 'yield' (1:47)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "UnexpectedReservedWord" + } ], "program": { "type": "Program", @@ -73,11 +79,11 @@ "value": { "type": "DirectiveLiteral", "start":0,"end":12,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":12}}, - "value": "use strict", "extra": { "raw": "\"use strict\"", "rawValue": "use strict" - } + }, + "value": "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 0dd81b4d0dad..992ab552dddb 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 @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "Can not use 'yield' as identifier inside a generator (1:20)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "YieldBindingIdentifier" + } ], "program": { "type": "Program", 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 a662f4e01bbc..b247bcede615 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 @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":27,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":27}}, "errors": [ - "SyntaxError: Unexpected reserved word 'yield' (1:16)" + { + "$$ babel internal serialized type": "Error", + "message": "Unexpected reserved word 'yield' (1:16)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "UnexpectedReservedWord" + } ], "program": { "type": "Program", @@ -16,6 +22,10 @@ "expression": { "type": "AssignmentExpression", "start":15,"end":26,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":26}}, + "extra": { + "parenthesized": true, + "parenStart": 14 + }, "operator": "=", "left": { "type": "ArrayPattern", @@ -32,10 +42,6 @@ "type": "Identifier", "start":25,"end":26,"loc":{"start":{"line":1,"column":25},"end":{"line":1,"column":26},"identifierName":"x"}, "name": "x" - }, - "extra": { - "parenthesized": true, - "parenStart": 14 } } } @@ -47,11 +53,11 @@ "value": { "type": "DirectiveLiteral", "start":0,"end":12,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":12}}, - "value": "use strict", "extra": { "raw": "\"use strict\"", "rawValue": "use strict" - } + }, + "value": "use strict" } } ] diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-strict-arrow-parameter-default/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-strict-arrow-parameter-default/output.json index c6814edc8a57..ffb5a9124cf4 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 @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":31,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":31}}, "errors": [ - "SyntaxError: Unexpected reserved word 'yield' (1:19)" + { + "$$ babel internal serialized type": "Error", + "message": "Unexpected reserved word 'yield' (1:19)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "UnexpectedReservedWord" + } ], "program": { "type": "Program", @@ -51,11 +57,11 @@ "value": { "type": "DirectiveLiteral", "start":0,"end":12,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":12}}, - "value": "use strict", "extra": { "raw": "\"use strict\"", "rawValue": "use strict" - } + }, + "value": "use strict" } } ] diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-strict-arrow-parameter-name/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-strict-arrow-parameter-name/output.json index bf2fe8474748..fda0410c675e 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 @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":27,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":27}}, "errors": [ - "SyntaxError: Unexpected reserved word 'yield' (1:15)" + { + "$$ babel internal serialized type": "Error", + "message": "Unexpected reserved word 'yield' (1:15)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "UnexpectedReservedWord" + } ], "program": { "type": "Program", @@ -45,11 +51,11 @@ "value": { "type": "DirectiveLiteral", "start":0,"end":12,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":12}}, - "value": "use strict", "extra": { "raw": "\"use strict\"", "rawValue": "use strict" - } + }, + "value": "use strict" } } ] diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-strict-binding-element/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-strict-binding-element/output.json index c1253768e7a1..7daa4afeb569 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 @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":37,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":37}}, "errors": [ - "SyntaxError: Unexpected reserved word 'yield' (1:23)" + { + "$$ babel internal serialized type": "Error", + "message": "Unexpected reserved word 'yield' (1:23)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "UnexpectedReservedWord" + } ], "program": { "type": "Program", @@ -57,11 +63,11 @@ "value": { "type": "DirectiveLiteral", "start":0,"end":12,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":12}}, - "value": "use strict", "extra": { "raw": "\"use strict\"", "rawValue": "use strict" - } + }, + "value": "use strict" } } ] diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-strict-catch-parameter/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-strict-catch-parameter/output.json index dda9f41982b5..ad391945a9ea 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 @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":37,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":37}}, "errors": [ - "SyntaxError: Unexpected reserved word 'yield' (1:28)" + { + "$$ babel internal serialized type": "Error", + "message": "Unexpected reserved word 'yield' (1:28)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "UnexpectedReservedWord" + } ], "program": { "type": "Program", @@ -44,11 +50,11 @@ "value": { "type": "DirectiveLiteral", "start":0,"end":12,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":12}}, - "value": "use strict", "extra": { "raw": "\"use strict\"", "rawValue": "use strict" - } + }, + "value": "use strict" } } ] diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-strict-formal-parameter/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-strict-formal-parameter/output.json index 0d2aafc8542d..f457f31f2329 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 @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":34,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":34}}, "errors": [ - "SyntaxError: Unexpected reserved word 'yield' (1:25)" + { + "$$ babel internal serialized type": "Error", + "message": "Unexpected reserved word 'yield' (1:25)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "UnexpectedReservedWord" + } ], "program": { "type": "Program", @@ -42,11 +48,11 @@ "value": { "type": "DirectiveLiteral", "start":0,"end":12,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":12}}, - "value": "use strict", "extra": { "raw": "\"use strict\"", "rawValue": "use strict" - } + }, + "value": "use strict" } } ] diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-strict-function-declaration/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-strict-function-declaration/output.json index 5f2d921752e9..b52942a2e895 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 @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":33,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":33}}, "errors": [ - "SyntaxError: Binding 'yield' in strict mode (1:9)" + { + "$$ babel internal serialized type": "Error", + "message": "Binding 'yield' in strict mode (1:9)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "StrictEvalArgumentsBinding" + } ], "program": { "type": "Program", @@ -32,11 +38,11 @@ "value": { "type": "DirectiveLiteral", "start":18,"end":30,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":30}}, - "value": "use strict", "extra": { "raw": "\"use strict\"", "rawValue": "use strict" - } + }, + "value": "use strict" } } ] diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-strict-function-expression/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-strict-function-expression/output.json index f9eae4038a76..e7cfe8306c5f 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 @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":35,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":35}}, "errors": [ - "SyntaxError: Binding 'yield' in strict mode (1:10)" + { + "$$ babel internal serialized type": "Error", + "message": "Binding 'yield' in strict mode (1:10)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "StrictEvalArgumentsBinding" + } ], "program": { "type": "Program", @@ -16,6 +22,10 @@ "expression": { "type": "FunctionExpression", "start":1,"end":34,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":34}}, + "extra": { + "parenthesized": true, + "parenStart": 0 + }, "id": { "type": "Identifier", "start":10,"end":15,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":15},"identifierName":"yield"}, @@ -35,18 +45,14 @@ "value": { "type": "DirectiveLiteral", "start":19,"end":31,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":31}}, - "value": "use strict", "extra": { "raw": "\"use strict\"", "rawValue": "use strict" - } + }, + "value": "use strict" } } ] - }, - "extra": { - "parenthesized": true, - "parenStart": 0 } } } diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-strict-identifier/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-strict-identifier/output.json index 6ea37fe80964..0dd97e67f9e4 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 @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":36,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":36}}, "errors": [ - "SyntaxError: Unexpected reserved word 'yield' (1:29)" + { + "$$ babel internal serialized type": "Error", + "message": "Unexpected reserved word 'yield' (1:29)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "UnexpectedReservedWord" + } ], "program": { "type": "Program", @@ -46,11 +52,11 @@ "value": { "type": "DirectiveLiteral", "start":0,"end":12,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":12}}, - "value": "use strict", "extra": { "raw": "\"use strict\"", "rawValue": "use strict" - } + }, + "value": "use strict" } } ] diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-strict-lexical-declaration/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-strict-lexical-declaration/output.json index 9a8eac94acf9..ce24ccad3f4c 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 @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":29,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":29}}, "errors": [ - "SyntaxError: Unexpected reserved word 'yield' (1:18)" + { + "$$ babel internal serialized type": "Error", + "message": "Unexpected reserved word 'yield' (1:18)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "UnexpectedReservedWord" + } ], "program": { "type": "Program", @@ -43,11 +49,11 @@ "value": { "type": "DirectiveLiteral", "start":0,"end":12,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":12}}, - "value": "use strict", "extra": { "raw": "\"use strict\"", "rawValue": "use strict" - } + }, + "value": "use strict" } } ] diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-strict-rest-parameter/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-strict-rest-parameter/output.json index 2aaef66deac6..13cf204a1b61 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 @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":37,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":37}}, "errors": [ - "SyntaxError: Unexpected reserved word 'yield' (1:28)" + { + "$$ babel internal serialized type": "Error", + "message": "Unexpected reserved word 'yield' (1:28)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "UnexpectedReservedWord" + } ], "program": { "type": "Program", @@ -46,11 +52,11 @@ "value": { "type": "DirectiveLiteral", "start":0,"end":12,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":12}}, - "value": "use strict", "extra": { "raw": "\"use strict\"", "rawValue": "use strict" - } + }, + "value": "use strict" } } ] diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-strict-variable-declaration/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-strict-variable-declaration/output.json index 5554975e11c5..e8e009849681 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 @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":24,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":24}}, "errors": [ - "SyntaxError: Unexpected reserved word 'yield' (1:18)" + { + "$$ babel internal serialized type": "Error", + "message": "Unexpected reserved word 'yield' (1:18)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "UnexpectedReservedWord" + } ], "program": { "type": "Program", @@ -35,11 +41,11 @@ "value": { "type": "DirectiveLiteral", "start":0,"end":12,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":12}}, - "value": "use strict", "extra": { "raw": "\"use strict\"", "rawValue": "use strict" - } + }, + "value": "use strict" } } ] 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 d74d0a848b05..4af47c80fa9c 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 @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":35,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":35}}, "errors": [ - "SyntaxError: Yield expression is not allowed in formal parameters (1:21)" + { + "$$ babel internal serialized type": "Error", + "message": "Yield expression is not allowed in formal parameters (1:21)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "YieldInParameter" + } ], "program": { "type": "Program", 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 ba8f74f4e0f4..5467b7244b37 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 @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":18,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":18}}, "errors": [ - "SyntaxError: Invalid Unicode escape (1:12)" + { + "$$ babel internal serialized type": "Error", + "message": "Invalid Unicode escape (1:12)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "EscapedCharNotAnIdentifier" + } ], "program": { "type": "Program", 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 88942a742b03..30e7e838d8a3 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 @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":5,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":5}}, "errors": [ - "SyntaxError: Bad character escape sequence (1:3)" + { + "$$ babel internal serialized type": "Error", + "message": "Bad character escape sequence (1:3)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "InvalidEscapeSequence" + } ], "program": { "type": "Program", @@ -17,11 +23,11 @@ "value": { "type": "DirectiveLiteral", "start":0,"end":4,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":4}}, - "value": "\\x", "extra": { "raw": "\"\\x\"", "rawValue": "\\x" - } + }, + "value": "\\x" } } ] diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/GH-1106-01/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/GH-1106-01/output.json index f306e9f02374..f3e095e81a39 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 @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":6,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":6}}, "errors": [ - "SyntaxError: Bad character escape sequence (1:3)" + { + "$$ babel internal serialized type": "Error", + "message": "Bad character escape sequence (1:3)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "InvalidEscapeSequence" + } ], "program": { "type": "Program", @@ -17,11 +23,11 @@ "value": { "type": "DirectiveLiteral", "start":0,"end":5,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":5}}, - "value": "\\x0", "extra": { "raw": "\"\\x0\"", "rawValue": "\\x0" - } + }, + "value": "\\x0" } } ] diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/GH-1106-02/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/GH-1106-02/output.json index c25ed8c8341b..0cd19e241bc5 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 @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":6,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":6}}, "errors": [ - "SyntaxError: Bad character escape sequence (1:3)" + { + "$$ babel internal serialized type": "Error", + "message": "Bad character escape sequence (1:3)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "InvalidEscapeSequence" + } ], "program": { "type": "Program", @@ -17,11 +23,11 @@ "value": { "type": "DirectiveLiteral", "start":0,"end":5,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":5}}, - "value": "\\xx", "extra": { "raw": "\"\\xx\"", "rawValue": "\\xx" - } + }, + "value": "\\xx" } } ] diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/GH-1106-03/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/GH-1106-03/output.json index a9e327e586d0..f55264890e36 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 @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":5,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":5}}, "errors": [ - "SyntaxError: Bad character escape sequence (1:3)" + { + "$$ babel internal serialized type": "Error", + "message": "Bad character escape sequence (1:3)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "InvalidEscapeSequence" + } ], "program": { "type": "Program", @@ -17,11 +23,11 @@ "value": { "type": "DirectiveLiteral", "start":0,"end":4,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":4}}, - "value": "\\u", "extra": { "raw": "\"\\u\"", "rawValue": "\\u" - } + }, + "value": "\\u" } } ] diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/GH-1106-04/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/GH-1106-04/output.json index 93cf7ff8ffba..c537a18dc569 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 @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":6,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":6}}, "errors": [ - "SyntaxError: Bad character escape sequence (1:3)" + { + "$$ babel internal serialized type": "Error", + "message": "Bad character escape sequence (1:3)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "InvalidEscapeSequence" + } ], "program": { "type": "Program", @@ -17,11 +23,11 @@ "value": { "type": "DirectiveLiteral", "start":0,"end":5,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":5}}, - "value": "\\u0", "extra": { "raw": "\"\\u0\"", "rawValue": "\\u0" - } + }, + "value": "\\u0" } } ] diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/GH-1106-05/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/GH-1106-05/output.json index 0964301530d5..7b7ec36f565b 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 @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":6,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":6}}, "errors": [ - "SyntaxError: Bad character escape sequence (1:3)" + { + "$$ babel internal serialized type": "Error", + "message": "Bad character escape sequence (1:3)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "InvalidEscapeSequence" + } ], "program": { "type": "Program", @@ -17,11 +23,11 @@ "value": { "type": "DirectiveLiteral", "start":0,"end":5,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":5}}, - "value": "\\ux", "extra": { "raw": "\"\\ux\"", "rawValue": "\\ux" - } + }, + "value": "\\ux" } } ] diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/GH-1106-06/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/GH-1106-06/output.json index 9d296488f002..75f4c6c758f7 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 @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":7,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":7}}, "errors": [ - "SyntaxError: Bad character escape sequence (1:3)" + { + "$$ babel internal serialized type": "Error", + "message": "Bad character escape sequence (1:3)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "InvalidEscapeSequence" + } ], "program": { "type": "Program", @@ -17,11 +23,11 @@ "value": { "type": "DirectiveLiteral", "start":0,"end":6,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":6}}, - "value": "\\u00", "extra": { "raw": "\"\\u00\"", "rawValue": "\\u00" - } + }, + "value": "\\u00" } } ] diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/GH-1106-07/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/GH-1106-07/output.json index 667e2055d9f2..2371b9b445d6 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 @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":8,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":8}}, "errors": [ - "SyntaxError: Bad character escape sequence (1:3)" + { + "$$ babel internal serialized type": "Error", + "message": "Bad character escape sequence (1:3)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "InvalidEscapeSequence" + } ], "program": { "type": "Program", @@ -17,11 +23,11 @@ "value": { "type": "DirectiveLiteral", "start":0,"end":7,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":7}}, - "value": "\\u000", "extra": { "raw": "\"\\u000\"", "rawValue": "\\u000" - } + }, + "value": "\\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 6afcaf3f5045..883c24d13028 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 @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":2,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":2}}, "errors": [ - "SyntaxError: Floating-point numbers require a valid exponent after the 'e' (1:0)" + { + "$$ babel internal serialized type": "Error", + "message": "Floating-point numbers require a valid exponent after the 'e' (1:0)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "InvalidOrMissingExponent" + } ], "program": { "type": "Program", 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 34027472096c..ffa485251e6f 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 @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":3,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":3}}, "errors": [ - "SyntaxError: Floating-point numbers require a valid exponent after the 'e' (1:0)" + { + "$$ babel internal serialized type": "Error", + "message": "Floating-point numbers require a valid exponent after the 'e' (1:0)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "InvalidOrMissingExponent" + } ], "program": { "type": "Program", 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 666fcca21213..ff4ec8fd0d3a 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 @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":3,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":3}}, "errors": [ - "SyntaxError: Floating-point numbers require a valid exponent after the 'e' (1:0)" + { + "$$ babel internal serialized type": "Error", + "message": "Floating-point numbers require a valid exponent after the 'e' (1:0)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "InvalidOrMissingExponent" + } ], "program": { "type": "Program", 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 9a1a7ea60803..9c79df241210 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 @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":2,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":2}}, "errors": [ - "SyntaxError: Expected number in radix 16 (1:2)" + { + "$$ babel internal serialized type": "Error", + "message": "Expected number in radix 16 (1:2)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "InvalidDigit" + } ], "program": { "type": "Program", 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 a880531bce85..6d36cc449c9f 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 @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":2,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":2}}, "errors": [ - "SyntaxError: Expected number in radix 8 (1:2)" + { + "$$ babel internal serialized type": "Error", + "message": "Expected number in radix 8 (1:2)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "InvalidDigit" + } ], "program": { "type": "Program", 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 91dec1a23074..1964b91a0929 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 @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":2,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":2}}, "errors": [ - "SyntaxError: Expected number in radix 8 (1:2)" + { + "$$ babel internal serialized type": "Error", + "message": "Expected number in radix 8 (1:2)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "InvalidDigit" + } ], "program": { "type": "Program", 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 42696d4924d6..737f32877968 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 @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":3,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":3}}, "errors": [ - "SyntaxError: Expected number in radix 8 (1:2)" + { + "$$ babel internal serialized type": "Error", + "message": "Expected number in radix 8 (1:2)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "InvalidDigit" + } ], "program": { "type": "Program", 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 9ed93409bc00..907b23c069d3 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 @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":4,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":4}}, "errors": [ - "SyntaxError: Expected number in radix 8 (1:3)" + { + "$$ babel internal serialized type": "Error", + "message": "Expected number in radix 8 (1:3)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "InvalidDigit" + } ], "program": { "type": "Program", 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 bd3bd49916b3..1300079f48c8 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 @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":2,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":2}}, "errors": [ - "SyntaxError: Expected number in radix 2 (1:2)" + { + "$$ babel internal serialized type": "Error", + "message": "Expected number in radix 2 (1:2)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "InvalidDigit" + } ], "program": { "type": "Program", 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 fabbead51492..0fdfbe633576 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 @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":3,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":3}}, "errors": [ - "SyntaxError: Expected number in radix 2 (1:2)" + { + "$$ babel internal serialized type": "Error", + "message": "Expected number in radix 2 (1:2)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "InvalidDigit" + } ], "program": { "type": "Program", 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 c90afe1734e6..bdc7d4022289 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 @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":4,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":4}}, "errors": [ - "SyntaxError: Expected number in radix 2 (1:3)" + { + "$$ babel internal serialized type": "Error", + "message": "Expected number in radix 2 (1:3)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "InvalidDigit" + } ], "program": { "type": "Program", 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 2b8e4f22be33..f097a9055158 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 @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":4,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":4}}, "errors": [ - "SyntaxError: Expected number in radix 2 (1:3)" + { + "$$ babel internal serialized type": "Error", + "message": "Expected number in radix 2 (1:3)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "InvalidDigit" + } ], "program": { "type": "Program", 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 6cfde9edb3b5..83fc6641c202 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 @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":2,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":2}}, "errors": [ - "SyntaxError: Expected number in radix 2 (1:2)" + { + "$$ babel internal serialized type": "Error", + "message": "Expected number in radix 2 (1:2)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "InvalidDigit" + } ], "program": { "type": "Program", 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 6e3728ace39b..c4e544ef0ee4 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 @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":3,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":3}}, "errors": [ - "SyntaxError: Expected number in radix 2 (1:2)" + { + "$$ babel internal serialized type": "Error", + "message": "Expected number in radix 2 (1:2)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "InvalidDigit" + } ], "program": { "type": "Program", 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 d5ba308d5906..1f59a3719056 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 @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":4,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":4}}, "errors": [ - "SyntaxError: Expected number in radix 2 (1:3)" + { + "$$ babel internal serialized type": "Error", + "message": "Expected number in radix 2 (1:3)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "InvalidDigit" + } ], "program": { "type": "Program", 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 af38f05f89fa..3d4d7dc83f7a 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 @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":4,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":4}}, "errors": [ - "SyntaxError: Expected number in radix 2 (1:3)" + { + "$$ babel internal serialized type": "Error", + "message": "Expected number in radix 2 (1:3)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "InvalidDigit" + } ], "program": { "type": "Program", 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 2fbc3ece3140..0a044dc7b3de 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 @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":3,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":3}}, "errors": [ - "SyntaxError: Expected number in radix 8 (1:2)" + { + "$$ babel internal serialized type": "Error", + "message": "Expected number in radix 8 (1:2)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "InvalidDigit" + } ], "program": { "type": "Program", 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 4978bcf4e51b..5e0da6655d33 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 @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":4,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":4}}, "errors": [ - "SyntaxError: Expected number in radix 8 (1:3)" + { + "$$ babel internal serialized type": "Error", + "message": "Expected number in radix 8 (1:3)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "InvalidDigit" + } ], "program": { "type": "Program", 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 5dd7b5d3fcd6..91a7c6fff46d 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 @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":2,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":2}}, "errors": [ - "SyntaxError: Expecting Unicode escape sequence \\uXXXX (1:2)" + { + "$$ babel internal serialized type": "Error", + "message": "Expecting Unicode escape sequence \\uXXXX (1:2)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "MissingUnicodeEscape" + } ], "program": { "type": "Program", 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 d9a89994f01f..600288e132df 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 @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":7,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":7}}, "errors": [ - "SyntaxError: Invalid Unicode escape (1:1)" + { + "$$ babel internal serialized type": "Error", + "message": "Invalid Unicode escape (1:1)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "EscapedCharNotAnIdentifier" + } ], "program": { "type": "Program", 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 32180fcde928..00f879dacea7 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 @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":7,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":7}}, "errors": [ - "SyntaxError: Invalid Unicode escape (1:1)" + { + "$$ babel internal serialized type": "Error", + "message": "Invalid Unicode escape (1:1)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "EscapedCharNotAnIdentifier" + } ], "program": { "type": "Program", 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 f676471df15f..1a2515185e8f 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 @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":3,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":3}}, "errors": [ - "SyntaxError: Bad character escape sequence (1:3)" + { + "$$ babel internal serialized type": "Error", + "message": "Bad character escape sequence (1:3)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "InvalidEscapeSequence" + } ], "program": { "type": "Program", 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 8bc86d6bda14..96913fd2eda0 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 @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":3,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":3}}, "errors": [ - "SyntaxError: Bad character escape sequence (1:2)" + { + "$$ babel internal serialized type": "Error", + "message": "Bad character escape sequence (1:2)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "InvalidEscapeSequence" + } ], "program": { "type": "Program", 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 d42d61f8a543..53e05e009c62 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 @@ -2,8 +2,20 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "Invalid regular expression flag (1:16)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "MalformedRegExpFlags" + }, + { + "$$ babel internal serialized type": "Error", + "message": "Invalid regular expression flag (1:18)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "MalformedRegExpFlags" + } ], "program": { "type": "Program", 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 1e07f7e127f8..2f0b4c638b81 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 @@ -2,8 +2,20 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "Invalid regular expression flag (1:18)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "MalformedRegExpFlags" + }, + { + "$$ babel internal serialized type": "Error", + "message": "Invalid regular expression flag (1:20)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "MalformedRegExpFlags" + } ], "program": { "type": "Program", 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 471a965aa78c..2d937afc58a1 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 @@ -2,9 +2,27 @@ "type": "File", "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)", - "SyntaxError: Invalid regular expression flag (1:19)" + { + "$$ babel internal serialized type": "Error", + "message": "Invalid regular expression flag (1:16)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "MalformedRegExpFlags" + }, + { + "$$ babel internal serialized type": "Error", + "message": "Invalid regular expression flag (1:17)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "MalformedRegExpFlags" + }, + { + "$$ babel internal serialized type": "Error", + "message": "Invalid regular expression flag (1:19)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "MalformedRegExpFlags" + } ], "program": { "type": "Program", 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 c783115307d9..5a14bc8553a4 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 @@ -2,12 +2,48 @@ "type": "File", "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)", - "SyntaxError: Invalid regular expression flag (1:20)", - "SyntaxError: Invalid regular expression flag (1:21)", - "SyntaxError: Invalid regular expression flag (1:22)", - "SyntaxError: Invalid regular expression flag (1:23)" + { + "$$ babel internal serialized type": "Error", + "message": "Invalid regular expression flag (1:17)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "MalformedRegExpFlags" + }, + { + "$$ babel internal serialized type": "Error", + "message": "Invalid regular expression flag (1:18)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "MalformedRegExpFlags" + }, + { + "$$ babel internal serialized type": "Error", + "message": "Invalid regular expression flag (1:20)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "MalformedRegExpFlags" + }, + { + "$$ babel internal serialized type": "Error", + "message": "Invalid regular expression flag (1:21)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "MalformedRegExpFlags" + }, + { + "$$ babel internal serialized type": "Error", + "message": "Invalid regular expression flag (1:22)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "MalformedRegExpFlags" + }, + { + "$$ babel internal serialized type": "Error", + "message": "Invalid regular expression flag (1:23)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "MalformedRegExpFlags" + } ], "program": { "type": "Program", 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 d4d2cf5dfe67..a7671046aad4 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 @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "Invalid left-hand side in assignment expression (1:0)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "InvalidLhs" + } ], "program": { "type": "Program", 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 edc325840380..729a18689859 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 @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "Invalid left-hand side in assignment expression (1:0)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "InvalidLhs" + } ], "program": { "type": "Program", 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 46112c6c8828..93e28674a7e9 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 @@ -2,8 +2,20 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "Invalid parenthesized assignment pattern (1:1)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "InvalidParenthesizedAssignment" + }, + { + "$$ babel internal serialized type": "Error", + "message": "Invalid left-hand side in assignment expression (1:1)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "InvalidLhs" + } ], "program": { "type": "Program", @@ -21,6 +33,10 @@ "left": { "type": "BinaryExpression", "start":1,"end":6,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":6}}, + "extra": { + "parenthesized": true, + "parenStart": 0 + }, "left": { "type": "NumericLiteral", "start":1,"end":2,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":2}}, @@ -39,10 +55,6 @@ "raw": "1" }, "value": 1 - }, - "extra": { - "parenthesized": true, - "parenStart": 0 } }, "right": { 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 53070d6b82ec..b39fc66d1987 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 @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":4,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":4}}, "errors": [ - "SyntaxError: Bad character escape sequence (1:3)" + { + "$$ babel internal serialized type": "Error", + "message": "Bad character escape sequence (1:3)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "InvalidEscapeSequence" + } ], "program": { "type": "Program", 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 b43e07489eca..84711b3997bd 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 @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":7,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":7}}, "errors": [ - "SyntaxError: Bad character escape sequence (1:3)" + { + "$$ babel internal serialized type": "Error", + "message": "Bad character escape sequence (1:3)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "InvalidEscapeSequence" + } ], "program": { "type": "Program", 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 ff97ec8233c7..accfd583a7ad 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 @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":7,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":7}}, "errors": [ - "SyntaxError: Bad character escape sequence (1:3)" + { + "$$ babel internal serialized type": "Error", + "message": "Bad character escape sequence (1:3)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "InvalidEscapeSequence" + } ], "program": { "type": "Program", 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 89b9c579fa1c..16ad82507946 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 @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "Invalid left-hand side in postfix operation (1:0)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "InvalidLhs" + } ], "program": { "type": "Program", 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 b0387fd4ff59..708e2b2494a7 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 @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "Invalid left-hand side in postfix operation (1:0)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "InvalidLhs" + } ], "program": { "type": "Program", 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 e86e86ca2246..469422c74446 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 @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "Invalid left-hand side in prefix operation (1:2)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "InvalidLhs" + } ], "program": { "type": "Program", 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 de49f7815bd2..131ef5247a97 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 @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "Invalid left-hand side in prefix operation (1:2)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "InvalidLhs" + } ], "program": { "type": "Program", 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 609aed8d6228..bb0a0a0a7793 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 @@ -2,8 +2,20 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "Invalid parenthesized assignment pattern (1:5)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "InvalidParenthesizedAssignment" + }, + { + "$$ babel internal serialized type": "Error", + "message": "Invalid left-hand side in for-in statement (1:5)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "InvalidLhs" + } ], "program": { "type": "Program", @@ -17,6 +29,10 @@ "left": { "type": "BinaryExpression", "start":5,"end":10,"loc":{"start":{"line":1,"column":5},"end":{"line":1,"column":10}}, + "extra": { + "parenthesized": true, + "parenStart": 4 + }, "left": { "type": "NumericLiteral", "start":5,"end":6,"loc":{"start":{"line":1,"column":5},"end":{"line":1,"column":6}}, @@ -35,10 +51,6 @@ "raw": "1" }, "value": 1 - }, - "extra": { - "parenthesized": true, - "parenStart": 4 } }, "right": { 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 71a10a5324e9..e7ed0ccccf9d 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 @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":11,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":11}}, "errors": [ - "SyntaxError: Unexpected keyword 'if' (1:4)" + { + "$$ babel internal serialized type": "Error", + "message": "Unexpected keyword 'if' (1:4)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "UnexpectedKeyword" + } ], "program": { "type": "Program", 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 62e99551071a..818f8f80301c 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 @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "Invalid left-hand side in assignment expression (1:0)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "InvalidLhs" + } ], "program": { "type": "Program", 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 ba27c1c609ba..1c6c7ad1a08d 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 @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "Invalid left-hand side in assignment expression (1:0)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "InvalidLhs" + } ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0071/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0071/output.json index ec9f3f126a1c..62f52cec85ea 100644 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0071/output.json +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0071/output.json @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":9,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":9}}, "errors": [ - "SyntaxError: Missing semicolon (1:5)" + { + "$$ babel internal serialized type": "Error", + "message": "Missing semicolon (1:5)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "MissingSemicolon" + } ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0072/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0072/output.json index eb17665ab7f3..e59f82943a87 100644 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0072/output.json +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0072/output.json @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":9,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":9}}, "errors": [ - "SyntaxError: Missing semicolon (1:5)" + { + "$$ babel internal serialized type": "Error", + "message": "Missing semicolon (1:5)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "MissingSemicolon" + } ], "program": { "type": "Program", 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 d704a0cb48a6..88a2ba50dba4 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 @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "setter must have exactly one formal parameter (1:3)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "BadSetterArity" + } ], "program": { "type": "Program", @@ -16,6 +22,10 @@ "expression": { "type": "ObjectExpression", "start":1,"end":16,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":16}}, + "extra": { + "parenthesized": true, + "parenStart": 0 + }, "properties": [ { "type": "Property", @@ -44,11 +54,7 @@ }, "shorthand": false } - ], - "extra": { - "parenthesized": true, - "parenStart": 0 - } + ] } } ] diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0087/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0087/output.json index cca401d0d14b..d4e7bca942e9 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 @@ -2,8 +2,20 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "Assigning to 'eval' in strict mode (1:15)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "StrictEvalArguments" + }, + { + "$$ babel internal serialized type": "Error", + "message": "Binding 'eval' in strict mode (1:15)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "StrictEvalArgumentsBinding" + } ], "program": { "type": "Program", @@ -59,11 +71,11 @@ "value": { "type": "DirectiveLiteral", "start":0,"end":12,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":12}}, - "value": "use strict", "extra": { "raw": "\"use strict\"", "rawValue": "use strict" - } + }, + "value": "use strict" } } ] diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0088/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0088/output.json index 8e8d8419af7a..c4507e879b96 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 @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":24,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":24}}, "errors": [ - "SyntaxError: Binding 'eval' in strict mode (1:14)" + { + "$$ babel internal serialized type": "Error", + "message": "Binding 'eval' in strict mode (1:14)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "StrictEvalArgumentsBinding" + } ], "program": { "type": "Program", @@ -45,11 +51,11 @@ "value": { "type": "DirectiveLiteral", "start":0,"end":12,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":12}}, - "value": "use strict", "extra": { "raw": "\"use strict\"", "rawValue": "use strict" - } + }, + "value": "use strict" } } ] diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0089/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0089/output.json index 5a18ea14d881..4ad129e4818d 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 @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":29,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":29}}, "errors": [ - "SyntaxError: Binding 'arguments' in strict mode (1:14)" + { + "$$ babel internal serialized type": "Error", + "message": "Binding 'arguments' in strict mode (1:14)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "StrictEvalArgumentsBinding" + } ], "program": { "type": "Program", @@ -45,11 +51,11 @@ "value": { "type": "DirectiveLiteral", "start":0,"end":12,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":12}}, - "value": "use strict", "extra": { "raw": "\"use strict\"", "rawValue": "use strict" - } + }, + "value": "use strict" } } ] diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0090/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0090/output.json index c5a150d343ad..bdd2ce3e0b2a 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 @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":29,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":29}}, "errors": [ - "SyntaxError: Binding 'eval' in strict mode (1:15)" + { + "$$ babel internal serialized type": "Error", + "message": "Binding 'eval' in strict mode (1:15)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "StrictEvalArgumentsBinding" + } ], "program": { "type": "Program", @@ -50,11 +56,11 @@ "value": { "type": "DirectiveLiteral", "start":0,"end":12,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":12}}, - "value": "use strict", "extra": { "raw": "\"use strict\"", "rawValue": "use strict" - } + }, + "value": "use strict" } } ] diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0091/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0091/output.json index 402704e9deb8..52f5d278d5d9 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 @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":34,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":34}}, "errors": [ - "SyntaxError: Binding 'arguments' in strict mode (1:15)" + { + "$$ babel internal serialized type": "Error", + "message": "Binding 'arguments' in strict mode (1:15)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "StrictEvalArgumentsBinding" + } ], "program": { "type": "Program", @@ -50,11 +56,11 @@ "value": { "type": "DirectiveLiteral", "start":0,"end":12,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":12}}, - "value": "use strict", "extra": { "raw": "\"use strict\"", "rawValue": "use strict" - } + }, + "value": "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 4cfc4cd77e70..2f598d778ebc 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 @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":12,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":12}}, "errors": [ - "SyntaxError: Argument name clash (1:4)" + { + "$$ babel internal serialized type": "Error", + "message": "Argument name clash (1:4)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "ParamDupe" + } ], "program": { "type": "Program", 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 e552560189df..a7a0bf29dfd9 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 @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":26,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":26}}, "errors": [ - "SyntaxError: Argument name clash (1:18)" + { + "$$ babel internal serialized type": "Error", + "message": "Argument name clash (1:18)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "ParamDupe" + } ], "program": { "type": "Program", @@ -50,11 +56,11 @@ "value": { "type": "DirectiveLiteral", "start":0,"end":12,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":12}}, - "value": "use strict", "extra": { "raw": "\"use strict\"", "rawValue": "use strict" - } + }, + "value": "use strict" } } ] diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0094/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0094/output.json index 70812a59cc6a..ecc913951ae7 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 @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "Legacy octal literals are not allowed in strict mode (1:21)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "StrictOctalLiteral" + } ], "program": { "type": "Program", @@ -45,11 +51,11 @@ "value": { "type": "DirectiveLiteral", "start":0,"end":12,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":12}}, - "value": "use strict", "extra": { "raw": "\"use strict\"", "rawValue": "use strict" - } + }, + "value": "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 6b624a3ee404..d1c21b579eb8 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 @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "Binding invalid left-hand side in function parameter list (1:1)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "InvalidLhsBinding" + } ], "program": { "type": "Program", 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 06d87dffa42f..44dd5b3f0c28 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 @@ -2,8 +2,20 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "Binding invalid left-hand side in function parameter list (1:1)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "InvalidLhsBinding" + }, + { + "$$ babel internal serialized type": "Error", + "message": "Binding invalid left-hand side in function parameter list (1:5)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "InvalidLhsBinding" + } ], "program": { "type": "Program", 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 8515329a04e1..670bc9388a4b 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 @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":26,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":26}}, "errors": [ - "SyntaxError: Binding 'eval' in strict mode (1:15)" + { + "$$ babel internal serialized type": "Error", + "message": "Binding 'eval' in strict mode (1:15)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "StrictEvalArgumentsBinding" + } ], "program": { "type": "Program", @@ -45,11 +51,11 @@ "value": { "type": "DirectiveLiteral", "start":0,"end":12,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":12}}, - "value": "use strict", "extra": { "raw": "\"use strict\"", "rawValue": "use strict" - } + }, + "value": "use strict" } } ] diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0101/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0101/output.json index 16f6411a562b..2bcc358aad83 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 @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":30,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":30}}, "errors": [ - "SyntaxError: Binding 'eval' in strict mode (1:1)" + { + "$$ babel internal serialized type": "Error", + "message": "Binding 'eval' in strict mode (1:1)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "StrictEvalArgumentsBinding" + } ], "program": { "type": "Program", @@ -51,11 +57,11 @@ "value": { "type": "DirectiveLiteral", "start":12,"end":24,"loc":{"start":{"line":1,"column":12},"end":{"line":1,"column":24}}, - "value": "use strict", "extra": { "raw": "\"use strict\"", "rawValue": "use strict" - } + }, + "value": "use strict" } } ] diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0112/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0112/output.json index 9f46d8a53e92..87558f656a98 100644 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0112/output.json +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0112/output.json @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":4,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":4}}, "errors": [ - "SyntaxError: Missing semicolon (1:1)" + { + "$$ babel internal serialized type": "Error", + "message": "Missing semicolon (1:1)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "MissingSemicolon" + } ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0115/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0115/output.json index 3b44c2aa68d6..786c28259825 100644 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0115/output.json +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0115/output.json @@ -2,8 +2,20 @@ "type": "File", "start":0,"end":7,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":7}}, "errors": [ - "SyntaxError: Missing semicolon (1:1)", - "SyntaxError: Unexpected reserved word 'enum' (1:2)" + { + "$$ babel internal serialized type": "Error", + "message": "Missing semicolon (1:1)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "MissingSemicolon" + }, + { + "$$ babel internal serialized type": "Error", + "message": "Unexpected reserved word 'enum' (1:2)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "UnexpectedReservedWord" + } ], "program": { "type": "Program", 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 8ce94b960543..33a45a224d2e 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 @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":5,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":5}}, "errors": [ - "SyntaxError: Unsyntactic break (1:0)" + { + "$$ babel internal serialized type": "Error", + "message": "Unsyntactic break (1:0)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "IllegalBreakContinue" + } ], "program": { "type": "Program", 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 6d89822f1568..9f2f1645b5dc 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 @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":8,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":8}}, "errors": [ - "SyntaxError: Unsyntactic continue (1:0)" + { + "$$ babel internal serialized type": "Error", + "message": "Unsyntactic continue (1:0)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "IllegalBreakContinue" + } ], "program": { "type": "Program", 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 d3af5238b363..daaa3901b730 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 @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "Invalid left-hand side in for-in statement (1:5)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "InvalidLhs" + } ], "program": { "type": "Program", 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 a68f97021f5d..6f62438350f5 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 @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "Invalid left-hand side in for-in statement (1:5)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "InvalidLhs" + } ], "program": { "type": "Program", 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 a0bb1f5c08a4..91fd03d7a309 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 @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":7,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":7}}, "errors": [ - "SyntaxError: Missing catch or finally clause (1:0)" + { + "$$ babel internal serialized type": "Error", + "message": "Missing catch or finally clause (1:0)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "NoCatchOrFinally" + } ], "program": { "type": "Program", 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 8515bc8f1fb0..e8c5dcf74b90 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 @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":11,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":11}}, "errors": [ - "SyntaxError: Invalid Unicode escape (1:0)" + { + "$$ babel internal serialized type": "Error", + "message": "Invalid Unicode escape (1:0)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "EscapedCharNotAnIdentifier" + } ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0138/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0138/output.json index fdf1d3c3fc9b..ad877d725fff 100644 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0138/output.json +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0138/output.json @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":16,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":16}}, "errors": [ - "SyntaxError: Const declarations require an initialization value (1:15)" + { + "$$ babel internal serialized type": "Error", + "message": "Const declarations require an initialization value (1:15)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "DeclarationMissingInitializer" + } ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0139/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0139/output.json index e19f992ee2bb..687154bf1a90 100644 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0139/output.json +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0139/output.json @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":16,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":16}}, "errors": [ - "SyntaxError: Const declarations require an initialization value (1:7)" + { + "$$ babel internal serialized type": "Error", + "message": "Const declarations require an initialization value (1:7)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "DeclarationMissingInitializer" + } ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0140/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0140/output.json index 1ed957df3a9b..03eb0f159632 100644 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0140/output.json +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0140/output.json @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":8,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":8}}, "errors": [ - "SyntaxError: Const declarations require an initialization value (1:7)" + { + "$$ babel internal serialized type": "Error", + "message": "Const declarations require an initialization value (1:7)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "DeclarationMissingInitializer" + } ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0141/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0141/output.json index 607bb08d2cea..ea0799fdaece 100644 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0141/output.json +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0141/output.json @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":19,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":19}}, "errors": [ - "SyntaxError: Missing semicolon (1:12)" + { + "$$ babel internal serialized type": "Error", + "message": "Missing semicolon (1:12)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "MissingSemicolon" + } ], "program": { "type": "Program", 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 65a76ea528d1..fa2097abb09c 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 @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "Lexical declaration cannot appear in a single-statement context (1:9)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "UnexpectedLexicalDeclaration" + } ], "program": { "type": "Program", 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 322359217c2d..918923edd61b 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 @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":32,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":32}}, "errors": [ - "SyntaxError: Multiple default clauses (1:22)" + { + "$$ babel internal serialized type": "Error", + "message": "Multiple default clauses (1:22)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "MultipleDefaultsInSwitch" + } ], "program": { "type": "Program", 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 4e21f3ee7b93..c080a4aa4a00 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 @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":1,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":1}}, "errors": [ - "SyntaxError: Expecting Unicode escape sequence \\uXXXX (1:1)" + { + "$$ babel internal serialized type": "Error", + "message": "Expecting Unicode escape sequence \\uXXXX (1:1)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "MissingUnicodeEscape" + } ], "program": { "type": "Program", 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 6c34e22a0044..87613b902f6f 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 @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":6,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":6}}, "errors": [ - "SyntaxError: Invalid Unicode escape (1:0)" + { + "$$ babel internal serialized type": "Error", + "message": "Invalid Unicode escape (1:0)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "EscapedCharNotAnIdentifier" + } ], "program": { "type": "Program", 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 cc7b3b44d69e..8fd9ef4907d7 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 @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":2,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":2}}, "errors": [ - "SyntaxError: Expecting Unicode escape sequence \\uXXXX (1:1)" + { + "$$ babel internal serialized type": "Error", + "message": "Expecting Unicode escape sequence \\uXXXX (1:1)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "MissingUnicodeEscape" + } ], "program": { "type": "Program", 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 3af7d55ae127..0191407e6fd9 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 @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":6,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":6}}, "errors": [ - "SyntaxError: Invalid Unicode escape (1:0)" + { + "$$ babel internal serialized type": "Error", + "message": "Invalid Unicode escape (1:0)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "EscapedCharNotAnIdentifier" + } ], "program": { "type": "Program", 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 b79101954c7c..fc9d482269b7 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 @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":11,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":11}}, "errors": [ - "SyntaxError: Invalid Unicode escape (1:0)" + { + "$$ babel internal serialized type": "Error", + "message": "Invalid Unicode escape (1:0)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "EscapedCharNotAnIdentifier" + } ], "program": { "type": "Program", 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 88eefa8ba7ab..7bfa513b2f36 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 @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":11,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":11}}, "errors": [ - "SyntaxError: Invalid Unicode escape (1:0)" + { + "$$ babel internal serialized type": "Error", + "message": "Invalid Unicode escape (1:0)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "EscapedCharNotAnIdentifier" + } ], "program": { "type": "Program", 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 5875cb58be47..094a6bc338a8 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 @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":6,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":6}}, "errors": [ - "SyntaxError: 'return' outside of function (1:0)" + { + "$$ babel internal serialized type": "Error", + "message": "'return' outside of function (1:0)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "IllegalReturn" + } ], "program": { "type": "Program", 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 8ce94b960543..33a45a224d2e 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 @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":5,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":5}}, "errors": [ - "SyntaxError: Unsyntactic break (1:0)" + { + "$$ babel internal serialized type": "Error", + "message": "Unsyntactic break (1:0)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "IllegalBreakContinue" + } ], "program": { "type": "Program", 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 6d89822f1568..9f2f1645b5dc 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 @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":8,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":8}}, "errors": [ - "SyntaxError: Unsyntactic continue (1:0)" + { + "$$ babel internal serialized type": "Error", + "message": "Unsyntactic continue (1:0)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "IllegalBreakContinue" + } ], "program": { "type": "Program", 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 37451db0ed1b..e13c15c081e6 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 @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":33,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":33}}, "errors": [ - "SyntaxError: Unsyntactic continue (1:22)" + { + "$$ babel internal serialized type": "Error", + "message": "Unsyntactic continue (1:22)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "IllegalBreakContinue" + } ], "program": { "type": "Program", 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 ae9cb401dddc..e91e7dbb9529 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 @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":25,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":25}}, "errors": [ - "SyntaxError: Unsyntactic break (1:15)" + { + "$$ babel internal serialized type": "Error", + "message": "Unsyntactic break (1:15)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "IllegalBreakContinue" + } ], "program": { "type": "Program", 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 39c5663443fe..40b52bd4de23 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 @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":28,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":28}}, "errors": [ - "SyntaxError: Unsyntactic continue (1:15)" + { + "$$ babel internal serialized type": "Error", + "message": "Unsyntactic continue (1:15)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "IllegalBreakContinue" + } ], "program": { "type": "Program", 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 3939133b3b8a..fd411368ac52 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 @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":47,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":47}}, "errors": [ - "SyntaxError: Unsyntactic break (1:33)" + { + "$$ babel internal serialized type": "Error", + "message": "Unsyntactic break (1:33)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "IllegalBreakContinue" + } ], "program": { "type": "Program", @@ -31,6 +37,10 @@ "expression": { "type": "FunctionExpression", "start":19,"end":43,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":43}}, + "extra": { + "parenthesized": true, + "parenStart": 18 + }, "id": null, "generator": false, "async": false, @@ -50,10 +60,6 @@ } ], "directives": [] - }, - "extra": { - "parenthesized": true, - "parenStart": 18 } } } diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0179/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0179/output.json index d65c7f7da91a..d52d09b915ea 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 @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":50,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":50}}, "errors": [ - "SyntaxError: Unsyntactic continue (1:33)" + { + "$$ babel internal serialized type": "Error", + "message": "Unsyntactic continue (1:33)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "IllegalBreakContinue" + } ], "program": { "type": "Program", @@ -31,6 +37,10 @@ "expression": { "type": "FunctionExpression", "start":19,"end":46,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":46}}, + "extra": { + "parenthesized": true, + "parenStart": 18 + }, "id": null, "generator": false, "async": false, @@ -50,10 +60,6 @@ } ], "directives": [] - }, - "extra": { - "parenthesized": true, - "parenStart": 18 } } } diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0180/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0180/output.json index 336add4fe32c..861d573d9eb4 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 @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":45,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":45}}, "errors": [ - "SyntaxError: Unsyntactic break (1:33)" + { + "$$ babel internal serialized type": "Error", + "message": "Unsyntactic break (1:33)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "IllegalBreakContinue" + } ], "program": { "type": "Program", @@ -31,6 +37,10 @@ "expression": { "type": "FunctionExpression", "start":19,"end":41,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":41}}, + "extra": { + "parenthesized": true, + "parenStart": 18 + }, "id": null, "generator": false, "async": false, @@ -46,10 +56,6 @@ } ], "directives": [] - }, - "extra": { - "parenthesized": true, - "parenStart": 18 } } } diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0181/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0181/output.json index ac86039c659b..85b83d9157f1 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 @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":48,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":48}}, "errors": [ - "SyntaxError: Unsyntactic continue (1:33)" + { + "$$ babel internal serialized type": "Error", + "message": "Unsyntactic continue (1:33)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "IllegalBreakContinue" + } ], "program": { "type": "Program", @@ -31,6 +37,10 @@ "expression": { "type": "FunctionExpression", "start":19,"end":44,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":44}}, + "extra": { + "parenthesized": true, + "parenStart": 18 + }, "id": null, "generator": false, "async": false, @@ -46,10 +56,6 @@ } ], "directives": [] - }, - "extra": { - "parenthesized": true, - "parenStart": 18 } } } 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 815a430cb2b7..fa51ae23c01d 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 @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":39,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":39}}, "errors": [ - "SyntaxError: Label 'x' is already declared (1:18)" + { + "$$ babel internal serialized type": "Error", + "message": "Label 'x' is already declared (1:18)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "LabelRedeclaration" + } ], "program": { "type": "Program", 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 392c525509d1..a1cd57f28de0 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 @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "Deleting local variable in strict mode (1:29)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "StrictDelete" + } ], "program": { "type": "Program", @@ -16,6 +22,10 @@ "expression": { "type": "CallExpression", "start":1,"end":42,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":42}}, + "extra": { + "parenthesized": true, + "parenStart": 0 + }, "callee": { "type": "FunctionExpression", "start":1,"end":40,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":40}}, @@ -50,21 +60,17 @@ "value": { "type": "DirectiveLiteral", "start":15,"end":27,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":27}}, - "value": "use strict", "extra": { "raw": "'use strict'", "rawValue": "use strict" - } + }, + "value": "use strict" } } ] } }, - "arguments": [], - "extra": { - "parenthesized": true, - "parenStart": 0 - } + "arguments": [] } } ], 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 62cf67d34e04..370aef7f7336 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 @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":43,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":43}}, "errors": [ - "SyntaxError: 'with' in strict mode (1:29)" + { + "$$ babel internal serialized type": "Error", + "message": "'with' in strict mode (1:29)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "StrictWith" + } ], "program": { "type": "Program", @@ -16,6 +22,10 @@ "expression": { "type": "CallExpression", "start":1,"end":42,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":42}}, + "extra": { + "parenthesized": true, + "parenStart": 0 + }, "callee": { "type": "FunctionExpression", "start":1,"end":40,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":40}}, @@ -48,21 +58,17 @@ "value": { "type": "DirectiveLiteral", "start":15,"end":27,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":27}}, - "value": "use strict", "extra": { "raw": "'use strict'", "rawValue": "use strict" - } + }, + "value": "use strict" } } ] } }, - "arguments": [], - "extra": { - "parenthesized": true, - "parenStart": 0 - } + "arguments": [] } } ], 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 fcd0ab9858ca..730f76e76dce 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 @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":48,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":48}}, "errors": [ - "SyntaxError: Binding 'eval' in strict mode (1:36)" + { + "$$ babel internal serialized type": "Error", + "message": "Binding 'eval' in strict mode (1:36)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "StrictEvalArgumentsBinding" + } ], "program": { "type": "Program", @@ -58,11 +64,11 @@ "value": { "type": "DirectiveLiteral", "start":18,"end":30,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":30}}, - "value": "use strict", "extra": { "raw": "'use strict'", "rawValue": "use strict" - } + }, + "value": "use strict" } } ] diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0186/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0186/output.json index d557326e9973..ff64c7206235 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 @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":53,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":53}}, "errors": [ - "SyntaxError: Binding 'arguments' in strict mode (1:36)" + { + "$$ babel internal serialized type": "Error", + "message": "Binding 'arguments' in strict mode (1:36)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "StrictEvalArgumentsBinding" + } ], "program": { "type": "Program", @@ -58,11 +64,11 @@ "value": { "type": "DirectiveLiteral", "start":18,"end":30,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":30}}, - "value": "use strict", "extra": { "raw": "'use strict'", "rawValue": "use strict" - } + }, + "value": "use strict" } } ] diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0187/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0187/output.json index 3040718fd546..f68377b17ee1 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 @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":58,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":58}}, "errors": [ - "SyntaxError: Binding 'eval' in strict mode (1:47)" + { + "$$ babel internal serialized type": "Error", + "message": "Binding 'eval' in strict mode (1:47)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "StrictEvalArgumentsBinding" + } ], "program": { "type": "Program", @@ -59,11 +65,11 @@ "value": { "type": "DirectiveLiteral", "start":18,"end":30,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":30}}, - "value": "use strict", "extra": { "raw": "'use strict'", "rawValue": "use strict" - } + }, + "value": "use strict" } } ] diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0188/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0188/output.json index 429d686ed48c..1131bf5961bb 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 @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":63,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":63}}, "errors": [ - "SyntaxError: Binding 'arguments' in strict mode (1:47)" + { + "$$ babel internal serialized type": "Error", + "message": "Binding 'arguments' in strict mode (1:47)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "StrictEvalArgumentsBinding" + } ], "program": { "type": "Program", @@ -59,11 +65,11 @@ "value": { "type": "DirectiveLiteral", "start":18,"end":30,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":30}}, - "value": "use strict", "extra": { "raw": "'use strict'", "rawValue": "use strict" - } + }, + "value": "use strict" } } ] diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0189/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0189/output.json index 79c71ebb542f..cd27d905217b 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 @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "Assigning to 'eval' in strict mode (1:32)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "StrictEvalArguments" + } ], "program": { "type": "Program", @@ -56,11 +62,11 @@ "value": { "type": "DirectiveLiteral", "start":18,"end":30,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":30}}, - "value": "use strict", "extra": { "raw": "'use strict'", "rawValue": "use strict" - } + }, + "value": "use strict" } } ] diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0190/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0190/output.json index ec34fa9d5ce8..c7266f60979d 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 @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "Assigning to 'arguments' in strict mode (1:32)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "StrictEvalArguments" + } ], "program": { "type": "Program", @@ -56,11 +62,11 @@ "value": { "type": "DirectiveLiteral", "start":18,"end":30,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":30}}, - "value": "use strict", "extra": { "raw": "'use strict'", "rawValue": "use strict" - } + }, + "value": "use strict" } } ] diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0191/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0191/output.json index 2ad942222305..7ebbee87cea4 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 @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "Assigning to 'eval' in strict mode (1:34)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "StrictEvalArguments" + } ], "program": { "type": "Program", @@ -48,11 +54,11 @@ "value": { "type": "DirectiveLiteral", "start":18,"end":30,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":30}}, - "value": "use strict", "extra": { "raw": "'use strict'", "rawValue": "use strict" - } + }, + "value": "use strict" } } ] diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0192/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0192/output.json index c85c53c215da..1215cb9894dd 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 @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "Assigning to 'eval' in strict mode (1:34)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "StrictEvalArguments" + } ], "program": { "type": "Program", @@ -48,11 +54,11 @@ "value": { "type": "DirectiveLiteral", "start":18,"end":30,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":30}}, - "value": "use strict", "extra": { "raw": "'use strict'", "rawValue": "use strict" - } + }, + "value": "use strict" } } ] diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0193/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0193/output.json index 8635017ed5c5..50d0e4da1906 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 @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "Assigning to 'arguments' in strict mode (1:34)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "StrictEvalArguments" + } ], "program": { "type": "Program", @@ -48,11 +54,11 @@ "value": { "type": "DirectiveLiteral", "start":18,"end":30,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":30}}, - "value": "use strict", "extra": { "raw": "'use strict'", "rawValue": "use strict" - } + }, + "value": "use strict" } } ] diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0194/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0194/output.json index 0090b6011203..6c2748a1a843 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 @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "Assigning to 'arguments' in strict mode (1:34)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "StrictEvalArguments" + } ], "program": { "type": "Program", @@ -48,11 +54,11 @@ "value": { "type": "DirectiveLiteral", "start":18,"end":30,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":30}}, - "value": "use strict", "extra": { "raw": "'use strict'", "rawValue": "use strict" - } + }, + "value": "use strict" } } ] diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0195/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0195/output.json index 439436ef7e82..774554855544 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 @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "Assigning to 'eval' in strict mode (1:32)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "StrictEvalArguments" + } ], "program": { "type": "Program", @@ -48,11 +54,11 @@ "value": { "type": "DirectiveLiteral", "start":18,"end":30,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":30}}, - "value": "use strict", "extra": { "raw": "'use strict'", "rawValue": "use strict" - } + }, + "value": "use strict" } } ] diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0196/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0196/output.json index b68c731a58a7..0620f374261e 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 @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "Assigning to 'eval' in strict mode (1:32)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "StrictEvalArguments" + } ], "program": { "type": "Program", @@ -48,11 +54,11 @@ "value": { "type": "DirectiveLiteral", "start":18,"end":30,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":30}}, - "value": "use strict", "extra": { "raw": "'use strict'", "rawValue": "use strict" - } + }, + "value": "use strict" } } ] diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0197/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0197/output.json index 52dbdc3d5ca5..9b7b4c72c4f7 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 @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "Assigning to 'arguments' in strict mode (1:32)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "StrictEvalArguments" + } ], "program": { "type": "Program", @@ -48,11 +54,11 @@ "value": { "type": "DirectiveLiteral", "start":18,"end":30,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":30}}, - "value": "use strict", "extra": { "raw": "'use strict'", "rawValue": "use strict" - } + }, + "value": "use strict" } } ] diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0198/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0198/output.json index 48c2df5468eb..c18db72610c3 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 @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "Assigning to 'arguments' in strict mode (1:32)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "StrictEvalArguments" + } ], "program": { "type": "Program", @@ -48,11 +54,11 @@ "value": { "type": "DirectiveLiteral", "start":18,"end":30,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":30}}, - "value": "use strict", "extra": { "raw": "'use strict'", "rawValue": "use strict" - } + }, + "value": "use strict" } } ] diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0199/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0199/output.json index 3c4ac7fd38dd..ab49aba8f4f6 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 @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":53,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":53}}, "errors": [ - "SyntaxError: Binding 'eval' in strict mode (1:41)" + { + "$$ babel internal serialized type": "Error", + "message": "Binding 'eval' in strict mode (1:41)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "StrictEvalArgumentsBinding" + } ], "program": { "type": "Program", @@ -51,11 +57,11 @@ "value": { "type": "DirectiveLiteral", "start":18,"end":30,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":30}}, - "value": "use strict", "extra": { "raw": "'use strict'", "rawValue": "use strict" - } + }, + "value": "use strict" } } ] diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0200/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0200/output.json index e183294a232f..9e27051a9a6a 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 @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":58,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":58}}, "errors": [ - "SyntaxError: Binding 'arguments' in strict mode (1:41)" + { + "$$ babel internal serialized type": "Error", + "message": "Binding 'arguments' in strict mode (1:41)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "StrictEvalArgumentsBinding" + } ], "program": { "type": "Program", @@ -51,11 +57,11 @@ "value": { "type": "DirectiveLiteral", "start":18,"end":30,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":30}}, - "value": "use strict", "extra": { "raw": "'use strict'", "rawValue": "use strict" - } + }, + "value": "use strict" } } ] diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0201/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0201/output.json index c252adad5c36..4425ab5ebcb4 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 @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":32,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":32}}, "errors": [ - "SyntaxError: Binding 'eval' in strict mode (1:9)" + { + "$$ babel internal serialized type": "Error", + "message": "Binding 'eval' in strict mode (1:9)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "StrictEvalArgumentsBinding" + } ], "program": { "type": "Program", @@ -32,11 +38,11 @@ "value": { "type": "DirectiveLiteral", "start":17,"end":29,"loc":{"start":{"line":1,"column":17},"end":{"line":1,"column":29}}, - "value": "use strict", "extra": { "raw": "'use strict'", "rawValue": "use strict" - } + }, + "value": "use strict" } } ] diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0202/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0202/output.json index 2c691b4f70f1..9fbf885c95dd 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 @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":37,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":37}}, "errors": [ - "SyntaxError: Binding 'arguments' in strict mode (1:9)" + { + "$$ babel internal serialized type": "Error", + "message": "Binding 'arguments' in strict mode (1:9)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "StrictEvalArgumentsBinding" + } ], "program": { "type": "Program", @@ -32,11 +38,11 @@ "value": { "type": "DirectiveLiteral", "start":22,"end":34,"loc":{"start":{"line":1,"column":22},"end":{"line":1,"column":34}}, - "value": "use strict", "extra": { "raw": "'use strict'", "rawValue": "use strict" - } + }, + "value": "use strict" } } ] diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0203/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0203/output.json index 9e3046fe279b..e95d1ad02518 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 @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":57,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":57}}, "errors": [ - "SyntaxError: Binding 'eval' in strict mode (1:42)" + { + "$$ babel internal serialized type": "Error", + "message": "Binding 'eval' in strict mode (1:42)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "StrictEvalArgumentsBinding" + } ], "program": { "type": "Program", @@ -31,6 +37,10 @@ "expression": { "type": "CallExpression", "start":33,"end":54,"loc":{"start":{"line":1,"column":33},"end":{"line":1,"column":54}}, + "extra": { + "parenthesized": true, + "parenStart": 32 + }, "callee": { "type": "FunctionExpression", "start":33,"end":52,"loc":{"start":{"line":1,"column":33},"end":{"line":1,"column":52}}, @@ -49,11 +59,7 @@ "directives": [] } }, - "arguments": [], - "extra": { - "parenthesized": true, - "parenStart": 32 - } + "arguments": [] } } ], @@ -64,11 +70,11 @@ "value": { "type": "DirectiveLiteral", "start":18,"end":30,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":30}}, - "value": "use strict", "extra": { "raw": "'use strict'", "rawValue": "use strict" - } + }, + "value": "use strict" } } ] diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0204/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0204/output.json index 2502c52e184c..166aadd11830 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 @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":62,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":62}}, "errors": [ - "SyntaxError: Binding 'arguments' in strict mode (1:42)" + { + "$$ babel internal serialized type": "Error", + "message": "Binding 'arguments' in strict mode (1:42)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "StrictEvalArgumentsBinding" + } ], "program": { "type": "Program", @@ -31,6 +37,10 @@ "expression": { "type": "CallExpression", "start":33,"end":59,"loc":{"start":{"line":1,"column":33},"end":{"line":1,"column":59}}, + "extra": { + "parenthesized": true, + "parenStart": 32 + }, "callee": { "type": "FunctionExpression", "start":33,"end":57,"loc":{"start":{"line":1,"column":33},"end":{"line":1,"column":57}}, @@ -49,11 +59,7 @@ "directives": [] } }, - "arguments": [], - "extra": { - "parenthesized": true, - "parenStart": 32 - } + "arguments": [] } } ], @@ -64,11 +70,11 @@ "value": { "type": "DirectiveLiteral", "start":18,"end":30,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":30}}, - "value": "use strict", "extra": { "raw": "'use strict'", "rawValue": "use strict" - } + }, + "value": "use strict" } } ] diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0205/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0205/output.json index 887c41149531..0605fbb60469 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 @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":36,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":36}}, "errors": [ - "SyntaxError: Binding 'eval' in strict mode (1:10)" + { + "$$ babel internal serialized type": "Error", + "message": "Binding 'eval' in strict mode (1:10)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "StrictEvalArgumentsBinding" + } ], "program": { "type": "Program", @@ -19,6 +25,10 @@ "callee": { "type": "FunctionExpression", "start":1,"end":33,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":33}}, + "extra": { + "parenthesized": true, + "parenStart": 0 + }, "id": { "type": "Identifier", "start":10,"end":14,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":14},"identifierName":"eval"}, @@ -38,18 +48,14 @@ "value": { "type": "DirectiveLiteral", "start":18,"end":30,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":30}}, - "value": "use strict", "extra": { "raw": "'use strict'", "rawValue": "use strict" - } + }, + "value": "use strict" } } ] - }, - "extra": { - "parenthesized": true, - "parenStart": 0 } }, "arguments": [] diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0206/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0206/output.json index 250afef7d81d..0e2a1293a397 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 @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":41,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":41}}, "errors": [ - "SyntaxError: Binding 'arguments' in strict mode (1:10)" + { + "$$ babel internal serialized type": "Error", + "message": "Binding 'arguments' in strict mode (1:10)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "StrictEvalArgumentsBinding" + } ], "program": { "type": "Program", @@ -19,6 +25,10 @@ "callee": { "type": "FunctionExpression", "start":1,"end":38,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":38}}, + "extra": { + "parenthesized": true, + "parenStart": 0 + }, "id": { "type": "Identifier", "start":10,"end":19,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":19},"identifierName":"arguments"}, @@ -38,18 +48,14 @@ "value": { "type": "DirectiveLiteral", "start":23,"end":35,"loc":{"start":{"line":1,"column":23},"end":{"line":1,"column":35}}, - "value": "use strict", "extra": { "raw": "'use strict'", "rawValue": "use strict" - } + }, + "value": "use strict" } } ] - }, - "extra": { - "parenthesized": true, - "parenStart": 0 } }, "arguments": [] diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0207/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0207/output.json index 03985eff0b57..4a30886ce75a 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 @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":63,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":63}}, "errors": [ - "SyntaxError: Binding 'eval' in strict mode (1:47)" + { + "$$ babel internal serialized type": "Error", + "message": "Binding 'eval' in strict mode (1:47)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "StrictEvalArgumentsBinding" + } ], "program": { "type": "Program", @@ -31,6 +37,10 @@ "expression": { "type": "ObjectExpression", "start":33,"end":59,"loc":{"start":{"line":1,"column":33},"end":{"line":1,"column":59}}, + "extra": { + "parenthesized": true, + "parenStart": 32 + }, "properties": [ { "type": "ObjectProperty", @@ -62,11 +72,7 @@ } } } - ], - "extra": { - "parenthesized": true, - "parenStart": 32 - } + ] } } ], @@ -77,11 +83,11 @@ "value": { "type": "DirectiveLiteral", "start":18,"end":30,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":30}}, - "value": "use strict", "extra": { "raw": "'use strict'", "rawValue": "use strict" - } + }, + "value": "use strict" } } ] diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0208/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0208/output.json index 29ce013f0b8b..fedd7d72d685 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 @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":39,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":39}}, "errors": [ - "SyntaxError: Binding 'package' in strict mode (1:10)" + { + "$$ babel internal serialized type": "Error", + "message": "Binding 'package' in strict mode (1:10)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "StrictEvalArgumentsBinding" + } ], "program": { "type": "Program", @@ -19,6 +25,10 @@ "callee": { "type": "FunctionExpression", "start":1,"end":36,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":36}}, + "extra": { + "parenthesized": true, + "parenStart": 0 + }, "id": { "type": "Identifier", "start":10,"end":17,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":17},"identifierName":"package"}, @@ -38,18 +48,14 @@ "value": { "type": "DirectiveLiteral", "start":21,"end":33,"loc":{"start":{"line":1,"column":21},"end":{"line":1,"column":33}}, - "value": "use strict", "extra": { "raw": "'use strict'", "rawValue": "use strict" - } + }, + "value": "use strict" } } ] - }, - "extra": { - "parenthesized": true, - "parenStart": 0 } }, "arguments": [] diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0209/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0209/output.json index 60d4df26f9f4..67e9140a9559 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 @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":63,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":63}}, "errors": [ - "SyntaxError: Binding 'eval' in strict mode (1:48)" + { + "$$ babel internal serialized type": "Error", + "message": "Binding 'eval' in strict mode (1:48)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "StrictEvalArgumentsBinding" + } ], "program": { "type": "Program", @@ -31,6 +37,10 @@ "expression": { "type": "ObjectExpression", "start":33,"end":59,"loc":{"start":{"line":1,"column":33},"end":{"line":1,"column":59}}, + "extra": { + "parenthesized": true, + "parenStart": 32 + }, "properties": [ { "type": "ObjectProperty", @@ -81,11 +91,7 @@ "directives": [] } } - ], - "extra": { - "parenthesized": true, - "parenStart": 32 - } + ] } } ], @@ -96,11 +102,11 @@ "value": { "type": "DirectiveLiteral", "start":18,"end":30,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":30}}, - "value": "use strict", "extra": { "raw": "'use strict'", "rawValue": "use strict" - } + }, + "value": "use strict" } } ] diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0210/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0210/output.json index 4ee83b14028e..a8358afcb239 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 @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":56,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":56}}, "errors": [ - "SyntaxError: Binding 'eval' in strict mode (1:41)" + { + "$$ babel internal serialized type": "Error", + "message": "Binding 'eval' in strict mode (1:41)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "StrictEvalArgumentsBinding" + } ], "program": { "type": "Program", @@ -31,6 +37,10 @@ "expression": { "type": "ObjectExpression", "start":33,"end":52,"loc":{"start":{"line":1,"column":33},"end":{"line":1,"column":52}}, + "extra": { + "parenthesized": true, + "parenStart": 32 + }, "properties": [ { "type": "ObjectMethod", @@ -60,11 +70,7 @@ "directives": [] } } - ], - "extra": { - "parenthesized": true, - "parenStart": 32 - } + ] } } ], @@ -75,11 +81,11 @@ "value": { "type": "DirectiveLiteral", "start":18,"end":30,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":30}}, - "value": "use strict", "extra": { "raw": "'use strict'", "rawValue": "use strict" - } + }, + "value": "use strict" } } ] diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0211/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0211/output.json index 0c8905156ab1..678ac30f9002 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 @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":64,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":64}}, "errors": [ - "SyntaxError: Binding 'eval' in strict mode (1:49)" + { + "$$ babel internal serialized type": "Error", + "message": "Binding 'eval' in strict mode (1:49)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "StrictEvalArgumentsBinding" + } ], "program": { "type": "Program", @@ -31,6 +37,10 @@ "expression": { "type": "ObjectExpression", "start":33,"end":60,"loc":{"start":{"line":1,"column":33},"end":{"line":1,"column":60}}, + "extra": { + "parenthesized": true, + "parenStart": 32 + }, "properties": [ { "type": "ObjectProperty", @@ -68,11 +78,7 @@ } } } - ], - "extra": { - "parenthesized": true, - "parenStart": 32 - } + ] } } ], @@ -83,11 +89,11 @@ "value": { "type": "DirectiveLiteral", "start":18,"end":30,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":30}}, - "value": "use strict", "extra": { "raw": "'use strict'", "rawValue": "use strict" - } + }, + "value": "use strict" } } ] diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0212/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0212/output.json index 3ccaace1b183..32924b7bda1c 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 @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":36,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":36}}, "errors": [ - "SyntaxError: Binding 'eval' in strict mode (1:15)" + { + "$$ babel internal serialized type": "Error", + "message": "Binding 'eval' in strict mode (1:15)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "StrictEvalArgumentsBinding" + } ], "program": { "type": "Program", @@ -38,11 +44,11 @@ "value": { "type": "DirectiveLiteral", "start":22,"end":34,"loc":{"start":{"line":1,"column":22},"end":{"line":1,"column":34}}, - "value": "use strict", "extra": { "raw": "'use strict'", "rawValue": "use strict" - } + }, + "value": "use strict" } } ] diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0213/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0213/output.json index dc142e76101d..f0feb545fff1 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 @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":41,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":41}}, "errors": [ - "SyntaxError: Binding 'arguments' in strict mode (1:15)" + { + "$$ babel internal serialized type": "Error", + "message": "Binding 'arguments' in strict mode (1:15)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "StrictEvalArgumentsBinding" + } ], "program": { "type": "Program", @@ -38,11 +44,11 @@ "value": { "type": "DirectiveLiteral", "start":27,"end":39,"loc":{"start":{"line":1,"column":27},"end":{"line":1,"column":39}}, - "value": "use strict", "extra": { "raw": "'use strict'", "rawValue": "use strict" - } + }, + "value": "use strict" } } ] diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0214/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0214/output.json index d887db53f5e6..2056b8a15d11 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 @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":58,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":58}}, "errors": [ - "SyntaxError: Binding 'eval' in strict mode (1:48)" + { + "$$ babel internal serialized type": "Error", + "message": "Binding 'eval' in strict mode (1:48)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "StrictEvalArgumentsBinding" + } ], "program": { "type": "Program", @@ -57,11 +63,11 @@ "value": { "type": "DirectiveLiteral", "start":19,"end":31,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":31}}, - "value": "use strict", "extra": { "raw": "'use strict'", "rawValue": "use strict" - } + }, + "value": "use strict" } } ] diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0215/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0215/output.json index ded181413784..12bda957fb2a 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 @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":63,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":63}}, "errors": [ - "SyntaxError: Binding 'arguments' in strict mode (1:48)" + { + "$$ babel internal serialized type": "Error", + "message": "Binding 'arguments' in strict mode (1:48)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "StrictEvalArgumentsBinding" + } ], "program": { "type": "Program", @@ -57,11 +63,11 @@ "value": { "type": "DirectiveLiteral", "start":19,"end":31,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":31}}, - "value": "use strict", "extra": { "raw": "'use strict'", "rawValue": "use strict" - } + }, + "value": "use strict" } } ] diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0216/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0216/output.json index fa26c140fe1d..d52433d82d15 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 @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":19,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":19}}, "errors": [ - "SyntaxError: The only valid numeric escape in strict mode is '\\0' (1:2)" + { + "$$ babel internal serialized type": "Error", + "message": "The only valid numeric escape in strict mode is '\\0' (1:2)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "StrictNumericEscape" + } ], "program": { "type": "Program", 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 66906dba7f5c..69bfbf6bd852 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 @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":40,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":40}}, "errors": [ - "SyntaxError: The only valid numeric escape in strict mode is '\\0' (1:35)" + { + "$$ babel internal serialized type": "Error", + "message": "The only valid numeric escape in strict mode is '\\0' (1:35)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "StrictNumericEscape" + } ], "program": { "type": "Program", 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 f4096149d8ed..90e5584d4060 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 @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "Legacy octal literals are not allowed in strict mode (1:33)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "StrictOctalLiteral" + } ], "program": { "type": "Program", @@ -46,11 +52,11 @@ "value": { "type": "DirectiveLiteral", "start":19,"end":31,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":31}}, - "value": "use strict", "extra": { "raw": "'use strict'", "rawValue": "use strict" - } + }, + "value": "use strict" } } ] diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0219/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0219/output.json index 0491546b1a61..32b4154127e1 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 @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":50,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":50}}, "errors": [ - "SyntaxError: The only valid numeric escape in strict mode is '\\0' (1:38)" + { + "$$ babel internal serialized type": "Error", + "message": "The only valid numeric escape in strict mode is '\\0' (1:38)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "StrictNumericEscape" + } ], "program": { "type": "Program", @@ -31,6 +37,10 @@ "expression": { "type": "ObjectExpression", "start":34,"end":46,"loc":{"start":{"line":1,"column":34},"end":{"line":1,"column":46}}, + "extra": { + "parenthesized": true, + "parenStart": 33 + }, "properties": [ { "type": "ObjectProperty", @@ -57,11 +67,7 @@ "value": 42 } } - ], - "extra": { - "parenthesized": true, - "parenStart": 33 - } + ] } } ], @@ -72,11 +78,11 @@ "value": { "type": "DirectiveLiteral", "start":19,"end":31,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":31}}, - "value": "use strict", "extra": { "raw": "'use strict'", "rawValue": "use strict" - } + }, + "value": "use strict" } } ] diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0220/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0220/output.json index 8caf22da60fa..7eb4eb85861d 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 @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "Legacy octal literals are not allowed in strict mode (1:36)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "StrictOctalLiteral" + } ], "program": { "type": "Program", @@ -31,6 +37,10 @@ "expression": { "type": "ObjectExpression", "start":34,"end":45,"loc":{"start":{"line":1,"column":34},"end":{"line":1,"column":45}}, + "extra": { + "parenthesized": true, + "parenStart": 33 + }, "properties": [ { "type": "ObjectProperty", @@ -57,11 +67,7 @@ "value": 42 } } - ], - "extra": { - "parenthesized": true, - "parenStart": 33 - } + ] } } ], @@ -72,11 +78,11 @@ "value": { "type": "DirectiveLiteral", "start":19,"end":31,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":31}}, - "value": "use strict", "extra": { "raw": "'use strict'", "rawValue": "use strict" - } + }, + "value": "use strict" } } ] diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0221/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0221/output.json index d0760f1b380e..dfee40ac292d 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 @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":55,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":55}}, "errors": [ - "SyntaxError: The only valid numeric escape in strict mode is '\\0' (1:36)" + { + "$$ babel internal serialized type": "Error", + "message": "The only valid numeric escape in strict mode is '\\0' (1:36)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "StrictNumericEscape" + } ], "program": { "type": "Program", 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 2ed529ae45ad..50f45ecc2f44 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 @@ -2,8 +2,20 @@ "type": "File", "start":0,"end":76,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":76}}, "errors": [ - "SyntaxError: The only valid numeric escape in strict mode is '\\0' (1:36)", - "SyntaxError: The only valid numeric escape in strict mode is '\\0' (1:57)" + { + "$$ babel internal serialized type": "Error", + "message": "The only valid numeric escape in strict mode is '\\0' (1:36)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "StrictNumericEscape" + }, + { + "$$ babel internal serialized type": "Error", + "message": "The only valid numeric escape in strict mode is '\\0' (1:57)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "StrictNumericEscape" + } ], "program": { "type": "Program", 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 2c6c0e03d277..975cd93b7928 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 @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":76,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":76}}, "errors": [ - "SyntaxError: The only valid numeric escape in strict mode is '\\0' (1:69)" + { + "$$ babel internal serialized type": "Error", + "message": "The only valid numeric escape in strict mode is '\\0' (1:69)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "StrictNumericEscape" + } ], "program": { "type": "Program", @@ -47,11 +53,11 @@ "value": { "type": "DirectiveLiteral", "start":52,"end":71,"loc":{"start":{"line":1,"column":52},"end":{"line":1,"column":71}}, - "value": "octal directive\\1", "extra": { "raw": "\"octal directive\\1\"", "rawValue": "octal directive\\1" - } + }, + "value": "octal directive\\1" } } ] @@ -65,11 +71,11 @@ "value": { "type": "DirectiveLiteral", "start":19,"end":31,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":31}}, - "value": "use strict", "extra": { "raw": "\"use strict\"", "rawValue": "use strict" - } + }, + "value": "use strict" } } ] diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0224/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0224/output.json index a3eee1ca1117..b1182be3183e 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 @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":50,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":50}}, "errors": [ - "SyntaxError: Unexpected reserved word 'implements' (1:37)" + { + "$$ babel internal serialized type": "Error", + "message": "Unexpected reserved word 'implements' (1:37)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "UnexpectedReservedWord" + } ], "program": { "type": "Program", @@ -50,11 +56,11 @@ "value": { "type": "DirectiveLiteral", "start":19,"end":31,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":31}}, - "value": "use strict", "extra": { "raw": "\"use strict\"", "rawValue": "use strict" - } + }, + "value": "use strict" } } ] diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0225/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0225/output.json index cffcb241d435..c07d768b3294 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 @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":49,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":49}}, "errors": [ - "SyntaxError: Unexpected reserved word 'interface' (1:37)" + { + "$$ babel internal serialized type": "Error", + "message": "Unexpected reserved word 'interface' (1:37)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "UnexpectedReservedWord" + } ], "program": { "type": "Program", @@ -50,11 +56,11 @@ "value": { "type": "DirectiveLiteral", "start":19,"end":31,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":31}}, - "value": "use strict", "extra": { "raw": "\"use strict\"", "rawValue": "use strict" - } + }, + "value": "use strict" } } ] diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0226/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0226/output.json index 3d7bd0ac8ee4..2d4cfe81a876 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 @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":47,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":47}}, "errors": [ - "SyntaxError: Unexpected reserved word 'package' (1:37)" + { + "$$ babel internal serialized type": "Error", + "message": "Unexpected reserved word 'package' (1:37)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "UnexpectedReservedWord" + } ], "program": { "type": "Program", @@ -50,11 +56,11 @@ "value": { "type": "DirectiveLiteral", "start":19,"end":31,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":31}}, - "value": "use strict", "extra": { "raw": "\"use strict\"", "rawValue": "use strict" - } + }, + "value": "use strict" } } ] diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0227/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0227/output.json index 4c1f2d2844f0..113617944c91 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 @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":47,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":47}}, "errors": [ - "SyntaxError: Unexpected reserved word 'private' (1:37)" + { + "$$ babel internal serialized type": "Error", + "message": "Unexpected reserved word 'private' (1:37)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "UnexpectedReservedWord" + } ], "program": { "type": "Program", @@ -50,11 +56,11 @@ "value": { "type": "DirectiveLiteral", "start":19,"end":31,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":31}}, - "value": "use strict", "extra": { "raw": "\"use strict\"", "rawValue": "use strict" - } + }, + "value": "use strict" } } ] diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0228/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0228/output.json index dcf994402ae1..ae5ff7d0d042 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 @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":49,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":49}}, "errors": [ - "SyntaxError: Unexpected reserved word 'protected' (1:37)" + { + "$$ babel internal serialized type": "Error", + "message": "Unexpected reserved word 'protected' (1:37)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "UnexpectedReservedWord" + } ], "program": { "type": "Program", @@ -50,11 +56,11 @@ "value": { "type": "DirectiveLiteral", "start":19,"end":31,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":31}}, - "value": "use strict", "extra": { "raw": "\"use strict\"", "rawValue": "use strict" - } + }, + "value": "use strict" } } ] diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0229/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0229/output.json index c7306ecdb68b..023c1501d5dc 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 @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":46,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":46}}, "errors": [ - "SyntaxError: Unexpected reserved word 'public' (1:37)" + { + "$$ babel internal serialized type": "Error", + "message": "Unexpected reserved word 'public' (1:37)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "UnexpectedReservedWord" + } ], "program": { "type": "Program", @@ -50,11 +56,11 @@ "value": { "type": "DirectiveLiteral", "start":19,"end":31,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":31}}, - "value": "use strict", "extra": { "raw": "\"use strict\"", "rawValue": "use strict" - } + }, + "value": "use strict" } } ] diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0230/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0230/output.json index 41fd57994528..8eb41708d573 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 @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":46,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":46}}, "errors": [ - "SyntaxError: Unexpected reserved word 'static' (1:37)" + { + "$$ babel internal serialized type": "Error", + "message": "Unexpected reserved word 'static' (1:37)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "UnexpectedReservedWord" + } ], "program": { "type": "Program", @@ -50,11 +56,11 @@ "value": { "type": "DirectiveLiteral", "start":19,"end":31,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":31}}, - "value": "use strict", "extra": { "raw": "\"use strict\"", "rawValue": "use strict" - } + }, + "value": "use strict" } } ] diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0231/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0231/output.json index 52018c7cba22..197d8a2dd22a 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 @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":45,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":45}}, "errors": [ - "SyntaxError: Unexpected reserved word 'yield' (1:37)" + { + "$$ babel internal serialized type": "Error", + "message": "Unexpected reserved word 'yield' (1:37)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "UnexpectedReservedWord" + } ], "program": { "type": "Program", @@ -50,11 +56,11 @@ "value": { "type": "DirectiveLiteral", "start":19,"end":31,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":31}}, - "value": "use strict", "extra": { "raw": "\"use strict\"", "rawValue": "use strict" - } + }, + "value": "use strict" } } ] diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0232/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0232/output.json index d714b3e28e2e..2c7972339212 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 @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":43,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":43}}, "errors": [ - "SyntaxError: Unexpected reserved word 'let' (1:37)" + { + "$$ babel internal serialized type": "Error", + "message": "Unexpected reserved word 'let' (1:37)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "UnexpectedReservedWord" + } ], "program": { "type": "Program", @@ -50,11 +56,11 @@ "value": { "type": "DirectiveLiteral", "start":19,"end":31,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":31}}, - "value": "use strict", "extra": { "raw": "\"use strict\"", "rawValue": "use strict" - } + }, + "value": "use strict" } } ] diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0233/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0233/output.json index 160544579047..5fe2e44483eb 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 @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":40,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":40}}, "errors": [ - "SyntaxError: Binding 'static' in strict mode (1:15)" + { + "$$ babel internal serialized type": "Error", + "message": "Binding 'static' in strict mode (1:15)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "StrictEvalArgumentsBinding" + } ], "program": { "type": "Program", @@ -38,11 +44,11 @@ "value": { "type": "DirectiveLiteral", "start":25,"end":37,"loc":{"start":{"line":1,"column":25},"end":{"line":1,"column":37}}, - "value": "use strict", "extra": { "raw": "\"use strict\"", "rawValue": "use strict" - } + }, + "value": "use strict" } } ] diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0234/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0234/output.json index b184d5881724..36e6fdf31558 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 @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":35,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":35}}, "errors": [ - "SyntaxError: Binding 'static' in strict mode (1:9)" + { + "$$ babel internal serialized type": "Error", + "message": "Binding 'static' in strict mode (1:9)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "StrictEvalArgumentsBinding" + } ], "program": { "type": "Program", @@ -32,11 +38,11 @@ "value": { "type": "DirectiveLiteral", "start":20,"end":32,"loc":{"start":{"line":1,"column":20},"end":{"line":1,"column":32}}, - "value": "use strict", "extra": { "raw": "\"use strict\"", "rawValue": "use strict" - } + }, + "value": "use strict" } } ] diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0235/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0235/output.json index 5704449178a7..7fddee9ee280 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 @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":34,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":34}}, "errors": [ - "SyntaxError: Binding 'eval' in strict mode (1:9)" + { + "$$ babel internal serialized type": "Error", + "message": "Binding 'eval' in strict mode (1:9)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "StrictEvalArgumentsBinding" + } ], "program": { "type": "Program", @@ -38,11 +44,11 @@ "value": { "type": "DirectiveLiteral", "start":19,"end":31,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":31}}, - "value": "use strict", "extra": { "raw": "\"use strict\"", "rawValue": "use strict" - } + }, + "value": "use strict" } } ] diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0236/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0236/output.json index 4f8e8d897e7d..1a7aa0c1ed75 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 @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":39,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":39}}, "errors": [ - "SyntaxError: Binding 'arguments' in strict mode (1:9)" + { + "$$ babel internal serialized type": "Error", + "message": "Binding 'arguments' in strict mode (1:9)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "StrictEvalArgumentsBinding" + } ], "program": { "type": "Program", @@ -38,11 +44,11 @@ "value": { "type": "DirectiveLiteral", "start":24,"end":36,"loc":{"start":{"line":1,"column":24},"end":{"line":1,"column":36}}, - "value": "use strict", "extra": { "raw": "\"use strict\"", "rawValue": "use strict" - } + }, + "value": "use strict" } } ] diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0239/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0239/output.json index 07cfc9324623..c20b9966edb0 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 @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":35,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":35}}, "errors": [ - "SyntaxError: Unexpected reserved word 'static' (1:23)" + { + "$$ babel internal serialized type": "Error", + "message": "Unexpected reserved word 'static' (1:23)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "UnexpectedReservedWord" + } ], "program": { "type": "Program", @@ -36,11 +42,11 @@ "value": { "type": "DirectiveLiteral", "start":0,"end":12,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":12}}, - "value": "use strict", "extra": { "raw": "\"use strict\"", "rawValue": "use strict" - } + }, + "value": "use strict" } } ] diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0240/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0240/output.json index 3b77c9170b54..141319eee7d4 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 @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":34,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":34}}, "errors": [ - "SyntaxError: Argument name clash (1:14)" + { + "$$ babel internal serialized type": "Error", + "message": "Argument name clash (1:14)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "ParamDupe" + } ], "program": { "type": "Program", @@ -43,11 +49,11 @@ "value": { "type": "DirectiveLiteral", "start":19,"end":31,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":31}}, - "value": "use strict", "extra": { "raw": "\"use strict\"", "rawValue": "use strict" - } + }, + "value": "use strict" } } ] diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0241/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0241/output.json index 0581517d990a..31e2bbac95ac 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 @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":34,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":34}}, "errors": [ - "SyntaxError: Binding 'eval' in strict mode (1:11)" + { + "$$ babel internal serialized type": "Error", + "message": "Binding 'eval' in strict mode (1:11)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "StrictEvalArgumentsBinding" + } ], "program": { "type": "Program", @@ -38,11 +44,11 @@ "value": { "type": "DirectiveLiteral", "start":19,"end":31,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":31}}, - "value": "use strict", "extra": { "raw": "\"use strict\"", "rawValue": "use strict" - } + }, + "value": "use strict" } } ] diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0242/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0242/output.json index aafa09421ccc..d511ed85057c 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 @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":37,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":37}}, "errors": [ - "SyntaxError: Binding 'package' in strict mode (1:11)" + { + "$$ babel internal serialized type": "Error", + "message": "Binding 'package' in strict mode (1:11)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "StrictEvalArgumentsBinding" + } ], "program": { "type": "Program", @@ -38,11 +44,11 @@ "value": { "type": "DirectiveLiteral", "start":22,"end":34,"loc":{"start":{"line":1,"column":22},"end":{"line":1,"column":34}}, - "value": "use strict", "extra": { "raw": "\"use strict\"", "rawValue": "use strict" - } + }, + "value": "use strict" } } ] diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0243/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0243/output.json index df3094e728a8..207be977d304 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 @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":52,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":52}}, "errors": [ - "SyntaxError: Argument name clash (1:43)" + { + "$$ babel internal serialized type": "Error", + "message": "Argument name clash (1:43)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "ParamDupe" + } ], "program": { "type": "Program", @@ -66,11 +72,11 @@ "value": { "type": "DirectiveLiteral", "start":15,"end":27,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":27}}, - "value": "use strict", "extra": { "raw": "\"use strict\"", "rawValue": "use strict" - } + }, + "value": "use strict" } } ] diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0244/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0244/output.json index bcaf874206cd..bc75f3a9a56c 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 @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":36,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":36}}, "errors": [ - "SyntaxError: Argument name clash (1:15)" + { + "$$ babel internal serialized type": "Error", + "message": "Argument name clash (1:15)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "ParamDupe" + } ], "program": { "type": "Program", @@ -16,6 +22,10 @@ "expression": { "type": "FunctionExpression", "start":1,"end":35,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":35}}, + "extra": { + "parenthesized": true, + "parenStart": 0 + }, "id": { "type": "Identifier", "start":10,"end":11,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":11},"identifierName":"a"}, @@ -46,18 +56,14 @@ "value": { "type": "DirectiveLiteral", "start":20,"end":32,"loc":{"start":{"line":1,"column":20},"end":{"line":1,"column":32}}, - "value": "use strict", "extra": { "raw": "\"use strict\"", "rawValue": "use strict" - } + }, + "value": "use strict" } } ] - }, - "extra": { - "parenthesized": true, - "parenStart": 0 } } } diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0245/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0245/output.json index 65f5a908f019..1389fc88584f 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 @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":54,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":54}}, "errors": [ - "SyntaxError: Argument name clash (1:44)" + { + "$$ babel internal serialized type": "Error", + "message": "Argument name clash (1:44)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "ParamDupe" + } ], "program": { "type": "Program", @@ -31,6 +37,10 @@ "expression": { "type": "FunctionExpression", "start":30,"end":50,"loc":{"start":{"line":1,"column":30},"end":{"line":1,"column":50}}, + "extra": { + "parenthesized": true, + "parenStart": 29 + }, "id": { "type": "Identifier", "start":39,"end":40,"loc":{"start":{"line":1,"column":39},"end":{"line":1,"column":40},"identifierName":"b"}, @@ -55,10 +65,6 @@ "start":47,"end":50,"loc":{"start":{"line":1,"column":47},"end":{"line":1,"column":50}}, "body": [], "directives": [] - }, - "extra": { - "parenthesized": true, - "parenStart": 29 } } } @@ -70,11 +76,11 @@ "value": { "type": "DirectiveLiteral", "start":15,"end":27,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":27}}, - "value": "use strict", "extra": { "raw": "\"use strict\"", "rawValue": "use strict" - } + }, + "value": "use strict" } } ] diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0246/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0246/output.json index a1ab8b4653ea..0ce381c4a601 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 @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":36,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":36}}, "errors": [ - "SyntaxError: Binding 'eval' in strict mode (1:12)" + { + "$$ babel internal serialized type": "Error", + "message": "Binding 'eval' in strict mode (1:12)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "StrictEvalArgumentsBinding" + } ], "program": { "type": "Program", @@ -16,6 +22,10 @@ "expression": { "type": "FunctionExpression", "start":1,"end":35,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":35}}, + "extra": { + "parenthesized": true, + "parenStart": 0 + }, "id": { "type": "Identifier", "start":10,"end":11,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":11},"identifierName":"a"}, @@ -41,18 +51,14 @@ "value": { "type": "DirectiveLiteral", "start":20,"end":32,"loc":{"start":{"line":1,"column":20},"end":{"line":1,"column":32}}, - "value": "use strict", "extra": { "raw": "\"use strict\"", "rawValue": "use strict" - } + }, + "value": "use strict" } } ] - }, - "extra": { - "parenthesized": true, - "parenStart": 0 } } } diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0247/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0247/output.json index 7caed97929d9..a57b71ec687d 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 @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":39,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":39}}, "errors": [ - "SyntaxError: Binding 'package' in strict mode (1:12)" + { + "$$ babel internal serialized type": "Error", + "message": "Binding 'package' in strict mode (1:12)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "StrictEvalArgumentsBinding" + } ], "program": { "type": "Program", @@ -16,6 +22,10 @@ "expression": { "type": "FunctionExpression", "start":1,"end":38,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":38}}, + "extra": { + "parenthesized": true, + "parenStart": 0 + }, "id": { "type": "Identifier", "start":10,"end":11,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":11},"identifierName":"a"}, @@ -41,18 +51,14 @@ "value": { "type": "DirectiveLiteral", "start":23,"end":35,"loc":{"start":{"line":1,"column":23},"end":{"line":1,"column":35}}, - "value": "use strict", "extra": { "raw": "\"use strict\"", "rawValue": "use strict" - } + }, + "value": "use strict" } } ] - }, - "extra": { - "parenthesized": true, - "parenStart": 0 } } } 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 df42b7ac7db9..b9736e69777e 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 @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":25,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":25}}, "errors": [ - "SyntaxError: Label '__proto__' is already declared (1:11)" + { + "$$ babel internal serialized type": "Error", + "message": "Label '__proto__' is already declared (1:11)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "LabelRedeclaration" + } ], "program": { "type": "Program", 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 27c0fb2e3a31..d9975c890778 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 @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":50,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":50}}, "errors": [ - "SyntaxError: Argument name clash (1:36)" + { + "$$ babel internal serialized type": "Error", + "message": "Argument name clash (1:36)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "ParamDupe" + } ], "program": { "type": "Program", @@ -47,11 +53,11 @@ "value": { "type": "DirectiveLiteral", "start":0,"end":12,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":12}}, - "value": "use strict", "extra": { "raw": "\"use strict\"", "rawValue": "use strict" - } + }, + "value": "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 5b2a545950f5..0a706e14318f 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 @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":36,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":36}}, "errors": [ - "SyntaxError: Redefinition of __proto__ property (1:21)" + { + "$$ babel internal serialized type": "Error", + "message": "Redefinition of __proto__ property (1:21)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "DuplicateProto" + } ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0257/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0257/output.json index 1e257d6d4e55..0bc2f47523f5 100644 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0257/output.json +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0257/output.json @@ -2,8 +2,20 @@ "type": "File", "start":0,"end":23,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":23}}, "errors": [ - "SyntaxError: Missing semicolon (1:15)", - "SyntaxError: Unexpected reserved word 'package' (1:16)" + { + "$$ babel internal serialized type": "Error", + "message": "Missing semicolon (1:15)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "MissingSemicolon" + }, + { + "$$ babel internal serialized type": "Error", + "message": "Unexpected reserved word 'package' (1:16)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "UnexpectedReservedWord" + } ], "program": { "type": "Program", 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 cedce7bc2cc8..0fc751946328 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 @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "Classes may not have static property named prototype (1:16)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "StaticPrototype" + } ], "program": { "type": "Program", 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 5d43814f1619..197f68a74b6d 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 @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "Classes may not have static property named prototype (1:16)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "StaticPrototype" + } ], "program": { "type": "Program", 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 ab3b4e1d0f4b..9cdb87440759 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 @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "Class constructor may not be an accessor (1:13)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "ConstructorIsAccessor" + } ], "program": { "type": "Program", 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 937104c770ac..2157947ea7cd 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 @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "Class constructor may not be an accessor (1:13)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "ConstructorIsAccessor" + } ], "program": { "type": "Program", 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 ed124fb20e3e..8ed105fb657f 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 @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "Duplicate constructor in the same class (1:25)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "DuplicateConstructor" + } ], "program": { "type": "Program", 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 fbd817014273..541d1f795851 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 @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":19,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":19}}, "errors": [ - "SyntaxError: Unexpected reserved word 'enum' (1:11)" + { + "$$ babel internal serialized type": "Error", + "message": "Unexpected reserved word 'enum' (1:11)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "UnexpectedReservedWord" + } ], "program": { "type": "Program", 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 d1c541915d19..d8fde1edb0f3 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 @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":30,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":30}}, "errors": [ - "SyntaxError: Unexpected reserved word 'static' (1:17)" + { + "$$ babel internal serialized type": "Error", + "message": "Unexpected reserved word 'static' (1:17)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "UnexpectedReservedWord" + } ], "program": { "type": "Program", 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 b36068b690ed..e6f8fc45679e 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 @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "setter function argument must not be a rest parameter (1:6)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "BadSetterRestParameter" + } ], "program": { "type": "Program", 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 03c94d829aa7..a6aad215bc20 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 @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":7,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":7}}, "errors": [ - "SyntaxError: Expecting Unicode escape sequence \\uXXXX (1:1)" + { + "$$ babel internal serialized type": "Error", + "message": "Expecting Unicode escape sequence \\uXXXX (1:1)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "MissingUnicodeEscape" + } ], "program": { "type": "Program", 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 f88db15c7fd9..dac94389bc65 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 @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":8,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":8}}, "errors": [ - "SyntaxError: Expecting Unicode escape sequence \\uXXXX (1:2)" + { + "$$ babel internal serialized type": "Error", + "message": "Expecting Unicode escape sequence \\uXXXX (1:2)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "MissingUnicodeEscape" + } ], "program": { "type": "Program", 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 389c8a589fb8..96fa900253ac 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 @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":8,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":8}}, "errors": [ - "SyntaxError: Expecting Unicode escape sequence \\uXXXX (1:1)" + { + "$$ babel internal serialized type": "Error", + "message": "Expecting Unicode escape sequence \\uXXXX (1:1)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "MissingUnicodeEscape" + } ], "program": { "type": "Program", 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 389c8a589fb8..96fa900253ac 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 @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":8,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":8}}, "errors": [ - "SyntaxError: Expecting Unicode escape sequence \\uXXXX (1:1)" + { + "$$ babel internal serialized type": "Error", + "message": "Expecting Unicode escape sequence \\uXXXX (1:1)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "MissingUnicodeEscape" + } ], "program": { "type": "Program", 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 0763ff948104..7c2d6aff17ad 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 @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "Complex binding patterns require an initialization value (1:6)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "DeclarationMissingInitializer" + } ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/estree/object-method/invalid-setter/output.json b/packages/babel-parser/test/fixtures/estree/object-method/invalid-setter/output.json index 98c7c647bf60..190662af26ac 100644 --- a/packages/babel-parser/test/fixtures/estree/object-method/invalid-setter/output.json +++ b/packages/babel-parser/test/fixtures/estree/object-method/invalid-setter/output.json @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":15,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":15}}, "errors": [ - "SyntaxError: setter must have exactly one formal parameter (1:3)" + { + "$$ babel internal serialized type": "Error", + "message": "setter must have exactly one formal parameter (1:3)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "BadSetterArity" + } ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/estree/typescript/getter-setter/output.json b/packages/babel-parser/test/fixtures/estree/typescript/getter-setter/output.json index 284b2c96b440..99dc3f914f66 100644 --- a/packages/babel-parser/test/fixtures/estree/typescript/getter-setter/output.json +++ b/packages/babel-parser/test/fixtures/estree/typescript/getter-setter/output.json @@ -2,8 +2,20 @@ "type": "File", "start":0,"end":85,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":18}}, "errors": [ - "SyntaxError: setter must have exactly one formal parameter (3:3)", - "SyntaxError: getter must not have any formal parameters (4:3)" + { + "$$ babel internal serialized type": "Error", + "message": "setter must have exactly one formal parameter (3:3)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "BadSetterArity" + }, + { + "$$ babel internal serialized type": "Error", + "message": "getter must not have any formal parameters (4:3)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "BadGetterArity" + } ], "program": { "type": "Program", 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 b1975e9de194..fe7f58a8f907 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 @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "Classes may not have a private field named '#constructor' (2:2)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "ConstructorClassPrivateField" + } ], "program": { "type": "Program", 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 bda07d6588d0..83e28a585b62 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 @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":60,"loc":{"start":{"line":1,"column":0},"end":{"line":5,"column":1}}, "errors": [ - "SyntaxError: Unexpected space between # and identifier (2:3)" + { + "$$ babel internal serialized type": "Error", + "message": "Unexpected space between # and identifier (2:3)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "UnexpectedSpace" + } ], "program": { "type": "Program", 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 365b9b97a943..7780a8e8b7c2 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 @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":31,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "errors": [ - "SyntaxError: Duplicate private name #x (3:2)" + { + "$$ babel internal serialized type": "Error", + "message": "Duplicate private name #x (3:2)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "PrivateNameRedeclaration" + } ], "program": { "type": "Program", 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 dbd141f36516..11f73db4c221 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 @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":35,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "errors": [ - "SyntaxError: Duplicate private name #x (3:6)" + { + "$$ babel internal serialized type": "Error", + "message": "Duplicate private name #x (3:6)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "PrivateNameRedeclaration" + } ], "program": { "type": "Program", 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 860696f144c4..01289684de0d 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 @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":31,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "errors": [ - "SyntaxError: Duplicate private name #x (3:2)" + { + "$$ babel internal serialized type": "Error", + "message": "Duplicate private name #x (3:2)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "PrivateNameRedeclaration" + } ], "program": { "type": "Program", 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 fc48d9672da0..43be4fd9a650 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 @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":36,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "errors": [ - "SyntaxError: Duplicate private name #x (3:6)" + { + "$$ babel internal serialized type": "Error", + "message": "Duplicate private name #x (3:6)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "PrivateNameRedeclaration" + } ], "program": { "type": "Program", 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 6bdc11432ece..5ffb824746a5 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 @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":38,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "errors": [ - "SyntaxError: Duplicate private name #x (3:9)" + { + "$$ babel internal serialized type": "Error", + "message": "Duplicate private name #x (3:9)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "PrivateNameRedeclaration" + } ], "program": { "type": "Program", 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 78af3bf7c711..61492fd58ce2 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 @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":42,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "errors": [ - "SyntaxError: Duplicate private name #x (3:13)" + { + "$$ babel internal serialized type": "Error", + "message": "Duplicate private name #x (3:13)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "PrivateNameRedeclaration" + } ], "program": { "type": "Program", 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 4d7e2c8824b2..e727091133d8 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 @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":38,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "errors": [ - "SyntaxError: Duplicate private name #x (3:9)" + { + "$$ babel internal serialized type": "Error", + "message": "Duplicate private name #x (3:9)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "PrivateNameRedeclaration" + } ], "program": { "type": "Program", 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 1267a637ac79..eb9ebed341e0 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 @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":43,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "errors": [ - "SyntaxError: Duplicate private name #x (3:13)" + { + "$$ babel internal serialized type": "Error", + "message": "Duplicate private name #x (3:13)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "PrivateNameRedeclaration" + } ], "program": { "type": "Program", 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 326584989c7f..37ca84256d66 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 @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":35,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "errors": [ - "SyntaxError: Duplicate private name #x (3:2)" + { + "$$ babel internal serialized type": "Error", + "message": "Duplicate private name #x (3:2)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "PrivateNameRedeclaration" + } ], "program": { "type": "Program", 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 d1d6acb5f0d5..0ba1b8cf5893 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 @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":39,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "errors": [ - "SyntaxError: Duplicate private name #x (3:6)" + { + "$$ babel internal serialized type": "Error", + "message": "Duplicate private name #x (3:6)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "PrivateNameRedeclaration" + } ], "program": { "type": "Program", 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 995f7b083808..5e699be8695c 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 @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":35,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "errors": [ - "SyntaxError: Duplicate private name #x (3:2)" + { + "$$ babel internal serialized type": "Error", + "message": "Duplicate private name #x (3:2)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "PrivateNameRedeclaration" + } ], "program": { "type": "Program", 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 35d9b789e28e..ee8136143270 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 @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":42,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "errors": [ - "SyntaxError: Duplicate private name #x (3:9)" + { + "$$ babel internal serialized type": "Error", + "message": "Duplicate private name #x (3:9)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "PrivateNameRedeclaration" + } ], "program": { "type": "Program", 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 cb4da3ca4552..7d669b6666ba 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 @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":46,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "errors": [ - "SyntaxError: Duplicate private name #x (3:13)" + { + "$$ babel internal serialized type": "Error", + "message": "Duplicate private name #x (3:13)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "PrivateNameRedeclaration" + } ], "program": { "type": "Program", 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 af9987434013..b0ced8b46527 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 @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":42,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "errors": [ - "SyntaxError: Duplicate private name #x (3:9)" + { + "$$ babel internal serialized type": "Error", + "message": "Duplicate private name #x (3:9)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "PrivateNameRedeclaration" + } ], "program": { "type": "Program", 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 42d1371ce7dd..fcad29517dac 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 @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":47,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "errors": [ - "SyntaxError: Duplicate private name #x (3:13)" + { + "$$ babel internal serialized type": "Error", + "message": "Duplicate private name #x (3:13)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "PrivateNameRedeclaration" + } ], "program": { "type": "Program", 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 122a0e829f30..9113c7c1f8dc 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 @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":31,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "errors": [ - "SyntaxError: Duplicate private name #x (3:2)" + { + "$$ babel internal serialized type": "Error", + "message": "Duplicate private name #x (3:2)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "PrivateNameRedeclaration" + } ], "program": { "type": "Program", 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 9c3051a38021..c7f171b64577 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 @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":35,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "errors": [ - "SyntaxError: Duplicate private name #x (3:6)" + { + "$$ babel internal serialized type": "Error", + "message": "Duplicate private name #x (3:6)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "PrivateNameRedeclaration" + } ], "program": { "type": "Program", 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 9e05934745d3..e2f910641068 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 @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":31,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "errors": [ - "SyntaxError: Duplicate private name #x (3:2)" + { + "$$ babel internal serialized type": "Error", + "message": "Duplicate private name #x (3:2)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "PrivateNameRedeclaration" + } ], "program": { "type": "Program", 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 792fec48d7ce..65b6aa66f4ea 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 @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":36,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "errors": [ - "SyntaxError: Duplicate private name #x (3:6)" + { + "$$ babel internal serialized type": "Error", + "message": "Duplicate private name #x (3:6)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "PrivateNameRedeclaration" + } ], "program": { "type": "Program", 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 91b3df114cef..d0471e5dd064 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 @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":38,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "errors": [ - "SyntaxError: Duplicate private name #x (3:9)" + { + "$$ babel internal serialized type": "Error", + "message": "Duplicate private name #x (3:9)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "PrivateNameRedeclaration" + } ], "program": { "type": "Program", 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 9ee1d22c1b87..475c53d5e2ce 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 @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":42,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "errors": [ - "SyntaxError: Duplicate private name #x (3:13)" + { + "$$ babel internal serialized type": "Error", + "message": "Duplicate private name #x (3:13)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "PrivateNameRedeclaration" + } ], "program": { "type": "Program", 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 17a3f7593137..5e417deb6b26 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 @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":38,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "errors": [ - "SyntaxError: Duplicate private name #x (3:9)" + { + "$$ babel internal serialized type": "Error", + "message": "Duplicate private name #x (3:9)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "PrivateNameRedeclaration" + } ], "program": { "type": "Program", 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 f7d4c6d3a12f..d8b55b9511b9 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 @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":43,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "errors": [ - "SyntaxError: Duplicate private name #x (3:13)" + { + "$$ babel internal serialized type": "Error", + "message": "Duplicate private name #x (3:13)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "PrivateNameRedeclaration" + } ], "program": { "type": "Program", 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 f0e607109c92..a09b959240e7 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 @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":36,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "errors": [ - "SyntaxError: Duplicate private name #x (3:2)" + { + "$$ babel internal serialized type": "Error", + "message": "Duplicate private name #x (3:2)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "PrivateNameRedeclaration" + } ], "program": { "type": "Program", 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 816bb3ac1410..b47fbfa0aed3 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 @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":36,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "errors": [ - "SyntaxError: Duplicate private name #x (3:2)" + { + "$$ babel internal serialized type": "Error", + "message": "Duplicate private name #x (3:2)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "PrivateNameRedeclaration" + } ], "program": { "type": "Program", 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 6fe3015ccf76..34688a7742c1 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 @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":41,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "errors": [ - "SyntaxError: Duplicate private name #x (3:6)" + { + "$$ babel internal serialized type": "Error", + "message": "Duplicate private name #x (3:6)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "PrivateNameRedeclaration" + } ], "program": { "type": "Program", 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 7c3c0b0a5e41..0b629ead72b9 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 @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":43,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "errors": [ - "SyntaxError: Duplicate private name #x (3:9)" + { + "$$ babel internal serialized type": "Error", + "message": "Duplicate private name #x (3:9)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "PrivateNameRedeclaration" + } ], "program": { "type": "Program", 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 ee2325e1bddb..10e61d49b617 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 @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":47,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "errors": [ - "SyntaxError: Duplicate private name #x (3:13)" + { + "$$ babel internal serialized type": "Error", + "message": "Duplicate private name #x (3:13)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "PrivateNameRedeclaration" + } ], "program": { "type": "Program", 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 fe58593dfba5..547bd57e8c34 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 @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":43,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "errors": [ - "SyntaxError: Duplicate private name #x (3:9)" + { + "$$ babel internal serialized type": "Error", + "message": "Duplicate private name #x (3:9)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "PrivateNameRedeclaration" + } ], "program": { "type": "Program", 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 e029e983ee76..9f89093947e0 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 @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":48,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "errors": [ - "SyntaxError: Duplicate private name #x (3:13)" + { + "$$ babel internal serialized type": "Error", + "message": "Duplicate private name #x (3:13)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "PrivateNameRedeclaration" + } ], "program": { "type": "Program", 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 cf003ba438c6..2bb5e761982f 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 @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":38,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "errors": [ - "SyntaxError: Duplicate private name #x (3:2)" + { + "$$ babel internal serialized type": "Error", + "message": "Duplicate private name #x (3:2)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "PrivateNameRedeclaration" + } ], "program": { "type": "Program", 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 d0f7aa76dbc7..226c2cbf7fe6 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 @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":42,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "errors": [ - "SyntaxError: Duplicate private name #x (3:6)" + { + "$$ babel internal serialized type": "Error", + "message": "Duplicate private name #x (3:6)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "PrivateNameRedeclaration" + } ], "program": { "type": "Program", 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 b740b3d3bd61..e7c29dce9c45 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 @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":38,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "errors": [ - "SyntaxError: Duplicate private name #x (3:2)" + { + "$$ babel internal serialized type": "Error", + "message": "Duplicate private name #x (3:2)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "PrivateNameRedeclaration" + } ], "program": { "type": "Program", 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 d4337b4f6ddf..a59249b21e59 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 @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":43,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "errors": [ - "SyntaxError: Duplicate private name #x (3:6)" + { + "$$ babel internal serialized type": "Error", + "message": "Duplicate private name #x (3:6)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "PrivateNameRedeclaration" + } ], "program": { "type": "Program", 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 4e1bc28f2660..578edb3af7c2 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 @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":45,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "errors": [ - "SyntaxError: Duplicate private name #x (3:9)" + { + "$$ babel internal serialized type": "Error", + "message": "Duplicate private name #x (3:9)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "PrivateNameRedeclaration" + } ], "program": { "type": "Program", 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 82cf9bd9f557..ed0ad1f29d8b 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 @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":49,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "errors": [ - "SyntaxError: Duplicate private name #x (3:13)" + { + "$$ babel internal serialized type": "Error", + "message": "Duplicate private name #x (3:13)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "PrivateNameRedeclaration" + } ], "program": { "type": "Program", 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 baad4ea0cde9..3b645e04a38c 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 @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":45,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "errors": [ - "SyntaxError: Duplicate private name #x (3:9)" + { + "$$ babel internal serialized type": "Error", + "message": "Duplicate private name #x (3:9)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "PrivateNameRedeclaration" + } ], "program": { "type": "Program", 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 53103a600f1d..39cfdc2a8241 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 @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":50,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "errors": [ - "SyntaxError: Duplicate private name #x (3:13)" + { + "$$ babel internal serialized type": "Error", + "message": "Duplicate private name #x (3:13)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "PrivateNameRedeclaration" + } ], "program": { "type": "Program", 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 752fd3b1a71c..f61ede7b4a53 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 @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":42,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "errors": [ - "SyntaxError: Duplicate private name #x (3:2)" + { + "$$ babel internal serialized type": "Error", + "message": "Duplicate private name #x (3:2)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "PrivateNameRedeclaration" + } ], "program": { "type": "Program", 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 35b89e838974..0a0395bad08e 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 @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":46,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "errors": [ - "SyntaxError: Duplicate private name #x (3:6)" + { + "$$ babel internal serialized type": "Error", + "message": "Duplicate private name #x (3:6)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "PrivateNameRedeclaration" + } ], "program": { "type": "Program", 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 c826d1bd510f..9541ce320bdc 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 @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":42,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "errors": [ - "SyntaxError: Duplicate private name #x (3:2)" + { + "$$ babel internal serialized type": "Error", + "message": "Duplicate private name #x (3:2)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "PrivateNameRedeclaration" + } ], "program": { "type": "Program", 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 e337e3d268c3..7da551f2fe93 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 @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":47,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "errors": [ - "SyntaxError: Duplicate private name #x (3:6)" + { + "$$ babel internal serialized type": "Error", + "message": "Duplicate private name #x (3:6)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "PrivateNameRedeclaration" + } ], "program": { "type": "Program", 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 1039c1e056e4..0e93f93920a1 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 @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":49,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "errors": [ - "SyntaxError: Duplicate private name #x (3:9)" + { + "$$ babel internal serialized type": "Error", + "message": "Duplicate private name #x (3:9)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "PrivateNameRedeclaration" + } ], "program": { "type": "Program", 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 6e37550db85e..c20671438851 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 @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":53,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "errors": [ - "SyntaxError: Duplicate private name #x (3:13)" + { + "$$ babel internal serialized type": "Error", + "message": "Duplicate private name #x (3:13)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "PrivateNameRedeclaration" + } ], "program": { "type": "Program", 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 98629c2614f1..721399f22334 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 @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":49,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "errors": [ - "SyntaxError: Duplicate private name #x (3:9)" + { + "$$ babel internal serialized type": "Error", + "message": "Duplicate private name #x (3:9)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "PrivateNameRedeclaration" + } ], "program": { "type": "Program", 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 ebc7cc92dc53..dd66fcba255b 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 @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":38,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "errors": [ - "SyntaxError: Duplicate private name #x (3:2)" + { + "$$ babel internal serialized type": "Error", + "message": "Duplicate private name #x (3:2)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "PrivateNameRedeclaration" + } ], "program": { "type": "Program", 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 e8403e51a8ee..e760d2449a3b 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 @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":42,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "errors": [ - "SyntaxError: Duplicate private name #x (3:6)" + { + "$$ babel internal serialized type": "Error", + "message": "Duplicate private name #x (3:6)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "PrivateNameRedeclaration" + } ], "program": { "type": "Program", 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 254811183570..e63195b97412 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 @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":38,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "errors": [ - "SyntaxError: Duplicate private name #x (3:2)" + { + "$$ babel internal serialized type": "Error", + "message": "Duplicate private name #x (3:2)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "PrivateNameRedeclaration" + } ], "program": { "type": "Program", 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 0e28cc4938ff..596733240a03 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 @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":43,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "errors": [ - "SyntaxError: Duplicate private name #x (3:6)" + { + "$$ babel internal serialized type": "Error", + "message": "Duplicate private name #x (3:6)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "PrivateNameRedeclaration" + } ], "program": { "type": "Program", 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 4abec1e40b1c..f84196415853 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 @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":45,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "errors": [ - "SyntaxError: Duplicate private name #x (3:9)" + { + "$$ babel internal serialized type": "Error", + "message": "Duplicate private name #x (3:9)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "PrivateNameRedeclaration" + } ], "program": { "type": "Program", 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 967cd567b4a4..ce6c61b1a434 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 @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":49,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "errors": [ - "SyntaxError: Duplicate private name #x (3:13)" + { + "$$ babel internal serialized type": "Error", + "message": "Duplicate private name #x (3:13)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "PrivateNameRedeclaration" + } ], "program": { "type": "Program", 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 3b74b77a4b3a..4ff47168ff52 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 @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":45,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "errors": [ - "SyntaxError: Duplicate private name #x (3:9)" + { + "$$ babel internal serialized type": "Error", + "message": "Duplicate private name #x (3:9)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "PrivateNameRedeclaration" + } ], "program": { "type": "Program", 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 b611d45935c7..753ecc5a07fb 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 @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":50,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "errors": [ - "SyntaxError: Duplicate private name #x (3:13)" + { + "$$ babel internal serialized type": "Error", + "message": "Duplicate private name #x (3:13)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "PrivateNameRedeclaration" + } ], "program": { "type": "Program", 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 bbbd7d10bec0..f40bb58cb2eb 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 @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":43,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "errors": [ - "SyntaxError: Duplicate private name #x (3:2)" + { + "$$ babel internal serialized type": "Error", + "message": "Duplicate private name #x (3:2)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "PrivateNameRedeclaration" + } ], "program": { "type": "Program", 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 0b33c76ec3b3..d3676c0ed63d 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 @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":47,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "errors": [ - "SyntaxError: Duplicate private name #x (3:6)" + { + "$$ babel internal serialized type": "Error", + "message": "Duplicate private name #x (3:6)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "PrivateNameRedeclaration" + } ], "program": { "type": "Program", 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 3d2ee186456a..f5e74fc295b0 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 @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":43,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "errors": [ - "SyntaxError: Duplicate private name #x (3:2)" + { + "$$ babel internal serialized type": "Error", + "message": "Duplicate private name #x (3:2)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "PrivateNameRedeclaration" + } ], "program": { "type": "Program", 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 241a017c8eb0..28754159ba7a 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 @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":48,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "errors": [ - "SyntaxError: Duplicate private name #x (3:6)" + { + "$$ babel internal serialized type": "Error", + "message": "Duplicate private name #x (3:6)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "PrivateNameRedeclaration" + } ], "program": { "type": "Program", 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 ae3787b17496..80774209312d 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 @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":50,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "errors": [ - "SyntaxError: Duplicate private name #x (3:9)" + { + "$$ babel internal serialized type": "Error", + "message": "Duplicate private name #x (3:9)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "PrivateNameRedeclaration" + } ], "program": { "type": "Program", 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 6df9c23ccf95..16bab476c0bb 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 @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":50,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "errors": [ - "SyntaxError: Duplicate private name #x (3:9)" + { + "$$ babel internal serialized type": "Error", + "message": "Duplicate private name #x (3:9)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "PrivateNameRedeclaration" + } ], "program": { "type": "Program", 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 dff968e97984..44aca7f7bcd6 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 @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":55,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "errors": [ - "SyntaxError: Duplicate private name #x (3:13)" + { + "$$ babel internal serialized type": "Error", + "message": "Duplicate private name #x (3:13)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "PrivateNameRedeclaration" + } ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-properties/failure-delete-optional-private-property/output.json b/packages/babel-parser/test/fixtures/experimental/class-private-properties/failure-delete-optional-private-property/output.json index c616eec20ec0..6c8a72953f34 100644 --- a/packages/babel-parser/test/fixtures/experimental/class-private-properties/failure-delete-optional-private-property/output.json +++ b/packages/babel-parser/test/fixtures/experimental/class-private-properties/failure-delete-optional-private-property/output.json @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":62,"loc":{"start":{"line":1,"column":0},"end":{"line":6,"column":1}}, "errors": [ - "SyntaxError: Deleting a private field is not allowed (4:4)" + { + "$$ babel internal serialized type": "Error", + "message": "Deleting a private field is not allowed (4:4)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "DeletePrivateField" + } ], "program": { "type": "Program", @@ -72,6 +78,7 @@ "type": "ThisExpression", "start":47,"end":51,"loc":{"start":{"line":4,"column":11},"end":{"line":4,"column":15}} }, + "computed": false, "property": { "type": "PrivateName", "start":53,"end":55,"loc":{"start":{"line":4,"column":17},"end":{"line":4,"column":19}}, @@ -81,7 +88,6 @@ "name": "x" } }, - "computed": false, "optional": true } } 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 edd09ae38e67..8828d7142ef2 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 @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "Deleting a private field is not allowed (4:4)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "DeletePrivateField" + } ], "program": { "type": "Program", @@ -72,6 +78,7 @@ "type": "ThisExpression", "start":47,"end":51,"loc":{"start":{"line":4,"column":11},"end":{"line":4,"column":15}} }, + "computed": false, "property": { "type": "PrivateName", "start":52,"end":54,"loc":{"start":{"line":4,"column":16},"end":{"line":4,"column":18}}, @@ -80,8 +87,7 @@ "start":53,"end":54,"loc":{"start":{"line":4,"column":17},"end":{"line":4,"column":18},"identifierName":"x"}, "name": "x" } - }, - "computed": false + } } } } 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 56f268a84707..7b827d030a9f 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 @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "Classes may not have a private field named '#constructor' (2:2)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "ConstructorClassPrivateField" + } ], "program": { "type": "Program", 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 8e3342fe9f68..937edc19c2ee 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 @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":34,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "errors": [ - "SyntaxError: Unexpected space between # and identifier (2:3)" + { + "$$ babel internal serialized type": "Error", + "message": "Unexpected space between # and identifier (2:3)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "UnexpectedSpace" + } ], "program": { "type": "Program", 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 8a1f3e458127..a57a944e37eb 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 @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "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)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "UnexpectedPrivateField" + } ], "program": { "type": "Program", 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 0f46840ba8c7..af196f4a66de 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 @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "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)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "UnexpectedPrivateField" + } ], "program": { "type": "Program", 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 7c27ba1380b6..3095a700d10a 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 @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "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)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "UnexpectedPrivateField" + } ], "program": { "type": "Program", @@ -39,6 +45,10 @@ "value": { "type": "ObjectExpression", "start":18,"end":28,"loc":{"start":{"line":2,"column":8},"end":{"line":2,"column":18}}, + "extra": { + "parenthesized": true, + "parenStart": 17 + }, "properties": [ { "type": "ObjectProperty", @@ -64,11 +74,7 @@ "value": 42 } } - ], - "extra": { - "parenthesized": true, - "parenStart": 17 - } + ] } } ] 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 abaf592123d0..b974cd09deb4 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 @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "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)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "UnexpectedPrivateField" + } ], "program": { "type": "Program", 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 8010b9a5b411..5866cea2dbb5 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 @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "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)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "SuperNotAllowed" + } ], "program": { "type": "Program", 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 e1645e9fd57e..d1bc9fdcd679 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 @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "Private fields can't be accessed on super (5:4)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "SuperPrivateField" + } ], "program": { "type": "Program", @@ -71,6 +77,7 @@ "type": "Super", "start":44,"end":49,"loc":{"start":{"line":5,"column":4},"end":{"line":5,"column":9}} }, + "computed": false, "property": { "type": "PrivateName", "start":50,"end":52,"loc":{"start":{"line":5,"column":10},"end":{"line":5,"column":12}}, @@ -79,8 +86,7 @@ "start":51,"end":52,"loc":{"start":{"line":5,"column":11},"end":{"line":5,"column":12},"identifierName":"x"}, "name": "x" } - }, - "computed": false + } } } ], 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 72c04ef4fff9..e36905e9edab 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 @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "Private name #priv is not defined (4:19)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "InvalidPrivateFieldResolution" + } ], "program": { "type": "Program", @@ -77,6 +83,7 @@ "start":42,"end":45,"loc":{"start":{"line":4,"column":15},"end":{"line":4,"column":18},"identifierName":"foo"}, "name": "foo" }, + "computed": false, "property": { "type": "PrivateName", "start":46,"end":51,"loc":{"start":{"line":4,"column":19},"end":{"line":4,"column":24}}, @@ -85,8 +92,7 @@ "start":47,"end":51,"loc":{"start":{"line":4,"column":20},"end":{"line":4,"column":24},"identifierName":"priv"}, "name": "priv" } - }, - "computed": false + } } } ], 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 6cc1bce62569..77ed46e11708 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 @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "Private name #priv is not defined (1:15)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "InvalidPrivateFieldResolution" + } ], "program": { "type": "Program", @@ -30,6 +36,7 @@ "start":11,"end":14,"loc":{"start":{"line":1,"column":11},"end":{"line":1,"column":14},"identifierName":"foo"}, "name": "foo" }, + "computed": false, "property": { "type": "PrivateName", "start":15,"end":20,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":20}}, @@ -38,8 +45,7 @@ "start":16,"end":20,"loc":{"start":{"line":1,"column":16},"end":{"line":1,"column":20},"identifierName":"priv"}, "name": "priv" } - }, - "computed": false + } } } ], 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 e4fcbae89abd..aa7ac5f09b04 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 @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":60,"loc":{"start":{"line":1,"column":0},"end":{"line":5,"column":1}}, "errors": [ - "SyntaxError: 'arguments' is only allowed in functions and class methods (3:16)" + { + "$$ babel internal serialized type": "Error", + "message": "'arguments' is only allowed in functions and class methods (3:16)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "ArgumentsInClass" + } ], "program": { "type": "Program", 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 a6645c3bef45..039c3a7e5b85 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 @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":76,"loc":{"start":{"line":1,"column":0},"end":{"line":5,"column":1}}, "errors": [ - "SyntaxError: 'arguments' is only allowed in functions and class methods (3:25)" + { + "$$ babel internal serialized type": "Error", + "message": "'arguments' is only allowed in functions and class methods (3:25)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "ArgumentsInClass" + } ], "program": { "type": "Program", 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 48d889e597ff..e87e3c6163c2 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 @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":54,"loc":{"start":{"line":1,"column":0},"end":{"line":5,"column":1}}, "errors": [ - "SyntaxError: 'arguments' is only allowed in functions and class methods (3:10)" + { + "$$ babel internal serialized type": "Error", + "message": "'arguments' is only allowed in functions and class methods (3:10)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "ArgumentsInClass" + } ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/experimental/class-properties/await-in-computed-property-in-params-of-async-arrow/output.json b/packages/babel-parser/test/fixtures/experimental/class-properties/await-in-computed-property-in-params-of-async-arrow/output.json index b2b40d6638b8..9b035a5c1d59 100644 --- a/packages/babel-parser/test/fixtures/experimental/class-properties/await-in-computed-property-in-params-of-async-arrow/output.json +++ b/packages/babel-parser/test/fixtures/experimental/class-properties/await-in-computed-property-in-params-of-async-arrow/output.json @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":39,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":39}}, "errors": [ - "SyntaxError: Can not use 'await' as identifier inside an async function (1:20)" + { + "$$ babel internal serialized type": "Error", + "message": "Can not use 'await' as identifier inside an async function (1:20)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "AwaitBindingIdentifier" + } ], "program": { "type": "Program", 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 166fd813daca..dd444e1c60ea 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 @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "new.target can only be used in functions or class properties (1:8)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "UnexpectedNewTarget" + } ], "program": { "type": "Program", 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 9d09ab7b33e5..510464aafd1f 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 @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "Classes may not have a field named 'constructor' (2:2)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "ConstructorClassField" + } ], "program": { "type": "Program", 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 67687aa331a8..62058aea7651 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 @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "Classes may not have a field named 'constructor' (2:2)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "ConstructorClassField" + } ], "program": { "type": "Program", 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 2850861ad8fc..b02103cf3f4d 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 @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "Classes may not have static property named prototype (2:9)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "StaticPrototype" + } ], "program": { "type": "Program", 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 2e1a73e9731d..80b58aebc5d8 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 @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "Classes may not have static property named prototype (2:9)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "StaticPrototype" + } ], "program": { "type": "Program", 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 789ddb0c28e4..2a9313456494 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 @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "Classes may not have a field named 'constructor' (2:11)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "ConstructorClassField" + } ], "program": { "type": "Program", 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 e93888eeb6f2..3ab44e220409 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 @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "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)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "SuperNotAllowed" + } ], "program": { "type": "Program", 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 c69a435a1046..02f17c681c44 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 @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "super is only allowed in object methods and classes (3:4)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "UnexpectedSuper" + } ], "program": { "type": "Program", @@ -61,12 +67,12 @@ "type": "Super", "start":38,"end":43,"loc":{"start":{"line":3,"column":4},"end":{"line":3,"column":9}} }, + "computed": false, "property": { "type": "Identifier", "start":44,"end":45,"loc":{"start":{"line":3,"column":10},"end":{"line":3,"column":11},"identifierName":"x"}, "name": "x" - }, - "computed": false + } }, "arguments": [] } 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 c50fc16839fe..956f1f1d4dca 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 @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":100,"loc":{"start":{"line":1,"column":0},"end":{"line":6,"column":1}}, "errors": [ - "SyntaxError: Unexpected reserved word 'yield' (4:8)" + { + "$$ babel internal serialized type": "Error", + "message": "Unexpected reserved word 'yield' (4:8)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "UnexpectedReservedWord" + } ], "program": { "type": "Program", @@ -41,6 +47,13 @@ { "type": "ClassProperty", "start":79,"end":94,"loc":{"start":{"line":4,"column":4},"end":{"line":4,"column":19}}, + "leadingComments": [ + { + "type": "CommentLine", + "value": " here yield is an identifier reference", + "start":34,"end":74,"loc":{"start":{"line":3,"column":4},"end":{"line":3,"column":44}} + } + ], "static": false, "key": { "type": "Identifier", @@ -66,14 +79,7 @@ }, "value": 42 } - }, - "leadingComments": [ - { - "type": "CommentLine", - "value": " here yield is an identifier reference", - "start":34,"end":74,"loc":{"start":{"line":3,"column":4},"end":{"line":3,"column":44}} - } - ] + } } ] } diff --git a/packages/babel-parser/test/fixtures/experimental/class-static-block/await-binding-in-static-block/output.json b/packages/babel-parser/test/fixtures/experimental/class-static-block/await-binding-in-static-block/output.json index c3fb984ad5a4..6d9d534312bb 100644 --- a/packages/babel-parser/test/fixtures/experimental/class-static-block/await-binding-in-static-block/output.json +++ b/packages/babel-parser/test/fixtures/experimental/class-static-block/await-binding-in-static-block/output.json @@ -2,19 +2,97 @@ "type": "File", "start":0,"end":568,"loc":{"start":{"line":1,"column":0},"end":{"line":27,"column":34}}, "errors": [ - "SyntaxError: Can not use 'await' as identifier inside a static block (3:21)", - "SyntaxError: Can not use 'await' as identifier inside a static block (5:27)", - "SyntaxError: Can not use 'await' as identifier inside a static block (7:22)", - "SyntaxError: Can not use 'await' as identifier inside a static block (9:22)", - "SyntaxError: Can not use 'await' as identifier inside a static block (11:28)", - "SyntaxError: Can not use 'await' as identifier inside a static block (13:28)", - "SyntaxError: Can not use 'await' as identifier inside a static block (15:25)", - "SyntaxError: Can not use 'await' as identifier inside a static block (17:25)", - "SyntaxError: Can not use 'await' as identifier inside a static block (19:31)", - "SyntaxError: Can not use 'await' as identifier inside a static block (21:31)", - "SyntaxError: Can not use 'await' as identifier inside a static block (23:28)", - "SyntaxError: Can not use 'await' as identifier inside a static block (25:30)", - "SyntaxError: Can not use 'await' as identifier inside a static block (27:21)" + { + "$$ babel internal serialized type": "Error", + "message": "Can not use 'await' as identifier inside a static block (3:21)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "AwaitBindingIdentifierInStaticBlock" + }, + { + "$$ babel internal serialized type": "Error", + "message": "Can not use 'await' as identifier inside a static block (5:27)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "AwaitBindingIdentifierInStaticBlock" + }, + { + "$$ babel internal serialized type": "Error", + "message": "Can not use 'await' as identifier inside a static block (7:22)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "AwaitBindingIdentifierInStaticBlock" + }, + { + "$$ babel internal serialized type": "Error", + "message": "Can not use 'await' as identifier inside a static block (9:22)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "AwaitBindingIdentifierInStaticBlock" + }, + { + "$$ babel internal serialized type": "Error", + "message": "Can not use 'await' as identifier inside a static block (11:28)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "AwaitBindingIdentifierInStaticBlock" + }, + { + "$$ babel internal serialized type": "Error", + "message": "Can not use 'await' as identifier inside a static block (13:28)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "AwaitBindingIdentifierInStaticBlock" + }, + { + "$$ babel internal serialized type": "Error", + "message": "Can not use 'await' as identifier inside a static block (15:25)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "AwaitBindingIdentifierInStaticBlock" + }, + { + "$$ babel internal serialized type": "Error", + "message": "Can not use 'await' as identifier inside a static block (17:25)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "AwaitBindingIdentifierInStaticBlock" + }, + { + "$$ babel internal serialized type": "Error", + "message": "Can not use 'await' as identifier inside a static block (19:31)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "AwaitBindingIdentifierInStaticBlock" + }, + { + "$$ babel internal serialized type": "Error", + "message": "Can not use 'await' as identifier inside a static block (21:31)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "AwaitBindingIdentifierInStaticBlock" + }, + { + "$$ babel internal serialized type": "Error", + "message": "Can not use 'await' as identifier inside a static block (23:28)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "AwaitBindingIdentifierInStaticBlock" + }, + { + "$$ babel internal serialized type": "Error", + "message": "Can not use 'await' as identifier inside a static block (25:30)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "AwaitBindingIdentifierInStaticBlock" + }, + { + "$$ babel internal serialized type": "Error", + "message": "Can not use 'await' as identifier inside a static block (27:21)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "AwaitBindingIdentifierInStaticBlock" + } ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/experimental/class-static-block/invalid-arguments/output.json b/packages/babel-parser/test/fixtures/experimental/class-static-block/invalid-arguments/output.json index 3dd4e8af7079..b1d69b2f4219 100644 --- a/packages/babel-parser/test/fixtures/experimental/class-static-block/invalid-arguments/output.json +++ b/packages/babel-parser/test/fixtures/experimental/class-static-block/invalid-arguments/output.json @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":52,"loc":{"start":{"line":1,"column":0},"end":{"line":5,"column":1}}, "errors": [ - "SyntaxError: 'arguments' is only allowed in functions and class methods (3:15)" + { + "$$ babel internal serialized type": "Error", + "message": "'arguments' is only allowed in functions and class methods (3:15)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "ArgumentsInClass" + } ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/experimental/class-static-block/invalid-await/output.json b/packages/babel-parser/test/fixtures/experimental/class-static-block/invalid-await/output.json index a5c0a305f294..227976576606 100644 --- a/packages/babel-parser/test/fixtures/experimental/class-static-block/invalid-await/output.json +++ b/packages/babel-parser/test/fixtures/experimental/class-static-block/invalid-await/output.json @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":95,"loc":{"start":{"line":1,"column":0},"end":{"line":8,"column":1}}, "errors": [ - "SyntaxError: 'await' is only allowed within async functions (5:6)" + { + "$$ babel internal serialized type": "Error", + "message": "'await' is only allowed within async functions (5:6)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "AwaitBindingIdentifierInStaticBlock" + } ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/experimental/class-static-block/invalid-break/output.json b/packages/babel-parser/test/fixtures/experimental/class-static-block/invalid-break/output.json index 945a53080c99..2e11c6761481 100644 --- a/packages/babel-parser/test/fixtures/experimental/class-static-block/invalid-break/output.json +++ b/packages/babel-parser/test/fixtures/experimental/class-static-block/invalid-break/output.json @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":111,"loc":{"start":{"line":1,"column":0},"end":{"line":10,"column":1}}, "errors": [ - "SyntaxError: Unsyntactic break (6:8)" + { + "$$ babel internal serialized type": "Error", + "message": "Unsyntactic break (6:8)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "IllegalBreakContinue" + } ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/experimental/class-static-block/invalid-continue/output.json b/packages/babel-parser/test/fixtures/experimental/class-static-block/invalid-continue/output.json index e427962f49ba..9dac289e30b2 100644 --- a/packages/babel-parser/test/fixtures/experimental/class-static-block/invalid-continue/output.json +++ b/packages/babel-parser/test/fixtures/experimental/class-static-block/invalid-continue/output.json @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":84,"loc":{"start":{"line":1,"column":0},"end":{"line":8,"column":1}}, "errors": [ - "SyntaxError: Unsyntactic continue (5:6)" + { + "$$ babel internal serialized type": "Error", + "message": "Unsyntactic continue (5:6)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "IllegalBreakContinue" + } ], "program": { "type": "Program", @@ -82,4 +88,4 @@ ], "directives": [] } -} +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/class-static-block/invalid-decorators/output.json b/packages/babel-parser/test/fixtures/experimental/class-static-block/invalid-decorators/output.json index bd16de29ca2e..32f516c98e40 100644 --- a/packages/babel-parser/test/fixtures/experimental/class-static-block/invalid-decorators/output.json +++ b/packages/babel-parser/test/fixtures/experimental/class-static-block/invalid-decorators/output.json @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":76,"loc":{"start":{"line":1,"column":0},"end":{"line":7,"column":1}}, "errors": [ - "SyntaxError: Decorators can't be used with a static block (3:2)" + { + "$$ babel internal serialized type": "Error", + "message": "Decorators can't be used with a static block (3:2)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "DecoratorStaticBlock" + } ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/experimental/class-static-block/invalid-legacy-decorators/output.json b/packages/babel-parser/test/fixtures/experimental/class-static-block/invalid-legacy-decorators/output.json index bd16de29ca2e..32f516c98e40 100644 --- a/packages/babel-parser/test/fixtures/experimental/class-static-block/invalid-legacy-decorators/output.json +++ b/packages/babel-parser/test/fixtures/experimental/class-static-block/invalid-legacy-decorators/output.json @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":76,"loc":{"start":{"line":1,"column":0},"end":{"line":7,"column":1}}, "errors": [ - "SyntaxError: Decorators can't be used with a static block (3:2)" + { + "$$ babel internal serialized type": "Error", + "message": "Decorators can't be used with a static block (3:2)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "DecoratorStaticBlock" + } ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/experimental/class-static-block/invalid-legacy-octal/output.json b/packages/babel-parser/test/fixtures/experimental/class-static-block/invalid-legacy-octal/output.json index e22e29928345..5a52de1af8fb 100644 --- a/packages/babel-parser/test/fixtures/experimental/class-static-block/invalid-legacy-octal/output.json +++ b/packages/babel-parser/test/fixtures/experimental/class-static-block/invalid-legacy-octal/output.json @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":53,"loc":{"start":{"line":1,"column":0},"end":{"line":6,"column":1}}, "errors": [ - "SyntaxError: Legacy octal literals are not allowed in strict mode (4:4)" + { + "$$ babel internal serialized type": "Error", + "message": "Legacy octal literals are not allowed in strict mode (4:4)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "StrictOctalLiteral" + } ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/experimental/class-static-block/invalid-return/output.json b/packages/babel-parser/test/fixtures/experimental/class-static-block/invalid-return/output.json index 2f0fef206125..382be04afa52 100644 --- a/packages/babel-parser/test/fixtures/experimental/class-static-block/invalid-return/output.json +++ b/packages/babel-parser/test/fixtures/experimental/class-static-block/invalid-return/output.json @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":61,"loc":{"start":{"line":1,"column":0},"end":{"line":6,"column":1}}, "errors": [ - "SyntaxError: 'return' outside of function (4:4)" + { + "$$ babel internal serialized type": "Error", + "message": "'return' outside of function (4:4)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "IllegalReturn" + } ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/experimental/class-static-block/invalid-super-call/output.json b/packages/babel-parser/test/fixtures/experimental/class-static-block/invalid-super-call/output.json index e07c019a7eb3..aa7aec603227 100644 --- a/packages/babel-parser/test/fixtures/experimental/class-static-block/invalid-super-call/output.json +++ b/packages/babel-parser/test/fixtures/experimental/class-static-block/invalid-super-call/output.json @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":78,"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? (5:4)" + { + "$$ babel internal serialized type": "Error", + "message": "super() is only valid inside a class constructor of a subclass. Maybe a typo in the method name ('constructor') or not extending another class? (5:4)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "SuperNotAllowed" + } ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/experimental/class-static-block/invalid-yield/output.json b/packages/babel-parser/test/fixtures/experimental/class-static-block/invalid-yield/output.json index a88cd81ff0b2..a1b4dd4187e5 100644 --- a/packages/babel-parser/test/fixtures/experimental/class-static-block/invalid-yield/output.json +++ b/packages/babel-parser/test/fixtures/experimental/class-static-block/invalid-yield/output.json @@ -2,8 +2,20 @@ "type": "File", "start":0,"end":90,"loc":{"start":{"line":1,"column":0},"end":{"line":8,"column":1}}, "errors": [ - "SyntaxError: Unexpected reserved word 'yield' (5:6)", - "SyntaxError: Missing semicolon (5:11)" + { + "$$ babel internal serialized type": "Error", + "message": "Unexpected reserved word 'yield' (5:6)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "UnexpectedReservedWord" + }, + { + "$$ babel internal serialized type": "Error", + "message": "Missing semicolon (5:11)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "MissingSemicolon" + } ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/experimental/decimal/invalid-e/output.json b/packages/babel-parser/test/fixtures/experimental/decimal/invalid-e/output.json index 1ae22702c120..3b47a2dc5fb0 100644 --- a/packages/babel-parser/test/fixtures/experimental/decimal/invalid-e/output.json +++ b/packages/babel-parser/test/fixtures/experimental/decimal/invalid-e/output.json @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":4,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":4}}, "errors": [ - "SyntaxError: Invalid decimal (1:0)" + { + "$$ babel internal serialized type": "Error", + "message": "Invalid decimal (1:0)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "InvalidDecimal" + } ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/experimental/decimal/invalid-non-octal-decimal-int/output.json b/packages/babel-parser/test/fixtures/experimental/decimal/invalid-non-octal-decimal-int/output.json index 60c5dbd4f533..84a61d0d2fba 100644 --- a/packages/babel-parser/test/fixtures/experimental/decimal/invalid-non-octal-decimal-int/output.json +++ b/packages/babel-parser/test/fixtures/experimental/decimal/invalid-non-octal-decimal-int/output.json @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":4,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":4}}, "errors": [ - "SyntaxError: Invalid decimal (1:0)" + { + "$$ babel internal serialized type": "Error", + "message": "Invalid decimal (1:0)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "InvalidDecimal" + } ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/experimental/decimal/invalid-octal-legacy/output.json b/packages/babel-parser/test/fixtures/experimental/decimal/invalid-octal-legacy/output.json index 2c49c0fb79fe..9f2c5f9061a1 100644 --- a/packages/babel-parser/test/fixtures/experimental/decimal/invalid-octal-legacy/output.json +++ b/packages/babel-parser/test/fixtures/experimental/decimal/invalid-octal-legacy/output.json @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":7,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":7}}, "errors": [ - "SyntaxError: Invalid decimal (1:0)" + { + "$$ babel internal serialized type": "Error", + "message": "Invalid decimal (1:0)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "InvalidDecimal" + } ], "program": { "type": "Program", 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 083fa746f96b..4ba55117d475 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 @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "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)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "DecoratorBeforeExport" + } ], "program": { "type": "Program", 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 fd172b86c4d5..d6bcfaae5039 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 @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "Decorators cannot be used to decorate parameters (2:14)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "UnsupportedParameterDecorator" + } ], "program": { "type": "Program", 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 d1b72ec9914b..131720fb2b07 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 @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "Decorators can't be used with a constructor. Did you mean '@dec class { ... }'? (2:2)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "DecoratorConstructor" + } ], "program": { "type": "Program", 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 5ede51a7199f..42cde65d8eee 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 @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "Using the export keyword between a decorator and a class is not allowed. Please use `export @dec class` instead. (2:0)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "DecoratorExportClass" + } ], "program": { "type": "Program", 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 47d78bbffa84..30ce3ad36b87 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 @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "Decorators cannot be used to decorate parameters (1:14)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "UnsupportedParameterDecorator" + } ], "program": { "type": "Program", 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 ab145b851060..5cb73d8c9031 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 @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "Decorators cannot be used to decorate parameters (2:9)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "UnsupportedParameterDecorator" + } ], "program": { "type": "Program", 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 1268657c20ea..7dd94b4eb99c 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 @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "Decorators cannot be used to decorate object literal properties (2:2)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "UnsupportedPropertyDecorator" + } ], "program": { "type": "Program", 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 d1b72ec9914b..131720fb2b07 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 @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "Decorators can't be used with a constructor. Did you mean '@dec class { ... }'? (2:2)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "DecoratorConstructor" + } ], "program": { "type": "Program", 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 37e56eeb13ba..6491dd9aa431 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 @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "import can only be used in import() or import.meta (1:1)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "UnsupportedImport" + } ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/experimental/export-extensions/invalid-default-from-identifier/output.json b/packages/babel-parser/test/fixtures/experimental/export-extensions/invalid-default-from-identifier/output.json index cc0e24e848fe..ed6a1ddfe483 100644 --- a/packages/babel-parser/test/fixtures/experimental/export-extensions/invalid-default-from-identifier/output.json +++ b/packages/babel-parser/test/fixtures/experimental/export-extensions/invalid-default-from-identifier/output.json @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":20,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":20}}, "errors": [ - "SyntaxError: 'from' is not allowed as an identifier after 'export default' (1:15)" + { + "$$ babel internal serialized type": "Error", + "message": "'from' is not allowed as an identifier after 'export default' (1:15)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "ExportDefaultFromAsIdentifier" + } ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/experimental/function-sent/enabled-function-keyword-declaration/output.json b/packages/babel-parser/test/fixtures/experimental/function-sent/enabled-function-keyword-declaration/output.json index eaab0f905ba6..f01a83e32e3e 100644 --- a/packages/babel-parser/test/fixtures/experimental/function-sent/enabled-function-keyword-declaration/output.json +++ b/packages/babel-parser/test/fixtures/experimental/function-sent/enabled-function-keyword-declaration/output.json @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":40,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "errors": [ - "SyntaxError: Missing semicolon (2:17)" + { + "$$ babel internal serialized type": "Error", + "message": "Missing semicolon (2:17)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "MissingSemicolon" + } ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/experimental/import-assertions/incorrect-arity/output.json b/packages/babel-parser/test/fixtures/experimental/import-assertions/incorrect-arity/output.json index de469d3cab1e..4b14f12b0423 100644 --- a/packages/babel-parser/test/fixtures/experimental/import-assertions/incorrect-arity/output.json +++ b/packages/babel-parser/test/fixtures/experimental/import-assertions/incorrect-arity/output.json @@ -2,8 +2,20 @@ "type": "File", "start":0,"end":75,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":65}}, "errors": [ - "SyntaxError: import() requires exactly one or two arguments (1:0)", - "SyntaxError: import() requires exactly one or two arguments (2:0)" + { + "$$ babel internal serialized type": "Error", + "message": "import() requires exactly one or two arguments (1:0)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "ImportCallArity" + }, + { + "$$ babel internal serialized type": "Error", + "message": "import() requires exactly one or two arguments (2:0)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "ImportCallArity" + } ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/experimental/import-assertions/invalid-escaped-assert/output.json b/packages/babel-parser/test/fixtures/experimental/import-assertions/invalid-escaped-assert/output.json index 31284550fd91..9f3239787724 100644 --- a/packages/babel-parser/test/fixtures/experimental/import-assertions/invalid-escaped-assert/output.json +++ b/packages/babel-parser/test/fixtures/experimental/import-assertions/invalid-escaped-assert/output.json @@ -2,8 +2,20 @@ "type": "File", "start":0,"end":42,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":42}}, "errors": [ - "SyntaxError: Missing semicolon (1:12)", - "SyntaxError: Missing semicolon (1:24)" + { + "$$ babel internal serialized type": "Error", + "message": "Missing semicolon (1:12)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "MissingSemicolon" + }, + { + "$$ babel internal serialized type": "Error", + "message": "Missing semicolon (1:24)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "MissingSemicolon" + } ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/experimental/import-assertions/invalid-export-without-from/output.json b/packages/babel-parser/test/fixtures/experimental/import-assertions/invalid-export-without-from/output.json index 682ac330ebc0..227cdca0946a 100644 --- a/packages/babel-parser/test/fixtures/experimental/import-assertions/invalid-export-without-from/output.json +++ b/packages/babel-parser/test/fixtures/experimental/import-assertions/invalid-export-without-from/output.json @@ -2,8 +2,20 @@ "type": "File", "start":0,"end":54,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":39}}, "errors": [ - "SyntaxError: Missing semicolon (2:14)", - "SyntaxError: Missing semicolon (2:21)" + { + "$$ babel internal serialized type": "Error", + "message": "Missing semicolon (2:14)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "MissingSemicolon" + }, + { + "$$ babel internal serialized type": "Error", + "message": "Missing semicolon (2:21)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "MissingSemicolon" + } ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/experimental/import-assertions/invalid-spread-element-import-call/output.json b/packages/babel-parser/test/fixtures/experimental/import-assertions/invalid-spread-element-import-call/output.json index f016f97336e9..addaa4fedbac 100644 --- a/packages/babel-parser/test/fixtures/experimental/import-assertions/invalid-spread-element-import-call/output.json +++ b/packages/babel-parser/test/fixtures/experimental/import-assertions/invalid-spread-element-import-call/output.json @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":28,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":28}}, "errors": [ - "SyntaxError: ... is not allowed in import() (1:21)" + { + "$$ babel internal serialized type": "Error", + "message": "... is not allowed in import() (1:21)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "ImportCallSpreadArgument" + } ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/experimental/import-assertions/invalid-syntax-with-repeated-type-string/output.json b/packages/babel-parser/test/fixtures/experimental/import-assertions/invalid-syntax-with-repeated-type-string/output.json index b6c67e2e6d94..8e4bd2b31f40 100644 --- a/packages/babel-parser/test/fixtures/experimental/import-assertions/invalid-syntax-with-repeated-type-string/output.json +++ b/packages/babel-parser/test/fixtures/experimental/import-assertions/invalid-syntax-with-repeated-type-string/output.json @@ -2,8 +2,20 @@ "type": "File", "start":0,"end":81,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":81}}, "errors": [ - "SyntaxError: Duplicate key \"type\" is not allowed in module attributes (1:52)", - "SyntaxError: Duplicate key \"type\" is not allowed in module attributes (1:66)" + { + "$$ babel internal serialized type": "Error", + "message": "Duplicate key \"type\" is not allowed in module attributes (1:52)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "ModuleAttributesWithDuplicateKeys" + }, + { + "$$ babel internal serialized type": "Error", + "message": "Duplicate key \"type\" is not allowed in module attributes (1:66)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "ModuleAttributesWithDuplicateKeys" + } ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/experimental/import-assertions/invalid-syntax-with-repeated-type/output.json b/packages/babel-parser/test/fixtures/experimental/import-assertions/invalid-syntax-with-repeated-type/output.json index 5d8f1cee0e88..95f4c0a693fe 100644 --- a/packages/babel-parser/test/fixtures/experimental/import-assertions/invalid-syntax-with-repeated-type/output.json +++ b/packages/babel-parser/test/fixtures/experimental/import-assertions/invalid-syntax-with-repeated-type/output.json @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":65,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":65}}, "errors": [ - "SyntaxError: Duplicate key \"type\" is not allowed in module attributes (1:50)" + { + "$$ babel internal serialized type": "Error", + "message": "Duplicate key \"type\" is not allowed in module attributes (1:50)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "ModuleAttributesWithDuplicateKeys" + } ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/experimental/import-assertions/string-literal/output.json b/packages/babel-parser/test/fixtures/experimental/import-assertions/string-literal/output.json index 31e3705afb81..2057faab2485 100644 --- a/packages/babel-parser/test/fixtures/experimental/import-assertions/string-literal/output.json +++ b/packages/babel-parser/test/fixtures/experimental/import-assertions/string-literal/output.json @@ -2,8 +2,20 @@ "type": "File", "start":0,"end":101,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":52}}, "errors": [ - "SyntaxError: The only accepted module attribute is `type` (1:36)", - "SyntaxError: The only accepted module attribute is `type` (2:40)" + { + "$$ babel internal serialized type": "Error", + "message": "The only accepted module attribute is `type` (1:36)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "ModuleAttributeDifferentFromType" + }, + { + "$$ babel internal serialized type": "Error", + "message": "The only accepted module attribute is `type` (2:40)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "ModuleAttributeDifferentFromType" + } ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/experimental/import-assertions/valid-syntax-export-with-no-type-attribute/output.json b/packages/babel-parser/test/fixtures/experimental/import-assertions/valid-syntax-export-with-no-type-attribute/output.json index c728fc223164..33080b612c71 100644 --- a/packages/babel-parser/test/fixtures/experimental/import-assertions/valid-syntax-export-with-no-type-attribute/output.json +++ b/packages/babel-parser/test/fixtures/experimental/import-assertions/valid-syntax-export-with-no-type-attribute/output.json @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":55,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":55}}, "errors": [ - "SyntaxError: The only accepted module attribute is `type` (1:40)" + { + "$$ babel internal serialized type": "Error", + "message": "The only accepted module attribute is `type` (1:40)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "ModuleAttributeDifferentFromType" + } ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/experimental/import-assertions/valid-syntax-export-with-object-method-attribute/output.json b/packages/babel-parser/test/fixtures/experimental/import-assertions/valid-syntax-export-with-object-method-attribute/output.json index 7a44aa2b8d85..31269e316b55 100644 --- a/packages/babel-parser/test/fixtures/experimental/import-assertions/valid-syntax-export-with-object-method-attribute/output.json +++ b/packages/babel-parser/test/fixtures/experimental/import-assertions/valid-syntax-export-with-object-method-attribute/output.json @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":79,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":79}}, "errors": [ - "SyntaxError: The only accepted module attribute is `type` (1:54)" + { + "$$ babel internal serialized type": "Error", + "message": "The only accepted module attribute is `type` (1:54)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "ModuleAttributeDifferentFromType" + } ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/experimental/import-assertions/valid-syntax-export-with-repeated-type/output.json b/packages/babel-parser/test/fixtures/experimental/import-assertions/valid-syntax-export-with-repeated-type/output.json index 4c24d416cc23..b0b70b74789c 100644 --- a/packages/babel-parser/test/fixtures/experimental/import-assertions/valid-syntax-export-with-repeated-type/output.json +++ b/packages/babel-parser/test/fixtures/experimental/import-assertions/valid-syntax-export-with-repeated-type/output.json @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":69,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":69}}, "errors": [ - "SyntaxError: Duplicate key \"type\" is not allowed in module attributes (1:54)" + { + "$$ babel internal serialized type": "Error", + "message": "Duplicate key \"type\" is not allowed in module attributes (1:54)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "ModuleAttributesWithDuplicateKeys" + } ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/experimental/import-assertions/valid-syntax-with-no-type-attribute/output.json b/packages/babel-parser/test/fixtures/experimental/import-assertions/valid-syntax-with-no-type-attribute/output.json index 69a02fc5865f..98f1d16ca1ac 100644 --- a/packages/babel-parser/test/fixtures/experimental/import-assertions/valid-syntax-with-no-type-attribute/output.json +++ b/packages/babel-parser/test/fixtures/experimental/import-assertions/valid-syntax-with-no-type-attribute/output.json @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":51,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":51}}, "errors": [ - "SyntaxError: The only accepted module attribute is `type` (1:36)" + { + "$$ babel internal serialized type": "Error", + "message": "The only accepted module attribute is `type` (1:36)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "ModuleAttributeDifferentFromType" + } ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/experimental/import-assertions/valid-syntax-with-object-method-attribute/output.json b/packages/babel-parser/test/fixtures/experimental/import-assertions/valid-syntax-with-object-method-attribute/output.json index 4259ecc0ee05..7b46e4a93805 100644 --- a/packages/babel-parser/test/fixtures/experimental/import-assertions/valid-syntax-with-object-method-attribute/output.json +++ b/packages/babel-parser/test/fixtures/experimental/import-assertions/valid-syntax-with-object-method-attribute/output.json @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":75,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":75}}, "errors": [ - "SyntaxError: The only accepted module attribute is `type` (1:50)" + { + "$$ babel internal serialized type": "Error", + "message": "The only accepted module attribute is `type` (1:50)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "ModuleAttributeDifferentFromType" + } ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/experimental/module-attributes/import-with-statement/output.json b/packages/babel-parser/test/fixtures/experimental/module-attributes/import-with-statement/output.json index cccb9e1b329d..8a20496d4c72 100644 --- a/packages/babel-parser/test/fixtures/experimental/module-attributes/import-with-statement/output.json +++ b/packages/babel-parser/test/fixtures/experimental/module-attributes/import-with-statement/output.json @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":21,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":10}}, "errors": [ - "SyntaxError: 'with' in strict mode (2:0)" + { + "$$ babel internal serialized type": "Error", + "message": "'with' in strict mode (2:0)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "StrictWith" + } ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/experimental/module-attributes/incorrect-arity/output.json b/packages/babel-parser/test/fixtures/experimental/module-attributes/incorrect-arity/output.json index fbc2d14ad598..abeff1034ecf 100644 --- a/packages/babel-parser/test/fixtures/experimental/module-attributes/incorrect-arity/output.json +++ b/packages/babel-parser/test/fixtures/experimental/module-attributes/incorrect-arity/output.json @@ -2,8 +2,20 @@ "type": "File", "start":0,"end":73,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":63}}, "errors": [ - "SyntaxError: import() requires exactly one or two arguments (1:0)", - "SyntaxError: import() requires exactly one or two arguments (2:0)" + { + "$$ babel internal serialized type": "Error", + "message": "import() requires exactly one or two arguments (1:0)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "ImportCallArity" + }, + { + "$$ babel internal serialized type": "Error", + "message": "import() requires exactly one or two arguments (2:0)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "ImportCallArity" + } ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/experimental/module-attributes/invalid-spread-element-import-call/output.json b/packages/babel-parser/test/fixtures/experimental/module-attributes/invalid-spread-element-import-call/output.json index f016f97336e9..addaa4fedbac 100644 --- a/packages/babel-parser/test/fixtures/experimental/module-attributes/invalid-spread-element-import-call/output.json +++ b/packages/babel-parser/test/fixtures/experimental/module-attributes/invalid-spread-element-import-call/output.json @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":28,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":28}}, "errors": [ - "SyntaxError: ... is not allowed in import() (1:21)" + { + "$$ babel internal serialized type": "Error", + "message": "... is not allowed in import() (1:21)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "ImportCallSpreadArgument" + } ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/experimental/module-attributes/valid-syntax-with-no-type-attribute/output.json b/packages/babel-parser/test/fixtures/experimental/module-attributes/valid-syntax-with-no-type-attribute/output.json index a3bbfd621562..ddceeda3ce05 100644 --- a/packages/babel-parser/test/fixtures/experimental/module-attributes/valid-syntax-with-no-type-attribute/output.json +++ b/packages/babel-parser/test/fixtures/experimental/module-attributes/valid-syntax-with-no-type-attribute/output.json @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":45,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":45}}, "errors": [ - "SyntaxError: The only accepted module attribute is `type` (1:32)" + { + "$$ babel internal serialized type": "Error", + "message": "The only accepted module attribute is `type` (1:32)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "ModuleAttributeDifferentFromType" + } ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/experimental/module-attributes/valid-syntax-with-object-method-attribute/output.json b/packages/babel-parser/test/fixtures/experimental/module-attributes/valid-syntax-with-object-method-attribute/output.json index 12af675ae8b5..78209c1cc62e 100644 --- a/packages/babel-parser/test/fixtures/experimental/module-attributes/valid-syntax-with-object-method-attribute/output.json +++ b/packages/babel-parser/test/fixtures/experimental/module-attributes/valid-syntax-with-object-method-attribute/output.json @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":69,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":69}}, "errors": [ - "SyntaxError: The only accepted module attribute is `type` (1:46)" + { + "$$ babel internal serialized type": "Error", + "message": "The only accepted module attribute is `type` (1:46)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "ModuleAttributeDifferentFromType" + } ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/experimental/module-attributes/valid-syntax-with-repeated-type/output.json b/packages/babel-parser/test/fixtures/experimental/module-attributes/valid-syntax-with-repeated-type/output.json index ad53ece6e4dc..4b43559f87b5 100644 --- a/packages/babel-parser/test/fixtures/experimental/module-attributes/valid-syntax-with-repeated-type/output.json +++ b/packages/babel-parser/test/fixtures/experimental/module-attributes/valid-syntax-with-repeated-type/output.json @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":59,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":59}}, "errors": [ - "SyntaxError: Duplicate key \"type\" is not allowed in module attributes (1:46)" + { + "$$ babel internal serialized type": "Error", + "message": "Duplicate key \"type\" is not allowed in module attributes (1:46)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "ModuleAttributesWithDuplicateKeys" + } ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/experimental/module-blocks/invalid-await-label-in-module-blocks/output.json b/packages/babel-parser/test/fixtures/experimental/module-blocks/invalid-await-label-in-module-blocks/output.json index 5b7d9f6731e8..e91cc04c559b 100644 --- a/packages/babel-parser/test/fixtures/experimental/module-blocks/invalid-await-label-in-module-blocks/output.json +++ b/packages/babel-parser/test/fixtures/experimental/module-blocks/invalid-await-label-in-module-blocks/output.json @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":20,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":20}}, "errors": [ - "SyntaxError: Unexpected reserved word 'await' (1:9)" + { + "$$ babel internal serialized type": "Error", + "message": "Unexpected reserved word 'await' (1:9)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "UnexpectedReservedWord" + } ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/experimental/module-blocks/invalid-class-in-module-blocks/output.json b/packages/babel-parser/test/fixtures/experimental/module-blocks/invalid-class-in-module-blocks/output.json index 86b7e8c0c9e4..95bafe62529e 100644 --- a/packages/babel-parser/test/fixtures/experimental/module-blocks/invalid-class-in-module-blocks/output.json +++ b/packages/babel-parser/test/fixtures/experimental/module-blocks/invalid-class-in-module-blocks/output.json @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":73,"loc":{"start":{"line":1,"column":0},"end":{"line":7,"column":1}}, "errors": [ - "SyntaxError: Private name #p is not defined (4:22)" + { + "$$ babel internal serialized type": "Error", + "message": "Private name #p is not defined (4:22)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "InvalidPrivateFieldResolution" + } ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/experimental/module-blocks/invalid-duplicated-exports-in-blocks/output.json b/packages/babel-parser/test/fixtures/experimental/module-blocks/invalid-duplicated-exports-in-blocks/output.json index b8619d58108e..a9bb11d3f8b6 100644 --- a/packages/babel-parser/test/fixtures/experimental/module-blocks/invalid-duplicated-exports-in-blocks/output.json +++ b/packages/babel-parser/test/fixtures/experimental/module-blocks/invalid-duplicated-exports-in-blocks/output.json @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":67,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":2}}, "errors": [ - "SyntaxError: `foo` has already been exported. Exported identifiers must be unique. (3:11)" + { + "$$ babel internal serialized type": "Error", + "message": "`foo` has already been exported. Exported identifiers must be unique. (3:11)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "DuplicateExport" + } ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/experimental/module-blocks/invalid-undefined-export-in-module-blocks01/output.json b/packages/babel-parser/test/fixtures/experimental/module-blocks/invalid-undefined-export-in-module-blocks01/output.json index 571c2383d6ec..f3cbd1b12fb4 100644 --- a/packages/babel-parser/test/fixtures/experimental/module-blocks/invalid-undefined-export-in-module-blocks01/output.json +++ b/packages/babel-parser/test/fixtures/experimental/module-blocks/invalid-undefined-export-in-module-blocks01/output.json @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":27,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "errors": [ - "SyntaxError: Export 'foo' is not defined (2:11)" + { + "$$ babel internal serialized type": "Error", + "message": "Export 'foo' is not defined (2:11)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "ModuleExportUndefined" + } ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/experimental/module-blocks/invalid-undefined-export-in-module-blocks02/output.json b/packages/babel-parser/test/fixtures/experimental/module-blocks/invalid-undefined-export-in-module-blocks02/output.json index bd11a6632a11..075d8bef63c8 100644 --- a/packages/babel-parser/test/fixtures/experimental/module-blocks/invalid-undefined-export-in-module-blocks02/output.json +++ b/packages/babel-parser/test/fixtures/experimental/module-blocks/invalid-undefined-export-in-module-blocks02/output.json @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":37,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "errors": [ - "SyntaxError: Export 'foo' is not defined (3:11)" + { + "$$ babel internal serialized type": "Error", + "message": "Export 'foo' is not defined (3:11)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "ModuleExportUndefined" + } ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/experimental/module-string-names/duplicate-exported-binding-check/output.json b/packages/babel-parser/test/fixtures/experimental/module-string-names/duplicate-exported-binding-check/output.json index 3888df67614c..cea8289599c6 100644 --- a/packages/babel-parser/test/fixtures/experimental/module-string-names/duplicate-exported-binding-check/output.json +++ b/packages/babel-parser/test/fixtures/experimental/module-string-names/duplicate-exported-binding-check/output.json @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":54,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":28}}, "errors": [ - "SyntaxError: `foo` has already been exported. Exported identifiers must be unique. (2:14)" + { + "$$ babel internal serialized type": "Error", + "message": "`foo` has already been exported. Exported identifiers must be unique. (2:14)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "DuplicateExport" + } ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/experimental/module-string-names/export-name-has-lone-surrogate/output.json b/packages/babel-parser/test/fixtures/experimental/module-string-names/export-name-has-lone-surrogate/output.json index 8beba46012b2..355bc9d12d8d 100644 --- a/packages/babel-parser/test/fixtures/experimental/module-string-names/export-name-has-lone-surrogate/output.json +++ b/packages/babel-parser/test/fixtures/experimental/module-string-names/export-name-has-lone-surrogate/output.json @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":127,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":52}}, "errors": [ - "SyntaxError: An export name cannot include a lone surrogate, found '\\ud800' (2:16)" + { + "$$ babel internal serialized type": "Error", + "message": "An export name cannot include a lone surrogate, found '\\ud800' (2:16)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "ModuleExportNameHasLoneSurrogate" + } ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/experimental/module-string-names/string-exported-binding-without-from/output.json b/packages/babel-parser/test/fixtures/experimental/module-string-names/string-exported-binding-without-from/output.json index 5bfdc8b3f96e..680e713865ae 100644 --- a/packages/babel-parser/test/fixtures/experimental/module-string-names/string-exported-binding-without-from/output.json +++ b/packages/babel-parser/test/fixtures/experimental/module-string-names/string-exported-binding-without-from/output.json @@ -2,8 +2,20 @@ "type": "File", "start":0,"end":45,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":45}}, "errors": [ - "SyntaxError: A string literal cannot be used as an exported binding without `from`.\n- Did you mean `export { '學而時習之,不亦說乎?' as '學而時習之,不亦說乎?' } from 'some-module'`? (1:9)", - "SyntaxError: A string literal cannot be used as an exported binding without `from`.\n- Did you mean `export { '吾道一以貫之。' as '忠恕。' } from 'some-module'`? (1:24)" + { + "$$ babel internal serialized type": "Error", + "message": "A string literal cannot be used as an exported binding without `from`.\n- Did you mean `export { '學而時習之,不亦說乎?' as '學而時習之,不亦說乎?' } from 'some-module'`? (1:9)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "ExportBindingIsString" + }, + { + "$$ babel internal serialized type": "Error", + "message": "A string literal cannot be used as an exported binding without `from`.\n- Did you mean `export { '吾道一以貫之。' as '忠恕。' } from 'some-module'`? (1:24)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "ExportBindingIsString" + } ], "program": { "type": "Program", 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 f92740eabc90..9935799970a1 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 @@ -2,8 +2,20 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "Unexpected argument placeholder (3:16)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "UnexpectedArgumentPlaceholder" + }, + { + "$$ babel internal serialized type": "Error", + "message": "Unexpected argument placeholder (3:19)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "UnexpectedArgumentPlaceholder" + } ], "program": { "type": "Program", @@ -103,12 +115,12 @@ "type": "ThisExpression", "start":69,"end":73,"loc":{"start":{"line":4,"column":4},"end":{"line":4,"column":8}} }, + "computed": false, "property": { "type": "Identifier", "start":74,"end":75,"loc":{"start":{"line":4,"column":9},"end":{"line":4,"column":10},"identifierName":"x"}, "name": "x" - }, - "computed": false + } }, "right": { "type": "Identifier", 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 6b08f2e6eb24..e6c9f9c0d1b1 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 @@ -2,8 +2,20 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "Unexpected argument placeholder (1:11)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "UnexpectedArgumentPlaceholder" + }, + { + "$$ babel internal serialized type": "Error", + "message": "Unexpected argument placeholder (1:17)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "UnexpectedArgumentPlaceholder" + } ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-fsharp-ban-await-f/output.json b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-fsharp-ban-await-f/output.json index f62c456f95b6..c774423a79d8 100644 --- a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-fsharp-ban-await-f/output.json +++ b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-fsharp-ban-await-f/output.json @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":49,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "errors": [ - "SyntaxError: Missing semicolon (2:19)" + { + "$$ babel internal serialized type": "Error", + "message": "Missing semicolon (2:19)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "MissingSemicolon" + } ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-fsharp-invalid-primary-topic/output.json b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-fsharp-invalid-primary-topic/output.json index 6c724302e0b3..310ba0512bf3 100644 --- a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-fsharp-invalid-primary-topic/output.json +++ b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-fsharp-invalid-primary-topic/output.json @@ -2,8 +2,20 @@ "type": "File", "start":0,"end":10,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":10}}, "errors": [ - "SyntaxError: Primary Topic Reference found but pipelineOperator not passed 'smart' for 'proposal' option. (1:5)", - "SyntaxError: Topic reference was used in a lexical context without topic binding (1:5)" + { + "$$ babel internal serialized type": "Error", + "message": "Primary Topic Reference found but pipelineOperator not passed 'smart' for 'proposal' option. (1:5)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "PrimaryTopicRequiresSmartPipeline" + }, + { + "$$ babel internal serialized type": "Error", + "message": "Topic reference was used in a lexical context without topic binding (1:5)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "PrimaryTopicNotAllowed" + } ], "program": { "type": "Program", 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 21cf0ef9779b..28d1bd205f79 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 @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "Pipeline head should not be a comma-separated sequence expression (1:0)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "PipelineHeadSequenceExpression" + } ], "program": { "type": "Program", @@ -19,6 +25,10 @@ "left": { "type": "SequenceExpression", "start":1,"end":5,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":5}}, + "extra": { + "parenthesized": true, + "parenStart": 0 + }, "expressions": [ { "type": "NumericLiteral", @@ -38,11 +48,7 @@ }, "value": 2 } - ], - "extra": { - "parenthesized": true, - "parenStart": 0 - } + ] }, "operator": "|>", "right": { 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 d7262f7ab729..0f12bf09f177 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 @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "Pipeline is in topic style but does not use topic reference (1:5)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "PipelineTopicUnused" + } ], "program": { "type": "Program", @@ -28,6 +34,10 @@ "expression": { "type": "ArrowFunctionExpression", "start":6,"end":17,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":17}}, + "extra": { + "parenthesized": true, + "parenStart": 5 + }, "id": null, "generator": false, "async": false, @@ -56,10 +66,6 @@ "name": "f" } } - }, - "extra": { - "parenthesized": true, - "parenStart": 5 } } } 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 e8ce055d0d81..a11bd4a7686d 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 @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "Pipeline is in topic style but does not use topic reference (1:16)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "PipelineTopicUnused" + } ], "program": { "type": "Program", @@ -28,6 +34,10 @@ "expression": { "type": "ArrowFunctionExpression", "start":6,"end":21,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":21}}, + "extra": { + "parenthesized": true, + "parenStart": 5 + }, "id": null, "generator": false, "async": false, @@ -69,10 +79,6 @@ } } } - }, - "extra": { - "parenthesized": true, - "parenStart": 5 } } } 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 1c55597d1ea8..ba887ddf6199 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 @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "Pipeline is in topic style but does not use topic reference (1:5)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "PipelineTopicUnused" + } ], "program": { "type": "Program", @@ -28,6 +34,10 @@ "expression": { "type": "ArrowFunctionExpression", "start":6,"end":17,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":17}}, + "extra": { + "parenthesized": true, + "parenStart": 5 + }, "id": null, "generator": false, "async": false, @@ -55,10 +65,6 @@ "start":16,"end":17,"loc":{"start":{"line":1,"column":16},"end":{"line":1,"column":17}} } } - }, - "extra": { - "parenthesized": true, - "parenStart": 5 } } } diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/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 4e08420cc88a..29f29651cb6b 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 @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "Pipeline is in topic style but does not use topic reference (1:11)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "PipelineTopicUnused" + } ], "program": { "type": "Program", @@ -28,6 +34,10 @@ "expression": { "type": "BinaryExpression", "start":6,"end":14,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":14}}, + "extra": { + "parenthesized": true, + "parenStart": 5 + }, "left": { "type": "PipelinePrimaryTopicReference", "start":6,"end":7,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":7}} @@ -46,10 +56,6 @@ }, "arguments": [] } - }, - "extra": { - "parenthesized": true, - "parenStart": 5 } } } 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 9c89df8ebff9..fa72922523a8 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 @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "Pipeline is in topic style but does not use topic reference (1:5)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "PipelineTopicUnused" + } ], "program": { "type": "Program", @@ -28,6 +34,10 @@ "expression": { "type": "BinaryExpression", "start":6,"end":12,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":12}}, + "extra": { + "parenthesized": true, + "parenStart": 5 + }, "left": { "type": "Identifier", "start":6,"end":7,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":7},"identifierName":"$"}, @@ -42,10 +52,6 @@ "start":11,"end":12,"loc":{"start":{"line":1,"column":11},"end":{"line":1,"column":12},"identifierName":"f"}, "name": "f" } - }, - "extra": { - "parenthesized": true, - "parenStart": 5 } } } diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/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 f4a75092e3cf..079e1129635d 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 @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "Pipeline body may not be a comma-separated sequence expression (1:6)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "PipelineBodySequenceExpression" + } ], "program": { "type": "Program", @@ -35,6 +41,10 @@ "expression": { "type": "SequenceExpression", "start":7,"end":11,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":11}}, + "extra": { + "parenthesized": true, + "parenStart": 6 + }, "expressions": [ { "type": "PipelinePrimaryTopicReference", @@ -44,11 +54,7 @@ "type": "PipelinePrimaryTopicReference", "start":10,"end":11,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":11}} } - ], - "extra": { - "parenthesized": true, - "parenStart": 6 - } + ] } } }, diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/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 c774d9cb44f7..84ef8d748439 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 @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "Pipeline body may not be a comma-separated sequence expression (1:6)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "PipelineBodySequenceExpression" + } ], "program": { "type": "Program", @@ -32,6 +38,10 @@ "expression": { "type": "SequenceExpression", "start":7,"end":11,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":11}}, + "extra": { + "parenthesized": true, + "parenStart": 6 + }, "expressions": [ { "type": "PipelinePrimaryTopicReference", @@ -41,11 +51,7 @@ "type": "PipelinePrimaryTopicReference", "start":10,"end":11,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":11}} } - ], - "extra": { - "parenthesized": true, - "parenStart": 6 - } + ] } } } diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/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 556699d07afc..405434134981 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 @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "Pipeline is in topic style but does not use topic reference (1:9)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "PipelineTopicUnused" + } ], "program": { "type": "Program", @@ -33,12 +39,12 @@ "start":9,"end":10,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":10},"identifierName":"a"}, "name": "a" }, + "computed": true, "property": { "type": "Identifier", "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 6e09acd357ab..88342e942741 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 @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "Pipeline is in topic style but does not use topic reference (1:9)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "PipelineTopicUnused" + } ], "program": { "type": "Program", 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 4c0d88c5a719..280f7e8182a6 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 @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "Pipeline is in topic style but does not use topic reference (1:9)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "PipelineTopicUnused" + } ], "program": { "type": "Program", 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 18fa5a9166ad..403943d49cc5 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 @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "Pipeline is in topic style but does not use topic reference (1:9)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "PipelineTopicUnused" + } ], "program": { "type": "Program", 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 06a45df42fac..ed653c2291d1 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 @@ -2,8 +2,20 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "Topic reference was used in a lexical context without topic binding (1:22)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "PrimaryTopicNotAllowed" + }, + { + "$$ babel internal serialized type": "Error", + "message": "Pipeline is in topic style but does not use topic reference (1:9)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "PipelineTopicUnused" + } ], "program": { "type": "Program", 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 e673a7df67c9..6e0d408a9888 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 @@ -2,8 +2,20 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "Topic reference was used in a lexical context without topic binding (2:48)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "PrimaryTopicNotAllowed" + }, + { + "$$ babel internal serialized type": "Error", + "message": "Pipeline is in topic style but does not use topic reference (2:11)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "PipelineTopicUnused" + } ], "program": { "type": "Program", 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 b413aeb837f3..eac0fb7101da 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 @@ -2,8 +2,20 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "Topic reference was used in a lexical context without topic binding (1:45)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "PrimaryTopicNotAllowed" + }, + { + "$$ babel internal serialized type": "Error", + "message": "Pipeline is in topic style but does not use topic reference (1:9)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "PipelineTopicUnused" + } ], "program": { "type": "Program", 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 f907f6c39b60..e83ba62b93fb 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 @@ -2,8 +2,20 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "Topic reference was used in a lexical context without topic binding (1:32)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "PrimaryTopicNotAllowed" + }, + { + "$$ babel internal serialized type": "Error", + "message": "Pipeline is in topic style but does not use topic reference (1:9)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "PipelineTopicUnused" + } ], "program": { "type": "Program", 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 b5610cbd5590..e8fcdc745a6b 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 @@ -2,8 +2,20 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "Topic reference was used in a lexical context without topic binding (1:34)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "PrimaryTopicNotAllowed" + }, + { + "$$ babel internal serialized type": "Error", + "message": "Pipeline is in topic style but does not use topic reference (1:9)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "PipelineTopicUnused" + } ], "program": { "type": "Program", 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 cd596f541bf2..54430dd9bd08 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 @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "Topic reference was used in a lexical context without topic binding (3:32)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "PrimaryTopicNotAllowed" + } ], "program": { "type": "Program", @@ -53,12 +59,12 @@ "start":22,"end":26,"loc":{"start":{"line":2,"column":8},"end":{"line":2,"column":12},"identifierName":"JSON"}, "name": "JSON" }, + "computed": false, "property": { "type": "Identifier", "start":27,"end":32,"loc":{"start":{"line":2,"column":13},"end":{"line":2,"column":18},"identifierName":"parse"}, "name": "parse" - }, - "computed": false + } }, "arguments": [ { @@ -97,12 +103,12 @@ "start":57,"end":64,"loc":{"start":{"line":3,"column":18},"end":{"line":3,"column":25},"identifierName":"console"}, "name": "console" }, + "computed": false, "property": { "type": "Identifier", "start":65,"end":70,"loc":{"start":{"line":3,"column":26},"end":{"line":3,"column":31},"identifierName":"error"}, "name": "error" - }, - "computed": false + } }, "arguments": [ { 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 cde715cc8a70..e9c63f164b50 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 @@ -2,8 +2,20 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "Topic reference was used in a lexical context without topic binding (1:34)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "PrimaryTopicNotAllowed" + }, + { + "$$ babel internal serialized type": "Error", + "message": "Pipeline is in topic style but does not use topic reference (1:9)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "PipelineTopicUnused" + } ], "program": { "type": "Program", 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 10719f0083a3..4abe890effa5 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 @@ -2,8 +2,20 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "Topic reference was used in a lexical context without topic binding (1:24)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "PrimaryTopicNotAllowed" + }, + { + "$$ babel internal serialized type": "Error", + "message": "Pipeline is in topic style but does not use topic reference (1:9)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "PipelineTopicUnused" + } ], "program": { "type": "Program", 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 499705448de1..1b6960472d6d 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 @@ -2,8 +2,20 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "Topic reference was used in a lexical context without topic binding (1:39)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "PrimaryTopicNotAllowed" + }, + { + "$$ babel internal serialized type": "Error", + "message": "Pipeline is in topic style but does not use topic reference (1:5)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "PipelineTopicUnused" + } ], "program": { "type": "Program", @@ -68,12 +80,12 @@ "type": "ThisExpression", "start":30,"end":34,"loc":{"start":{"line":1,"column":30},"end":{"line":1,"column":34}} }, + "computed": false, "property": { "type": "Identifier", "start":35,"end":36,"loc":{"start":{"line":1,"column":35},"end":{"line":1,"column":36},"identifierName":"x"}, "name": "x" - }, - "computed": false + } }, "right": { "type": "PipelinePrimaryTopicReference", 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 1aa91e74b179..b21ebf40a093 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 @@ -2,8 +2,20 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "Topic reference was used in a lexical context without topic binding (1:19)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "PrimaryTopicNotAllowed" + }, + { + "$$ babel internal serialized type": "Error", + "message": "Pipeline is in topic style but does not use topic reference (1:5)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "PipelineTopicUnused" + } ], "program": { "type": "Program", 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 6c2b7a1acf34..47115b179a29 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 @@ -2,8 +2,20 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "Topic reference was used in a lexical context without topic binding (1:19)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "PrimaryTopicNotAllowed" + }, + { + "$$ babel internal serialized type": "Error", + "message": "Pipeline is in topic style but does not use topic reference (1:5)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "PipelineTopicUnused" + } ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/experimental/private-in/private-binary-expression-left/output.json b/packages/babel-parser/test/fixtures/experimental/private-in/private-binary-expression-left/output.json index d641de74a78d..b2f63a8e3e70 100644 --- a/packages/babel-parser/test/fixtures/experimental/private-in/private-binary-expression-left/output.json +++ b/packages/babel-parser/test/fixtures/experimental/private-in/private-binary-expression-left/output.json @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":50,"loc":{"start":{"line":1,"column":0},"end":{"line":6,"column":1}}, "errors": [ - "SyntaxError: Private names are only allowed in property accesses (`obj.#x`) or in `in` expressions (`#x in obj`) (4:7)" + { + "$$ babel internal serialized type": "Error", + "message": "Private names are only allowed in property accesses (`obj.#x`) or in `in` expressions (`#x in obj`) (4:7)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "PrivateInExpectedIn" + } ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/experimental/private-in/private-binary-expression-right/output.json b/packages/babel-parser/test/fixtures/experimental/private-in/private-binary-expression-right/output.json index b6dd5e0efde8..c276c073530c 100644 --- a/packages/babel-parser/test/fixtures/experimental/private-in/private-binary-expression-right/output.json +++ b/packages/babel-parser/test/fixtures/experimental/private-in/private-binary-expression-right/output.json @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":50,"loc":{"start":{"line":1,"column":0},"end":{"line":6,"column":1}}, "errors": [ - "SyntaxError: Private names are only allowed in property accesses (`obj.#x`) or in `in` expressions (`#x in obj`) (4:10)" + { + "$$ babel internal serialized type": "Error", + "message": "Private names are only allowed in property accesses (`obj.#x`) or in `in` expressions (`#x in obj`) (4:10)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "PrivateInExpectedIn" + } ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/experimental/private-in/private-expression/output.json b/packages/babel-parser/test/fixtures/experimental/private-in/private-expression/output.json index f690ece03932..bdcb1b19aa36 100644 --- a/packages/babel-parser/test/fixtures/experimental/private-in/private-expression/output.json +++ b/packages/babel-parser/test/fixtures/experimental/private-in/private-expression/output.json @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":46,"loc":{"start":{"line":1,"column":0},"end":{"line":6,"column":1}}, "errors": [ - "SyntaxError: Private names are only allowed in property accesses (`obj.#x`) or in `in` expressions (`#x in obj`) (4:6)" + { + "$$ babel internal serialized type": "Error", + "message": "Private names are only allowed in property accesses (`obj.#x`) or in `in` expressions (`#x in obj`) (4:6)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "PrivateInExpectedIn" + } ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/experimental/private-in/private-in-parenthesized/output.json b/packages/babel-parser/test/fixtures/experimental/private-in/private-in-parenthesized/output.json index fa97d8cdcf31..eed125a8d679 100644 --- a/packages/babel-parser/test/fixtures/experimental/private-in/private-in-parenthesized/output.json +++ b/packages/babel-parser/test/fixtures/experimental/private-in/private-in-parenthesized/output.json @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":54,"loc":{"start":{"line":1,"column":0},"end":{"line":6,"column":1}}, "errors": [ - "SyntaxError: Private names are only allowed in property accesses (`obj.#x`) or in `in` expressions (`#x in obj`) (4:7)" + { + "$$ babel internal serialized type": "Error", + "message": "Private names are only allowed in property accesses (`obj.#x`) or in `in` expressions (`#x in obj`) (4:7)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "PrivateInExpectedIn" + } ], "program": { "type": "Program", @@ -74,14 +80,14 @@ "left": { "type": "PrivateName", "start":38,"end":40,"loc":{"start":{"line":4,"column":5},"end":{"line":4,"column":7}}, + "extra": { + "parenthesized": true, + "parenStart": 37 + }, "id": { "type": "Identifier", "start":39,"end":40,"loc":{"start":{"line":4,"column":6},"end":{"line":4,"column":7},"identifierName":"x"}, "name": "x" - }, - "extra": { - "parenthesized": true, - "parenStart": 37 } }, "operator": "in", diff --git a/packages/babel-parser/test/fixtures/experimental/private-in/private-in-without-field/output.json b/packages/babel-parser/test/fixtures/experimental/private-in/private-in-without-field/output.json index faefdfa5404b..b23adcfcd16b 100644 --- a/packages/babel-parser/test/fixtures/experimental/private-in/private-in-without-field/output.json +++ b/packages/babel-parser/test/fixtures/experimental/private-in/private-in-without-field/output.json @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":42,"loc":{"start":{"line":1,"column":0},"end":{"line":5,"column":1}}, "errors": [ - "SyntaxError: Private name #x is not defined (3:4)" + { + "$$ babel internal serialized type": "Error", + "message": "Private name #x is not defined (3:4)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "InvalidPrivateFieldResolution" + } ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/experimental/record-and-tuple/invalid-record-method/output.json b/packages/babel-parser/test/fixtures/experimental/record-and-tuple/invalid-record-method/output.json index b918fb65e408..9a75f2097b7b 100644 --- a/packages/babel-parser/test/fixtures/experimental/record-and-tuple/invalid-record-method/output.json +++ b/packages/babel-parser/test/fixtures/experimental/record-and-tuple/invalid-record-method/output.json @@ -2,11 +2,41 @@ "type": "File", "start":0,"end":69,"loc":{"start":{"line":1,"column":0},"end":{"line":7,"column":1}}, "errors": [ - "SyntaxError: Only properties and spread elements are allowed in record definitions (2:2)", - "SyntaxError: Only properties and spread elements are allowed in record definitions (3:2)", - "SyntaxError: Only properties and spread elements are allowed in record definitions (4:2)", - "SyntaxError: Only properties and spread elements are allowed in record definitions (5:2)", - "SyntaxError: Only properties and spread elements are allowed in record definitions (6:2)" + { + "$$ babel internal serialized type": "Error", + "message": "Only properties and spread elements are allowed in record definitions (2:2)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "InvalidRecordProperty" + }, + { + "$$ babel internal serialized type": "Error", + "message": "Only properties and spread elements are allowed in record definitions (3:2)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "InvalidRecordProperty" + }, + { + "$$ babel internal serialized type": "Error", + "message": "Only properties and spread elements are allowed in record definitions (4:2)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "InvalidRecordProperty" + }, + { + "$$ babel internal serialized type": "Error", + "message": "Only properties and spread elements are allowed in record definitions (5:2)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "InvalidRecordProperty" + }, + { + "$$ babel internal serialized type": "Error", + "message": "Only properties and spread elements are allowed in record definitions (6:2)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "InvalidRecordProperty" + } ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/experimental/record-and-tuple/invalid-record-proto/output.json b/packages/babel-parser/test/fixtures/experimental/record-and-tuple/invalid-record-proto/output.json index 4f409dffa250..cb883576470f 100644 --- a/packages/babel-parser/test/fixtures/experimental/record-and-tuple/invalid-record-proto/output.json +++ b/packages/babel-parser/test/fixtures/experimental/record-and-tuple/invalid-record-proto/output.json @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":20,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":20}}, "errors": [ - "SyntaxError: '__proto__' is not allowed in Record expressions (1:3)" + { + "$$ babel internal serialized type": "Error", + "message": "'__proto__' is not allowed in Record expressions (1:3)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "RecordNoProto" + } ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/experimental/record-and-tuple/invalid-tuple-holes/output.json b/packages/babel-parser/test/fixtures/experimental/record-and-tuple/invalid-tuple-holes/output.json index 40d2d81f688e..12d66ffe9213 100644 --- a/packages/babel-parser/test/fixtures/experimental/record-and-tuple/invalid-tuple-holes/output.json +++ b/packages/babel-parser/test/fixtures/experimental/record-and-tuple/invalid-tuple-holes/output.json @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":4,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":4}}, "errors": [ - "SyntaxError: Unexpected token ',' (1:3)" + { + "$$ babel internal serialized type": "Error", + "message": "Unexpected token ',' (1:3)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "UnexpectedToken" + } ], "program": { "type": "Program", 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 609dda3bbf1b..ced36b58d292 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 @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":5,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":5}}, "errors": [ - "SyntaxError: Invalid escape sequence in template (1:2)" + { + "$$ babel internal serialized type": "Error", + "message": "Invalid escape sequence in template (1:2)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "InvalidEscapeSequenceTemplate" + } ], "program": { "type": "Program", 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 e3b8e5b00191..bc70cfd08cc7 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 @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":14,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":14}}, "errors": [ - "SyntaxError: Invalid escape sequence in template (1:2)" + { + "$$ babel internal serialized type": "Error", + "message": "Invalid escape sequence in template (1:2)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "InvalidEscapeSequenceTemplate" + } ], "program": { "type": "Program", 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 0179dbeaeaff..0ee101907822 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 @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":13,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":13}}, "errors": [ - "SyntaxError: Invalid escape sequence in template (1:10)" + { + "$$ babel internal serialized type": "Error", + "message": "Invalid escape sequence in template (1:10)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "InvalidEscapeSequenceTemplate" + } ], "program": { "type": "Program", 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 3c29809b70f4..c4c58cc26d66 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 @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":22,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":22}}, "errors": [ - "SyntaxError: Invalid escape sequence in template (1:10)" + { + "$$ babel internal serialized type": "Error", + "message": "Invalid escape sequence in template (1:10)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "InvalidEscapeSequenceTemplate" + } ], "program": { "type": "Program", 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 a1809a9c8d81..de0783a43c52 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 @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":6,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":6}}, "errors": [ - "SyntaxError: Invalid escape sequence in template (1:2)" + { + "$$ babel internal serialized type": "Error", + "message": "Invalid escape sequence in template (1:2)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "InvalidEscapeSequenceTemplate" + } ], "program": { "type": "Program", 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 8e236a6eadc1..a1f3a2e82fb3 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 @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":15,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":15}}, "errors": [ - "SyntaxError: Invalid escape sequence in template (1:2)" + { + "$$ babel internal serialized type": "Error", + "message": "Invalid escape sequence in template (1:2)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "InvalidEscapeSequenceTemplate" + } ], "program": { "type": "Program", 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 e7b147232828..5d11097a6a2c 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 @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":14,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":14}}, "errors": [ - "SyntaxError: Invalid escape sequence in template (1:10)" + { + "$$ babel internal serialized type": "Error", + "message": "Invalid escape sequence in template (1:10)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "InvalidEscapeSequenceTemplate" + } ], "program": { "type": "Program", 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 4a43408b0fbc..004963ad1fbd 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 @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":23,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":23}}, "errors": [ - "SyntaxError: Invalid escape sequence in template (1:10)" + { + "$$ babel internal serialized type": "Error", + "message": "Invalid escape sequence in template (1:10)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "InvalidEscapeSequenceTemplate" + } ], "program": { "type": "Program", 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 44c794754aa4..06c2c5b19a07 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 @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":5,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":5}}, "errors": [ - "SyntaxError: Invalid escape sequence in template (1:2)" + { + "$$ babel internal serialized type": "Error", + "message": "Invalid escape sequence in template (1:2)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "InvalidEscapeSequenceTemplate" + } ], "program": { "type": "Program", 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 455448a59aef..a5ea21d0bd4f 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 @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":14,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":14}}, "errors": [ - "SyntaxError: Invalid escape sequence in template (1:2)" + { + "$$ babel internal serialized type": "Error", + "message": "Invalid escape sequence in template (1:2)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "InvalidEscapeSequenceTemplate" + } ], "program": { "type": "Program", 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 8168708424a4..cee4bfa158d8 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 @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":13,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":13}}, "errors": [ - "SyntaxError: Invalid escape sequence in template (1:10)" + { + "$$ babel internal serialized type": "Error", + "message": "Invalid escape sequence in template (1:10)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "InvalidEscapeSequenceTemplate" + } ], "program": { "type": "Program", 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 ce52b8a32780..21c9f0ce572d 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 @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":14,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":14}}, "errors": [ - "SyntaxError: Invalid escape sequence in template (1:2)" + { + "$$ babel internal serialized type": "Error", + "message": "Invalid escape sequence in template (1:2)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "InvalidEscapeSequenceTemplate" + } ], "program": { "type": "Program", 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 35f991fe7e66..c20df3f4b12b 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 @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":22,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":22}}, "errors": [ - "SyntaxError: Invalid escape sequence in template (1:10)" + { + "$$ babel internal serialized type": "Error", + "message": "Invalid escape sequence in template (1:10)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "InvalidEscapeSequenceTemplate" + } ], "program": { "type": "Program", 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 7cb40307353a..58997551c3c0 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 @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":6,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":6}}, "errors": [ - "SyntaxError: Invalid escape sequence in template (1:2)" + { + "$$ babel internal serialized type": "Error", + "message": "Invalid escape sequence in template (1:2)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "InvalidEscapeSequenceTemplate" + } ], "program": { "type": "Program", 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 eff90743fb54..25dd3375855b 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 @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":15,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":15}}, "errors": [ - "SyntaxError: Invalid escape sequence in template (1:2)" + { + "$$ babel internal serialized type": "Error", + "message": "Invalid escape sequence in template (1:2)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "InvalidEscapeSequenceTemplate" + } ], "program": { "type": "Program", 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 1087c48d75b5..bcf8819bd079 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 @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":14,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":14}}, "errors": [ - "SyntaxError: Invalid escape sequence in template (1:10)" + { + "$$ babel internal serialized type": "Error", + "message": "Invalid escape sequence in template (1:10)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "InvalidEscapeSequenceTemplate" + } ], "program": { "type": "Program", 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 c5667acab8c3..6e7faec5cc2d 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 @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":23,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":23}}, "errors": [ - "SyntaxError: Invalid escape sequence in template (1:10)" + { + "$$ babel internal serialized type": "Error", + "message": "Invalid escape sequence in template (1:10)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "InvalidEscapeSequenceTemplate" + } ], "program": { "type": "Program", 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 79f7bd562e1e..38815b474594 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 @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":7,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":7}}, "errors": [ - "SyntaxError: Invalid escape sequence in template (1:2)" + { + "$$ babel internal serialized type": "Error", + "message": "Invalid escape sequence in template (1:2)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "InvalidEscapeSequenceTemplate" + } ], "program": { "type": "Program", 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 4f81da2ce933..94d08cd6e272 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 @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":16,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":16}}, "errors": [ - "SyntaxError: Invalid escape sequence in template (1:2)" + { + "$$ babel internal serialized type": "Error", + "message": "Invalid escape sequence in template (1:2)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "InvalidEscapeSequenceTemplate" + } ], "program": { "type": "Program", 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 723655879b5f..cb4118579856 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 @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":15,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":15}}, "errors": [ - "SyntaxError: Invalid escape sequence in template (1:10)" + { + "$$ babel internal serialized type": "Error", + "message": "Invalid escape sequence in template (1:10)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "InvalidEscapeSequenceTemplate" + } ], "program": { "type": "Program", 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 e4a9490764ce..174f7df6d0d8 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 @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":24,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":24}}, "errors": [ - "SyntaxError: Invalid escape sequence in template (1:10)" + { + "$$ babel internal serialized type": "Error", + "message": "Invalid escape sequence in template (1:10)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "InvalidEscapeSequenceTemplate" + } ], "program": { "type": "Program", 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 da8fed17fc46..f702eab8b43c 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 @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":8,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":8}}, "errors": [ - "SyntaxError: Invalid escape sequence in template (1:2)" + { + "$$ babel internal serialized type": "Error", + "message": "Invalid escape sequence in template (1:2)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "InvalidEscapeSequenceTemplate" + } ], "program": { "type": "Program", 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 7ae0eef00647..447fafa12c79 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 @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":13,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":13}}, "errors": [ - "SyntaxError: Invalid escape sequence in template (1:10)" + { + "$$ babel internal serialized type": "Error", + "message": "Invalid escape sequence in template (1:10)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "InvalidEscapeSequenceTemplate" + } ], "program": { "type": "Program", 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 c24fdfc69ccb..827d20614e04 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 @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":17,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":17}}, "errors": [ - "SyntaxError: Invalid escape sequence in template (1:2)" + { + "$$ babel internal serialized type": "Error", + "message": "Invalid escape sequence in template (1:2)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "InvalidEscapeSequenceTemplate" + } ], "program": { "type": "Program", 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 82c45a0863af..121805247e49 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 @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":16,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":16}}, "errors": [ - "SyntaxError: Invalid escape sequence in template (1:10)" + { + "$$ babel internal serialized type": "Error", + "message": "Invalid escape sequence in template (1:10)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "InvalidEscapeSequenceTemplate" + } ], "program": { "type": "Program", 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 653f4d11577a..1728fa84643e 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 @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":25,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":25}}, "errors": [ - "SyntaxError: Invalid escape sequence in template (1:10)" + { + "$$ babel internal serialized type": "Error", + "message": "Invalid escape sequence in template (1:10)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "InvalidEscapeSequenceTemplate" + } ], "program": { "type": "Program", 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 411c960f4bd9..6bd6f3cd85fc 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 @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":6,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":6}}, "errors": [ - "SyntaxError: Invalid escape sequence in template (1:2)" + { + "$$ babel internal serialized type": "Error", + "message": "Invalid escape sequence in template (1:2)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "InvalidEscapeSequenceTemplate" + } ], "program": { "type": "Program", 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 58f335c032b2..68d7d0c43945 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 @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":15,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":15}}, "errors": [ - "SyntaxError: Invalid escape sequence in template (1:2)" + { + "$$ babel internal serialized type": "Error", + "message": "Invalid escape sequence in template (1:2)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "InvalidEscapeSequenceTemplate" + } ], "program": { "type": "Program", 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 1bb35ed64a9f..6bcec1add38e 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 @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":14,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":14}}, "errors": [ - "SyntaxError: Invalid escape sequence in template (1:10)" + { + "$$ babel internal serialized type": "Error", + "message": "Invalid escape sequence in template (1:10)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "InvalidEscapeSequenceTemplate" + } ], "program": { "type": "Program", 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 b713e29da119..b624b065fc18 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 @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":23,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":23}}, "errors": [ - "SyntaxError: Invalid escape sequence in template (1:10)" + { + "$$ babel internal serialized type": "Error", + "message": "Invalid escape sequence in template (1:10)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "InvalidEscapeSequenceTemplate" + } ], "program": { "type": "Program", 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 f46c259f1f2b..08f1ed03453d 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 @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":8,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":8}}, "errors": [ - "SyntaxError: Invalid escape sequence in template (1:2)" + { + "$$ babel internal serialized type": "Error", + "message": "Invalid escape sequence in template (1:2)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "InvalidEscapeSequenceTemplate" + } ], "program": { "type": "Program", 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 0bc304bb7f24..95ffe8194123 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 @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":17,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":17}}, "errors": [ - "SyntaxError: Invalid escape sequence in template (1:2)" + { + "$$ babel internal serialized type": "Error", + "message": "Invalid escape sequence in template (1:2)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "InvalidEscapeSequenceTemplate" + } ], "program": { "type": "Program", 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 d49ff0ece275..a5fd19a8b2c7 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 @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":16,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":16}}, "errors": [ - "SyntaxError: Invalid escape sequence in template (1:10)" + { + "$$ babel internal serialized type": "Error", + "message": "Invalid escape sequence in template (1:10)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "InvalidEscapeSequenceTemplate" + } ], "program": { "type": "Program", 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 e5802b234722..833a9d04527e 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 @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":22,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":22}}, "errors": [ - "SyntaxError: Invalid escape sequence in template (1:10)" + { + "$$ babel internal serialized type": "Error", + "message": "Invalid escape sequence in template (1:10)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "InvalidEscapeSequenceTemplate" + } ], "program": { "type": "Program", 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 fd45665f95f1..f935af43bf0a 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 @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":25,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":25}}, "errors": [ - "SyntaxError: Invalid escape sequence in template (1:10)" + { + "$$ babel internal serialized type": "Error", + "message": "Invalid escape sequence in template (1:10)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "InvalidEscapeSequenceTemplate" + } ], "program": { "type": "Program", 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 5778cecc9dc6..c9e4cd9c8120 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 @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":7,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":7}}, "errors": [ - "SyntaxError: Invalid escape sequence in template (1:2)" + { + "$$ babel internal serialized type": "Error", + "message": "Invalid escape sequence in template (1:2)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "InvalidEscapeSequenceTemplate" + } ], "program": { "type": "Program", 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 fde0d72e80dd..be98ee07f7a2 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 @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":16,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":16}}, "errors": [ - "SyntaxError: Invalid escape sequence in template (1:2)" + { + "$$ babel internal serialized type": "Error", + "message": "Invalid escape sequence in template (1:2)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "InvalidEscapeSequenceTemplate" + } ], "program": { "type": "Program", 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 ed08a002f952..7b2ba6a344c2 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 @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":15,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":15}}, "errors": [ - "SyntaxError: Invalid escape sequence in template (1:10)" + { + "$$ babel internal serialized type": "Error", + "message": "Invalid escape sequence in template (1:10)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "InvalidEscapeSequenceTemplate" + } ], "program": { "type": "Program", 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 17bae3ae9977..b82311feda49 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 @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":24,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":24}}, "errors": [ - "SyntaxError: Invalid escape sequence in template (1:10)" + { + "$$ babel internal serialized type": "Error", + "message": "Invalid escape sequence in template (1:10)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "InvalidEscapeSequenceTemplate" + } ], "program": { "type": "Program", 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 66c1f8c3f742..ffc6e1ae3e93 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 @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":5,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":5}}, "errors": [ - "SyntaxError: Invalid escape sequence in template (1:2)" + { + "$$ babel internal serialized type": "Error", + "message": "Invalid escape sequence in template (1:2)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "InvalidEscapeSequenceTemplate" + } ], "program": { "type": "Program", 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 e0a9cd51c3a4..e0d950b9ba9d 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 @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":14,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":14}}, "errors": [ - "SyntaxError: Invalid escape sequence in template (1:2)" + { + "$$ babel internal serialized type": "Error", + "message": "Invalid escape sequence in template (1:2)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "InvalidEscapeSequenceTemplate" + } ], "program": { "type": "Program", 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 f6098844bbd8..a280b59a850b 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 @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":13,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":13}}, "errors": [ - "SyntaxError: Invalid escape sequence in template (1:10)" + { + "$$ babel internal serialized type": "Error", + "message": "Invalid escape sequence in template (1:10)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "InvalidEscapeSequenceTemplate" + } ], "program": { "type": "Program", 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 73f36b31b12f..b3280c5dfa47 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 @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":22,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":22}}, "errors": [ - "SyntaxError: Invalid escape sequence in template (1:10)" + { + "$$ babel internal serialized type": "Error", + "message": "Invalid escape sequence in template (1:10)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "InvalidEscapeSequenceTemplate" + } ], "program": { "type": "Program", 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 c20647b9ca75..eacbc55b06e4 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 @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":7,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":7}}, "errors": [ - "SyntaxError: Invalid escape sequence in template (1:2)" + { + "$$ babel internal serialized type": "Error", + "message": "Invalid escape sequence in template (1:2)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "InvalidEscapeSequenceTemplate" + } ], "program": { "type": "Program", 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 6d1d532d73cb..53e26d90a787 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 @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":4,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":4}}, "errors": [ - "SyntaxError: Invalid escape sequence in template (1:2)" + { + "$$ babel internal serialized type": "Error", + "message": "Invalid escape sequence in template (1:2)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "InvalidEscapeSequenceTemplate" + } ], "program": { "type": "Program", 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 14f94a2dfd62..fb14a51002e1 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 @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":16,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":16}}, "errors": [ - "SyntaxError: Invalid escape sequence in template (1:2)" + { + "$$ babel internal serialized type": "Error", + "message": "Invalid escape sequence in template (1:2)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "InvalidEscapeSequenceTemplate" + } ], "program": { "type": "Program", 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 9dc1704ccb9d..0e0eb38df33f 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 @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":15,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":15}}, "errors": [ - "SyntaxError: Invalid escape sequence in template (1:10)" + { + "$$ babel internal serialized type": "Error", + "message": "Invalid escape sequence in template (1:10)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "InvalidEscapeSequenceTemplate" + } ], "program": { "type": "Program", 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 bf1a1f2cd623..b02a31d03106 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 @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":24,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":24}}, "errors": [ - "SyntaxError: Invalid escape sequence in template (1:10)" + { + "$$ babel internal serialized type": "Error", + "message": "Invalid escape sequence in template (1:10)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "InvalidEscapeSequenceTemplate" + } ], "program": { "type": "Program", 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 a091d166a9cd..5bd02c3cff3a 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 @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":7,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":7}}, "errors": [ - "SyntaxError: Invalid escape sequence in template (1:2)" + { + "$$ babel internal serialized type": "Error", + "message": "Invalid escape sequence in template (1:2)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "InvalidEscapeSequenceTemplate" + } ], "program": { "type": "Program", 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 00c9046112e0..3ae9fc3739d8 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 @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":16,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":16}}, "errors": [ - "SyntaxError: Invalid escape sequence in template (1:2)" + { + "$$ babel internal serialized type": "Error", + "message": "Invalid escape sequence in template (1:2)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "InvalidEscapeSequenceTemplate" + } ], "program": { "type": "Program", 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 1a31ef55aa0f..2e6e8e9db2c1 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 @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":15,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":15}}, "errors": [ - "SyntaxError: Invalid escape sequence in template (1:10)" + { + "$$ babel internal serialized type": "Error", + "message": "Invalid escape sequence in template (1:10)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "InvalidEscapeSequenceTemplate" + } ], "program": { "type": "Program", 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 0743ba782383..0bec9e16b1ab 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 @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":24,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":24}}, "errors": [ - "SyntaxError: Invalid escape sequence in template (1:10)" + { + "$$ babel internal serialized type": "Error", + "message": "Invalid escape sequence in template (1:10)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "InvalidEscapeSequenceTemplate" + } ], "program": { "type": "Program", 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 3ca7f733f342..a0d06efb9b1f 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 @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":6,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":6}}, "errors": [ - "SyntaxError: Invalid escape sequence in template (1:2)" + { + "$$ babel internal serialized type": "Error", + "message": "Invalid escape sequence in template (1:2)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "InvalidEscapeSequenceTemplate" + } ], "program": { "type": "Program", 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 dd14b4489249..523c753553d7 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 @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":15,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":15}}, "errors": [ - "SyntaxError: Invalid escape sequence in template (1:2)" + { + "$$ babel internal serialized type": "Error", + "message": "Invalid escape sequence in template (1:2)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "InvalidEscapeSequenceTemplate" + } ], "program": { "type": "Program", 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 46e5846787ca..e1c9a8cdebec 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 @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":14,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":14}}, "errors": [ - "SyntaxError: Invalid escape sequence in template (1:10)" + { + "$$ babel internal serialized type": "Error", + "message": "Invalid escape sequence in template (1:10)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "InvalidEscapeSequenceTemplate" + } ], "program": { "type": "Program", 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 d765a4698e87..4174357ae02e 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 @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":13,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":13}}, "errors": [ - "SyntaxError: Invalid escape sequence in template (1:2)" + { + "$$ babel internal serialized type": "Error", + "message": "Invalid escape sequence in template (1:2)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "InvalidEscapeSequenceTemplate" + } ], "program": { "type": "Program", 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 85fc081b8e3c..f126693b470d 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 @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":23,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":23}}, "errors": [ - "SyntaxError: Invalid escape sequence in template (1:10)" + { + "$$ babel internal serialized type": "Error", + "message": "Invalid escape sequence in template (1:10)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "InvalidEscapeSequenceTemplate" + } ], "program": { "type": "Program", 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 2b9b23d37689..d19c6d4b5dfe 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 @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":10,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":10}}, "errors": [ - "SyntaxError: Invalid escape sequence in template (1:2)" + { + "$$ babel internal serialized type": "Error", + "message": "Invalid escape sequence in template (1:2)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "InvalidEscapeSequenceTemplate" + } ], "program": { "type": "Program", 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 05837f4a9777..f6eafce95e89 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 @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":19,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":19}}, "errors": [ - "SyntaxError: Invalid escape sequence in template (1:2)" + { + "$$ babel internal serialized type": "Error", + "message": "Invalid escape sequence in template (1:2)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "InvalidEscapeSequenceTemplate" + } ], "program": { "type": "Program", 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 aad86fddc422..c468ddc43452 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 @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":18,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":18}}, "errors": [ - "SyntaxError: Invalid escape sequence in template (1:10)" + { + "$$ babel internal serialized type": "Error", + "message": "Invalid escape sequence in template (1:10)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "InvalidEscapeSequenceTemplate" + } ], "program": { "type": "Program", 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 1710ddd99dd0..0b8cd523688b 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 @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":27,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":27}}, "errors": [ - "SyntaxError: Invalid escape sequence in template (1:10)" + { + "$$ babel internal serialized type": "Error", + "message": "Invalid escape sequence in template (1:10)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "InvalidEscapeSequenceTemplate" + } ], "program": { "type": "Program", 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 aee11de08c59..42b1b42a39bc 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 @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":12,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":12}}, "errors": [ - "SyntaxError: Invalid escape sequence in template (1:2)" + { + "$$ babel internal serialized type": "Error", + "message": "Invalid escape sequence in template (1:2)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "InvalidEscapeSequenceTemplate" + } ], "program": { "type": "Program", 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 0e1c9101ebcb..bb160ed14776 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 @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":21,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":21}}, "errors": [ - "SyntaxError: Invalid escape sequence in template (1:2)" + { + "$$ babel internal serialized type": "Error", + "message": "Invalid escape sequence in template (1:2)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "InvalidEscapeSequenceTemplate" + } ], "program": { "type": "Program", 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 c705268ab87a..99c0d0c3c0bc 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 @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":20,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":20}}, "errors": [ - "SyntaxError: Invalid escape sequence in template (1:10)" + { + "$$ babel internal serialized type": "Error", + "message": "Invalid escape sequence in template (1:10)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "InvalidEscapeSequenceTemplate" + } ], "program": { "type": "Program", 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 e7434d46f7a1..6c177e416fe1 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 @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":29,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":29}}, "errors": [ - "SyntaxError: Invalid escape sequence in template (1:10)" + { + "$$ babel internal serialized type": "Error", + "message": "Invalid escape sequence in template (1:10)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "InvalidEscapeSequenceTemplate" + } ], "program": { "type": "Program", 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 5a00ed65e725..b286c5819d41 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 @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":12,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":12}}, "errors": [ - "SyntaxError: Invalid escape sequence in template (1:10)" + { + "$$ babel internal serialized type": "Error", + "message": "Invalid escape sequence in template (1:10)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "InvalidEscapeSequenceTemplate" + } ], "program": { "type": "Program", 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 4d6328f56dd1..e50f547e6be6 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 @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":21,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":21}}, "errors": [ - "SyntaxError: Invalid escape sequence in template (1:10)" + { + "$$ babel internal serialized type": "Error", + "message": "Invalid escape sequence in template (1:10)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "InvalidEscapeSequenceTemplate" + } ], "program": { "type": "Program", 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 e2385a402468..9b4807d5db9f 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 @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":5,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":5}}, "errors": [ - "SyntaxError: Invalid escape sequence in template (1:2)" + { + "$$ babel internal serialized type": "Error", + "message": "Invalid escape sequence in template (1:2)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "InvalidEscapeSequenceTemplate" + } ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/experimental/top-level-await/inside-arrow/output.json b/packages/babel-parser/test/fixtures/experimental/top-level-await/inside-arrow/output.json index 47dbaed6089b..8592265abce2 100644 --- a/packages/babel-parser/test/fixtures/experimental/top-level-await/inside-arrow/output.json +++ b/packages/babel-parser/test/fixtures/experimental/top-level-await/inside-arrow/output.json @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":14,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":14}}, "errors": [ - "SyntaxError: 'await' is only allowed within async functions and at the top levels of modules (1:6)" + { + "$$ babel internal serialized type": "Error", + "message": "'await' is only allowed within async functions and at the top levels of modules (1:6)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "UnexpectedReservedWord" + } ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/experimental/top-level-await/inside-class-property/output.json b/packages/babel-parser/test/fixtures/experimental/top-level-await/inside-class-property/output.json index 71e47b18fa76..e2b78e2fd928 100644 --- a/packages/babel-parser/test/fixtures/experimental/top-level-await/inside-class-property/output.json +++ b/packages/babel-parser/test/fixtures/experimental/top-level-await/inside-class-property/output.json @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":33,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "errors": [ - "SyntaxError: 'await' is only allowed within async functions (2:6)" + { + "$$ babel internal serialized type": "Error", + "message": "'await' is only allowed within async functions (2:6)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "UnexpectedReservedWord" + } ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/experimental/top-level-await/inside-function/output.json b/packages/babel-parser/test/fixtures/experimental/top-level-await/inside-function/output.json index 27236952ad5a..341f05c554a5 100644 --- a/packages/babel-parser/test/fixtures/experimental/top-level-await/inside-function/output.json +++ b/packages/babel-parser/test/fixtures/experimental/top-level-await/inside-function/output.json @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":28,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "errors": [ - "SyntaxError: 'await' is only allowed within async functions and at the top levels of modules (2:2)" + { + "$$ babel internal serialized type": "Error", + "message": "'await' is only allowed within async functions and at the top levels of modules (2:2)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "UnexpectedReservedWord" + } ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/experimental/top-level-await/top-level-script/output.json b/packages/babel-parser/test/fixtures/experimental/top-level-await/top-level-script/output.json index 1b4283b27129..130f328fad13 100644 --- a/packages/babel-parser/test/fixtures/experimental/top-level-await/top-level-script/output.json +++ b/packages/babel-parser/test/fixtures/experimental/top-level-await/top-level-script/output.json @@ -2,7 +2,12 @@ "type": "File", "start":0,"end":8,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":8}}, "errors": [ - "SyntaxError: 'await' is only allowed within async functions and at the top levels of modules (1:0)" + { + "$$ babel internal serialized type": "Error", + "message": "'await' is only allowed within async functions and at the top levels of modules (1:0)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR" + } ], "program": { "type": "Program", 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 7b64fc114305..3758487f2144 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 @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "Initializers are not allowed in fields with the `declare` modifier. (2:17)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "DeclareClassFieldInitializer" + } ], "program": { "type": "Program", 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 ae0f5d34baeb..5df5b7db9643 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 @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "The `declare` modifier can only appear on class fields. (2:2)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "DeclareClassElement" + } ], "program": { "type": "Program", 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 4e384e15aee0..ecdf7e0c6d11 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 @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "The `declare` modifier can only appear on class fields. (2:2)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "DeclareClassElement" + } ], "program": { "type": "Program", 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 8786c334ee5a..966a28e81a63 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 @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "Initializers are not allowed in fields with the `declare` modifier. (2:16)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "DeclareClassFieldInitializer" + } ], "program": { "type": "Program", 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 d8ea7350b595..8c464e7a0d27 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 @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "The `declare` modifier can only appear on class fields. (2:2)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "DeclareClassElement" + } ], "program": { "type": "Program", 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 078602d8aced..1fd824be843b 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 @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "Classes may not have a field named 'constructor' (2:2)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "ConstructorClassField" + } ], "program": { "type": "Program", 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 6f4643e82a44..f3b6cd588c73 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 @@ -2,22 +2,28 @@ "type": "File", "start":0,"end":13,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":13}}, "errors": [ - "SyntaxError: Unterminated flow-comment (1:13)" + { + "$$ babel internal serialized type": "Error", + "message": "Unterminated flow-comment (1:13)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "UnterminatedFlowComment" + } ], "program": { "type": "Program", "start":0,"end":13,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":13}}, - "sourceType": "module", - "interpreter": null, - "body": [], - "directives": [], "innerComments": [ { "type": "CommentLine", "value": "asd */", "start":5,"end":13,"loc":{"start":{"line":1,"column":5},"end":{"line":1,"column":13}} } - ] + ], + "sourceType": "module", + "interpreter": null, + "body": [], + "directives": [] }, "comments": [ { diff --git a/packages/babel-parser/test/fixtures/flow/declare-export/invalid-export-default-var/output.json b/packages/babel-parser/test/fixtures/flow/declare-export/invalid-export-default-var/output.json index 79403b71b304..9ba91f5f4054 100644 --- a/packages/babel-parser/test/fixtures/flow/declare-export/invalid-export-default-var/output.json +++ b/packages/babel-parser/test/fixtures/flow/declare-export/invalid-export-default-var/output.json @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":36,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":36}}, "errors": [ - "SyntaxError: Missing semicolon (1:26)" + { + "$$ babel internal serialized type": "Error", + "message": "Missing semicolon (1:26)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "MissingSemicolon" + } ], "program": { "type": "Program", 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 6b671f1ed633..4d8914881397 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 @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "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)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "AmbiguousDeclareModuleKind" + } ], "program": { "type": "Program", 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 a1bf5fae4b25..2694a254c13a 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 @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "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)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "AmbiguousDeclareModuleKind" + } ], "program": { "type": "Program", 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 6155f8eda4f7..ed8560b2e1c1 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 @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "Imports within a `declare module` body must always be `import type` or `import typeof` (1:21)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "InvalidNonTypeImportInDeclareModule" + } ], "program": { "type": "Program", 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 bd3851fd4f37..a4ab05cd5c9f 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 @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "`declare module` cannot be used inside another `declare module` (1:27)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "NestedDeclareModule" + } ], "program": { "type": "Program", 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 b16aeb7c7e86..29abe7786097 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 @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":88,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":88}}, "errors": [ - "SyntaxError: Duplicate `declare module.exports` statement (1:55)" + { + "$$ babel internal serialized type": "Error", + "message": "Duplicate `declare module.exports` statement (1:55)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "DuplicateDeclareModuleExports" + } ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/flow/declare-statements/invalid-literal/output.json b/packages/babel-parser/test/fixtures/flow/declare-statements/invalid-literal/output.json index 6418fa0d75e6..e0969152506b 100644 --- a/packages/babel-parser/test/fixtures/flow/declare-statements/invalid-literal/output.json +++ b/packages/babel-parser/test/fixtures/flow/declare-statements/invalid-literal/output.json @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":10,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":10}}, "errors": [ - "SyntaxError: Missing semicolon (1:7)" + { + "$$ babel internal serialized type": "Error", + "message": "Missing semicolon (1:7)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "MissingSemicolon" + } ], "program": { "type": "Program", 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 c8d39bd0832c..a21684b3fe5e 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 @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "Boolean enum members need to be initialized. Use either `A = true,` or `A = false,` in enum `E`. (2:2)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "EnumBooleanMemberNotInitialized" + } ], "program": { "type": "Program", @@ -21,9 +27,9 @@ "body": { "type": "EnumBooleanBody", "start":7,"end":26,"loc":{"start":{"line":1,"column":7},"end":{"line":3,"column":1}}, + "hasUnknownMembers": false, "explicitType": true, - "members": [], - "hasUnknownMembers": false + "members": [] } } ], diff --git a/packages/babel-parser/test/fixtures/flow/enum-declaration/boolean-member-not-initialized-implicit/output.json b/packages/babel-parser/test/fixtures/flow/enum-declaration/boolean-member-not-initialized-implicit/output.json index a50af0f91c04..86b719679095 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 @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "Boolean enum members need to be initialized. Use either `A = true,` or `A = false,` in enum `E`. (2:2)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "EnumBooleanMemberNotInitialized" + } ], "program": { "type": "Program", @@ -21,8 +27,8 @@ "body": { "type": "EnumBooleanBody", "start":7,"end":27,"loc":{"start":{"line":1,"column":7},"end":{"line":4,"column":1}}, - "explicitType": false, "hasUnknownMembers": false, + "explicitType": false, "members": [ { "type": "EnumBooleanMember", diff --git a/packages/babel-parser/test/fixtures/flow/enum-declaration/duplicate-member-name/output.json b/packages/babel-parser/test/fixtures/flow/enum-declaration/duplicate-member-name/output.json index 0a31c3040a72..8b9952c78865 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 @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "Enum member names need to be unique, but the name `A` has already been used before in enum `E`. (3:2)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "EnumDuplicateMemberName" + } ], "program": { "type": "Program", @@ -21,6 +27,7 @@ "body": { "type": "EnumStringBody", "start":7,"end":20,"loc":{"start":{"line":1,"column":7},"end":{"line":4,"column":1}}, + "hasUnknownMembers": false, "explicitType": false, "members": [ { @@ -41,8 +48,7 @@ "name": "A" } } - ], - "hasUnknownMembers": false + ] } } ], 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 d39e36c96dd2..094bd6653999 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 @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "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)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "EnumInconsistentMemberValues" + } ], "program": { "type": "Program", @@ -21,9 +27,9 @@ "body": { "type": "EnumStringBody", "start":7,"end":29,"loc":{"start":{"line":1,"column":7},"end":{"line":5,"column":1}}, + "hasUnknownMembers": false, "explicitType": false, - "members": [], - "hasUnknownMembers": false + "members": [] } } ], diff --git a/packages/babel-parser/test/fixtures/flow/enum-declaration/inconsistent-member-values-mixed-initializers/output.json b/packages/babel-parser/test/fixtures/flow/enum-declaration/inconsistent-member-values-mixed-initializers/output.json index 17e38f263e66..90274835ec2d 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 @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "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)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "EnumInconsistentMemberValues" + } ], "program": { "type": "Program", @@ -21,9 +27,9 @@ "body": { "type": "EnumStringBody", "start":7,"end":31,"loc":{"start":{"line":1,"column":7},"end":{"line":4,"column":1}}, + "hasUnknownMembers": false, "explicitType": false, - "members": [], - "hasUnknownMembers": false + "members": [] } } ], diff --git a/packages/babel-parser/test/fixtures/flow/enum-declaration/invalid-explicit-type-identifier/output.json b/packages/babel-parser/test/fixtures/flow/enum-declaration/invalid-explicit-type-identifier/output.json index 02a9f0f0b04e..b91059220ff9 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 @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "Enum type `xxx` is not valid. Use one of `boolean`, `number`, `string`, or `symbol` in enum `E`. (1:14)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "EnumInvalidExplicitType" + } ], "program": { "type": "Program", @@ -21,9 +27,9 @@ "body": { "type": "EnumStringBody", "start":7,"end":17,"loc":{"start":{"line":1,"column":7},"end":{"line":2,"column":1}}, + "hasUnknownMembers": false, "explicitType": false, - "members": [], - "hasUnknownMembers": false + "members": [] } } ], diff --git a/packages/babel-parser/test/fixtures/flow/enum-declaration/invalid-member-initializer-boolean-explicit-string/output.json b/packages/babel-parser/test/fixtures/flow/enum-declaration/invalid-member-initializer-boolean-explicit-string/output.json index 9e16c209ebc8..789f0f31c598 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 @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "Enum `E` has type `string`, so the initializer of `A` needs to be a string literal. (2:6)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "EnumInvalidMemberInitializerPrimaryType" + } ], "program": { "type": "Program", @@ -21,9 +27,9 @@ "body": { "type": "EnumStringBody", "start":7,"end":32,"loc":{"start":{"line":1,"column":7},"end":{"line":3,"column":1}}, + "hasUnknownMembers": false, "explicitType": true, - "members": [], - "hasUnknownMembers": false + "members": [] } } ], diff --git a/packages/babel-parser/test/fixtures/flow/enum-declaration/invalid-member-initializer-literal-explicit-symbol/output.json b/packages/babel-parser/test/fixtures/flow/enum-declaration/invalid-member-initializer-literal-explicit-symbol/output.json index 169c12667f22..f746335729f4 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 @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "Symbol enum members cannot be initialized. Use `A,` in enum `E`. (2:6)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "EnumInvalidMemberInitializerSymbolType" + } ], "program": { "type": "Program", @@ -21,8 +27,8 @@ "body": { "type": "EnumSymbolBody", "start":7,"end":29,"loc":{"start":{"line":1,"column":7},"end":{"line":3,"column":1}}, - "members": [], - "hasUnknownMembers": false + "hasUnknownMembers": false, + "members": [] } } ], diff --git a/packages/babel-parser/test/fixtures/flow/enum-declaration/invalid-member-initializer-number-explicit-boolean/output.json b/packages/babel-parser/test/fixtures/flow/enum-declaration/invalid-member-initializer-number-explicit-boolean/output.json index 14bbdfbda955..58c8ae76e253 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 @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "Enum `E` has type `boolean`, so the initializer of `A` needs to be a boolean literal. (2:6)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "EnumInvalidMemberInitializerPrimaryType" + } ], "program": { "type": "Program", @@ -21,9 +27,9 @@ "body": { "type": "EnumBooleanBody", "start":7,"end":30,"loc":{"start":{"line":1,"column":7},"end":{"line":3,"column":1}}, + "hasUnknownMembers": false, "explicitType": true, - "members": [], - "hasUnknownMembers": false + "members": [] } } ], diff --git a/packages/babel-parser/test/fixtures/flow/enum-declaration/invalid-member-initializer-number-explicit-string/output.json b/packages/babel-parser/test/fixtures/flow/enum-declaration/invalid-member-initializer-number-explicit-string/output.json index c496f854cb46..7593157246c7 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 @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "Enum `E` has type `string`, so the initializer of `A` needs to be a string literal. (2:6)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "EnumInvalidMemberInitializerPrimaryType" + } ], "program": { "type": "Program", @@ -21,9 +27,9 @@ "body": { "type": "EnumStringBody", "start":7,"end":29,"loc":{"start":{"line":1,"column":7},"end":{"line":3,"column":1}}, + "hasUnknownMembers": false, "explicitType": true, - "members": [], - "hasUnknownMembers": false + "members": [] } } ], diff --git a/packages/babel-parser/test/fixtures/flow/enum-declaration/invalid-member-initializer-string-explicit-boolean/output.json b/packages/babel-parser/test/fixtures/flow/enum-declaration/invalid-member-initializer-string-explicit-boolean/output.json index 3a7df84a7a47..01dce35533a8 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 @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "Enum `E` has type `boolean`, so the initializer of `A` needs to be a boolean literal. (2:6)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "EnumInvalidMemberInitializerPrimaryType" + } ], "program": { "type": "Program", @@ -21,9 +27,9 @@ "body": { "type": "EnumBooleanBody", "start":7,"end":33,"loc":{"start":{"line":1,"column":7},"end":{"line":3,"column":1}}, + "hasUnknownMembers": false, "explicitType": true, - "members": [], - "hasUnknownMembers": false + "members": [] } } ], diff --git a/packages/babel-parser/test/fixtures/flow/enum-declaration/invalid-member-initializer-string-explicit-number/output.json b/packages/babel-parser/test/fixtures/flow/enum-declaration/invalid-member-initializer-string-explicit-number/output.json index 8a9c7b3bd378..54abe2cd2bb0 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 @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "Enum `E` has type `number`, so the initializer of `A` needs to be a number literal. (2:6)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "EnumInvalidMemberInitializerPrimaryType" + } ], "program": { "type": "Program", @@ -21,9 +27,9 @@ "body": { "type": "EnumNumberBody", "start":7,"end":32,"loc":{"start":{"line":1,"column":7},"end":{"line":3,"column":1}}, + "hasUnknownMembers": false, "explicitType": true, - "members": [], - "hasUnknownMembers": false + "members": [] } } ], diff --git a/packages/babel-parser/test/fixtures/flow/enum-declaration/invalid-member-name/output.json b/packages/babel-parser/test/fixtures/flow/enum-declaration/invalid-member-name/output.json index dc53fd5d5a79..9db9730a1b7d 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 @@ -2,8 +2,20 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "Enum member names cannot start with lowercase 'a' through 'z'. Instead of using `foo`, consider using `Foo`, in enum `E`. (2:2)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "EnumInvalidMemberName" + }, + { + "$$ babel internal serialized type": "Error", + "message": "Enum member names cannot start with lowercase 'a' through 'z'. Instead of using `bar`, consider using `Bar`, in enum `E`. (3:2)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "EnumInvalidMemberName" + } ], "program": { "type": "Program", @@ -22,6 +34,7 @@ "body": { "type": "EnumStringBody", "start":7,"end":24,"loc":{"start":{"line":1,"column":7},"end":{"line":4,"column":1}}, + "hasUnknownMembers": false, "explicitType": false, "members": [ { @@ -42,8 +55,7 @@ "name": "bar" } } - ], - "hasUnknownMembers": false + ] } } ], 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 fb8576d1afaa..10528f2b69f9 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 @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "Number enum members need to be initialized, e.g. `A = 1` in enum `E`. (2:2)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "EnumNumberMemberNotInitialized" + } ], "program": { "type": "Program", @@ -21,9 +27,9 @@ "body": { "type": "EnumNumberBody", "start":7,"end":25,"loc":{"start":{"line":1,"column":7},"end":{"line":3,"column":1}}, + "hasUnknownMembers": false, "explicitType": true, - "members": [], - "hasUnknownMembers": false + "members": [] } } ], diff --git a/packages/babel-parser/test/fixtures/flow/enum-declaration/number-member-not-initialized-implicit/output.json b/packages/babel-parser/test/fixtures/flow/enum-declaration/number-member-not-initialized-implicit/output.json index 61135052b682..35e2c0c65741 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 @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "Number enum members need to be initialized, e.g. `A = 1` in enum `E`. (2:2)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "EnumNumberMemberNotInitialized" + } ], "program": { "type": "Program", @@ -21,8 +27,8 @@ "body": { "type": "EnumNumberBody", "start":7,"end":24,"loc":{"start":{"line":1,"column":7},"end":{"line":4,"column":1}}, - "explicitType": false, "hasUnknownMembers": false, + "explicitType": false, "members": [ { "type": "EnumNumberMember", diff --git a/packages/babel-parser/test/fixtures/flow/enum-declaration/reserved-word-enum-name/output.json b/packages/babel-parser/test/fixtures/flow/enum-declaration/reserved-word-enum-name/output.json index a48c8cad045b..3fb8d3b7e6e1 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 @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":14,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":1}}, "errors": [ - "SyntaxError: Unexpected keyword 'class' (1:5)" + { + "$$ babel internal serialized type": "Error", + "message": "Unexpected keyword 'class' (1:5)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "UnexpectedKeyword" + } ], "program": { "type": "Program", @@ -21,9 +27,9 @@ "body": { "type": "EnumStringBody", "start":11,"end":14,"loc":{"start":{"line":1,"column":11},"end":{"line":2,"column":1}}, + "hasUnknownMembers": false, "explicitType": false, - "members": [], - "hasUnknownMembers": false + "members": [] } } ], 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 7f5906cc2ff0..613f15cd4821 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 @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "String enum members need to consistently either all use initializers, or use no initializers, in enum `E`. (2:2)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "EnumStringMemberInconsistentlyInitailized" + } ], "program": { "type": "Program", @@ -21,6 +27,7 @@ "body": { "type": "EnumStringBody", "start":7,"end":41,"loc":{"start":{"line":1,"column":7},"end":{"line":5,"column":1}}, + "hasUnknownMembers": false, "explicitType": true, "members": [ { @@ -41,8 +48,7 @@ "name": "C" } } - ], - "hasUnknownMembers": false + ] } } ], diff --git a/packages/babel-parser/test/fixtures/flow/enum-declaration/string-member-inconsistently-initialized-majority-initialized/output.json b/packages/babel-parser/test/fixtures/flow/enum-declaration/string-member-inconsistently-initialized-majority-initialized/output.json index d57bcebfb9f8..f342486a1e97 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 @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "String enum members need to consistently either all use initializers, or use no initializers, in enum `E`. (2:2)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "EnumStringMemberInconsistentlyInitailized" + } ], "program": { "type": "Program", @@ -21,6 +27,7 @@ "body": { "type": "EnumStringBody", "start":7,"end":47,"loc":{"start":{"line":1,"column":7},"end":{"line":5,"column":1}}, + "hasUnknownMembers": false, "explicitType": true, "members": [ { @@ -59,8 +66,7 @@ "value": "c" } } - ], - "hasUnknownMembers": false + ] } } ], 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 79791869df20..68bb7e5aaa08 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 @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "Explicit inexact syntax cannot appear in class or interface definitions (3:2)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "InexactInsideNonObject" + } ], "program": { "type": "Program", @@ -13,6 +19,13 @@ { "type": "DeclareClass", "start":8,"end":34,"loc":{"start":{"line":2,"column":0},"end":{"line":4,"column":1}}, + "leadingComments": [ + { + "type": "CommentLine", + "value": "@flow", + "start":0,"end":7,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":7}} + } + ], "id": { "type": "Identifier", "start":22,"end":23,"loc":{"start":{"line":2,"column":14},"end":{"line":2,"column":15},"identifierName":"A"}, @@ -30,14 +43,7 @@ "indexers": [], "internalSlots": [], "exact": false - }, - "leadingComments": [ - { - "type": "CommentLine", - "value": "@flow", - "start":0,"end":7,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":7}} - } - ] + } } ], "directives": [] diff --git a/packages/babel-parser/test/fixtures/flow/explicit-inexact-object/explicit_inexact_disallowed_in_non_objects2/output.json b/packages/babel-parser/test/fixtures/flow/explicit-inexact-object/explicit_inexact_disallowed_in_non_objects2/output.json index 5f245815fbf6..affbf6ad78f6 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 @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "Explicit inexact syntax cannot appear in class or interface definitions (4:2)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "InexactInsideNonObject" + } ], "program": { "type": "Program", @@ -13,6 +19,13 @@ { "type": "DeclareClass", "start":8,"end":49,"loc":{"start":{"line":2,"column":0},"end":{"line":5,"column":1}}, + "leadingComments": [ + { + "type": "CommentLine", + "value": "@flow", + "start":0,"end":7,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":7}} + } + ], "id": { "type": "Identifier", "start":22,"end":23,"loc":{"start":{"line":2,"column":14},"end":{"line":2,"column":15},"identifierName":"B"}, @@ -50,14 +63,7 @@ "indexers": [], "internalSlots": [], "exact": false - }, - "leadingComments": [ - { - "type": "CommentLine", - "value": "@flow", - "start":0,"end":7,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":7}} - } - ] + } } ], "directives": [] diff --git a/packages/babel-parser/test/fixtures/flow/explicit-inexact-object/explicit_inexact_disallowed_in_non_objects3/output.json b/packages/babel-parser/test/fixtures/flow/explicit-inexact-object/explicit_inexact_disallowed_in_non_objects3/output.json index 6933be95528f..2714d28d4772 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 @@ -2,8 +2,20 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "Explicit inexact syntax cannot appear in class or interface definitions (3:2)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "InexactInsideNonObject" + }, + { + "$$ babel internal serialized type": "Error", + "message": "Explicit inexact syntax must appear at the end of an inexact object (3:2)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "UnexpectedExplicitInexactInObject" + } ], "program": { "type": "Program", @@ -14,6 +26,13 @@ { "type": "DeclareClass", "start":8,"end":49,"loc":{"start":{"line":2,"column":0},"end":{"line":5,"column":1}}, + "leadingComments": [ + { + "type": "CommentLine", + "value": "@flow", + "start":0,"end":7,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":7}} + } + ], "id": { "type": "Identifier", "start":22,"end":23,"loc":{"start":{"line":2,"column":14},"end":{"line":2,"column":15},"identifierName":"C"}, @@ -51,14 +70,7 @@ "indexers": [], "internalSlots": [], "exact": false - }, - "leadingComments": [ - { - "type": "CommentLine", - "value": "@flow", - "start":0,"end":7,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":7}} - } - ] + } } ], "directives": [] diff --git a/packages/babel-parser/test/fixtures/flow/explicit-inexact-object/explicit_inexact_disallowed_in_non_objects4/output.json b/packages/babel-parser/test/fixtures/flow/explicit-inexact-object/explicit_inexact_disallowed_in_non_objects4/output.json index 6c4b0246e420..8461a3d910b1 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 @@ -2,8 +2,20 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "Explicit inexact syntax cannot appear in class or interface definitions (4:2)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "InexactInsideNonObject" + }, + { + "$$ babel internal serialized type": "Error", + "message": "Explicit inexact syntax must appear at the end of an inexact object (4:2)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "UnexpectedExplicitInexactInObject" + } ], "program": { "type": "Program", @@ -14,6 +26,13 @@ { "type": "DeclareClass", "start":8,"end":64,"loc":{"start":{"line":2,"column":0},"end":{"line":6,"column":1}}, + "leadingComments": [ + { + "type": "CommentLine", + "value": "@flow", + "start":0,"end":7,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":7}} + } + ], "id": { "type": "Identifier", "start":22,"end":23,"loc":{"start":{"line":2,"column":14},"end":{"line":2,"column":15},"identifierName":"D"}, @@ -70,14 +89,7 @@ "indexers": [], "internalSlots": [], "exact": false - }, - "leadingComments": [ - { - "type": "CommentLine", - "value": "@flow", - "start":0,"end":7,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":7}} - } - ] + } } ], "directives": [] diff --git a/packages/babel-parser/test/fixtures/flow/explicit-inexact-object/explicit_inexact_disallowed_in_non_objects5/output.json b/packages/babel-parser/test/fixtures/flow/explicit-inexact-object/explicit_inexact_disallowed_in_non_objects5/output.json index 6cbdf063a824..dadea709d9c1 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 @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "Explicit inexact syntax cannot appear in class or interface definitions (4:2)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "InexactInsideNonObject" + } ], "program": { "type": "Program", @@ -13,6 +19,13 @@ { "type": "InterfaceDeclaration", "start":8,"end":45,"loc":{"start":{"line":2,"column":0},"end":{"line":5,"column":1}}, + "leadingComments": [ + { + "type": "CommentLine", + "value": "@flow", + "start":0,"end":7,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":7}} + } + ], "id": { "type": "Identifier", "start":18,"end":19,"loc":{"start":{"line":2,"column":10},"end":{"line":2,"column":11},"identifierName":"F"}, @@ -50,14 +63,7 @@ "indexers": [], "internalSlots": [], "exact": false - }, - "leadingComments": [ - { - "type": "CommentLine", - "value": "@flow", - "start":0,"end":7,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":7}} - } - ] + } } ], "directives": [] diff --git a/packages/babel-parser/test/fixtures/flow/explicit-inexact-object/explicit_inexact_disallowed_in_non_objects6/output.json b/packages/babel-parser/test/fixtures/flow/explicit-inexact-object/explicit_inexact_disallowed_in_non_objects6/output.json index ef17a8522e31..0f3ad678e83e 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 @@ -2,8 +2,20 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "Explicit inexact syntax cannot appear in class or interface definitions (3:2)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "InexactInsideNonObject" + }, + { + "$$ babel internal serialized type": "Error", + "message": "Explicit inexact syntax must appear at the end of an inexact object (3:2)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "UnexpectedExplicitInexactInObject" + } ], "program": { "type": "Program", @@ -14,6 +26,13 @@ { "type": "InterfaceDeclaration", "start":8,"end":45,"loc":{"start":{"line":2,"column":0},"end":{"line":5,"column":1}}, + "leadingComments": [ + { + "type": "CommentLine", + "value": "@flow", + "start":0,"end":7,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":7}} + } + ], "id": { "type": "Identifier", "start":18,"end":19,"loc":{"start":{"line":2,"column":10},"end":{"line":2,"column":11},"identifierName":"G"}, @@ -51,14 +70,7 @@ "indexers": [], "internalSlots": [], "exact": false - }, - "leadingComments": [ - { - "type": "CommentLine", - "value": "@flow", - "start":0,"end":7,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":7}} - } - ] + } } ], "directives": [] diff --git a/packages/babel-parser/test/fixtures/flow/explicit-inexact-object/explicit_inexact_disallowed_in_non_objects7/output.json b/packages/babel-parser/test/fixtures/flow/explicit-inexact-object/explicit_inexact_disallowed_in_non_objects7/output.json index c8b023403203..1ce52af9b6f0 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 @@ -2,8 +2,20 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "Explicit inexact syntax cannot appear in class or interface definitions (4:2)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "InexactInsideNonObject" + }, + { + "$$ babel internal serialized type": "Error", + "message": "Explicit inexact syntax must appear at the end of an inexact object (4:2)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "UnexpectedExplicitInexactInObject" + } ], "program": { "type": "Program", @@ -14,6 +26,13 @@ { "type": "InterfaceDeclaration", "start":8,"end":60,"loc":{"start":{"line":2,"column":0},"end":{"line":6,"column":1}}, + "leadingComments": [ + { + "type": "CommentLine", + "value": "@flow", + "start":0,"end":7,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":7}} + } + ], "id": { "type": "Identifier", "start":18,"end":19,"loc":{"start":{"line":2,"column":10},"end":{"line":2,"column":11},"identifierName":"H"}, @@ -70,14 +89,7 @@ "indexers": [], "internalSlots": [], "exact": false - }, - "leadingComments": [ - { - "type": "CommentLine", - "value": "@flow", - "start":0,"end":7,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":7}} - } - ] + } } ], "directives": [] diff --git a/packages/babel-parser/test/fixtures/flow/explicit-inexact-object/explicit_inexact_forbidden_in_exact/output.json b/packages/babel-parser/test/fixtures/flow/explicit-inexact-object/explicit_inexact_forbidden_in_exact/output.json index 94a068947058..93e4e6993bcd 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 @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "Explicit inexact syntax cannot appear inside an explicit exact object type (2:25)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "InexactInsideExact" + } ], "program": { "type": "Program", @@ -13,6 +19,13 @@ { "type": "TypeAlias", "start":8,"end":39,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":31}}, + "leadingComments": [ + { + "type": "CommentLine", + "value": "@flow", + "start":0,"end":7,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":7}} + } + ], "id": { "type": "Identifier", "start":13,"end":14,"loc":{"start":{"line":2,"column":5},"end":{"line":2,"column":6},"identifierName":"T"}, @@ -48,14 +61,7 @@ "internalSlots": [], "exact": true, "inexact": true - }, - "leadingComments": [ - { - "type": "CommentLine", - "value": "@flow", - "start":0,"end":7,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":7}} - } - ] + } } ], "directives": [] diff --git a/packages/babel-parser/test/fixtures/flow/explicit-inexact-object/explicit_inexact_must_appear_last/output.json b/packages/babel-parser/test/fixtures/flow/explicit-inexact-object/explicit_inexact_must_appear_last/output.json index 36abf35d4535..83230c1aa05e 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 @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "Explicit inexact syntax must appear at the end of an inexact object (2:10)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "UnexpectedExplicitInexactInObject" + } ], "program": { "type": "Program", @@ -13,6 +19,13 @@ { "type": "TypeAlias", "start":8,"end":36,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":28}}, + "leadingComments": [ + { + "type": "CommentLine", + "value": "@flow", + "start":0,"end":7,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":7}} + } + ], "id": { "type": "Identifier", "start":13,"end":14,"loc":{"start":{"line":2,"column":5},"end":{"line":2,"column":6},"identifierName":"T"}, @@ -48,14 +61,7 @@ "internalSlots": [], "exact": false, "inexact": true - }, - "leadingComments": [ - { - "type": "CommentLine", - "value": "@flow", - "start":0,"end":7,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":7}} - } - ] + } } ], "directives": [] diff --git a/packages/babel-parser/test/fixtures/flow/explicit-inexact-object/explicit_inexact_object_invalid1/output.json b/packages/babel-parser/test/fixtures/flow/explicit-inexact-object/explicit_inexact_object_invalid1/output.json index 16a8edbd4bcb..57453978c89b 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 @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "Explicit inexact syntax must appear at the end of an inexact object (2:21)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "UnexpectedExplicitInexactInObject" + } ], "program": { "type": "Program", @@ -13,6 +19,13 @@ { "type": "TypeAlias", "start":8,"end":45,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":37}}, + "leadingComments": [ + { + "type": "CommentLine", + "value": "@flow", + "start":0,"end":7,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":7}} + } + ], "id": { "type": "Identifier", "start":13,"end":14,"loc":{"start":{"line":2,"column":5},"end":{"line":2,"column":6},"identifierName":"T"}, @@ -67,14 +80,7 @@ "internalSlots": [], "exact": false, "inexact": true - }, - "leadingComments": [ - { - "type": "CommentLine", - "value": "@flow", - "start":0,"end":7,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":7}} - } - ] + } } ], "directives": [] diff --git a/packages/babel-parser/test/fixtures/flow/explicit-inexact-object/explicit_inexact_object_invalid2/output.json b/packages/babel-parser/test/fixtures/flow/explicit-inexact-object/explicit_inexact_object_invalid2/output.json index ff2e24bc5d28..51e14c9e4fee 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 @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "Explicit inexact syntax must appear at the end of an inexact object (2:21)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "UnexpectedExplicitInexactInObject" + } ], "program": { "type": "Program", @@ -13,6 +19,13 @@ { "type": "TypeAlias", "start":8,"end":39,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":31}}, + "leadingComments": [ + { + "type": "CommentLine", + "value": "@flow", + "start":0,"end":7,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":7}} + } + ], "id": { "type": "Identifier", "start":13,"end":14,"loc":{"start":{"line":2,"column":5},"end":{"line":2,"column":6},"identifierName":"U"}, @@ -48,14 +61,7 @@ "internalSlots": [], "exact": false, "inexact": true - }, - "leadingComments": [ - { - "type": "CommentLine", - "value": "@flow", - "start":0,"end":7,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":7}} - } - ] + } } ], "directives": [] diff --git a/packages/babel-parser/test/fixtures/flow/explicit-inexact-object/explicit_inexact_object_invalid3/output.json b/packages/babel-parser/test/fixtures/flow/explicit-inexact-object/explicit_inexact_object_invalid3/output.json index 40f82000ed09..4d48cbaad76d 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 @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "Explicit inexact syntax must appear at the end of an inexact object (2:21)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "UnexpectedExplicitInexactInObject" + } ], "program": { "type": "Program", @@ -13,6 +19,13 @@ { "type": "TypeAlias", "start":8,"end":40,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":32}}, + "leadingComments": [ + { + "type": "CommentLine", + "value": "@flow", + "start":0,"end":7,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":7}} + } + ], "id": { "type": "Identifier", "start":13,"end":14,"loc":{"start":{"line":2,"column":5},"end":{"line":2,"column":6},"identifierName":"V"}, @@ -62,14 +75,7 @@ "internalSlots": [], "exact": false, "inexact": true - }, - "leadingComments": [ - { - "type": "CommentLine", - "value": "@flow", - "start":0,"end":7,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":7}} - } - ] + } } ], "directives": [] diff --git a/packages/babel-parser/test/fixtures/flow/interface-types/extends-multiple-reserved-invalid-1/output.json b/packages/babel-parser/test/fixtures/flow/interface-types/extends-multiple-reserved-invalid-1/output.json index ab97f0f061ed..1918a31052c1 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 @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":39,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":30}}, "errors": [ - "SyntaxError: Unexpected reserved type bool (2:23)" + { + "$$ babel internal serialized type": "Error", + "message": "Unexpected reserved type bool (2:23)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "UnexpectedReservedType" + } ], "program": { "type": "Program", @@ -13,6 +19,13 @@ { "type": "InterfaceDeclaration", "start":9,"end":39,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":30}}, + "leadingComments": [ + { + "type": "CommentLine", + "value": " @flow", + "start":0,"end":8,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":8}} + } + ], "id": { "type": "Identifier", "start":19,"end":20,"loc":{"start":{"line":2,"column":10},"end":{"line":2,"column":11},"identifierName":"I"}, @@ -51,14 +64,7 @@ "indexers": [], "internalSlots": [], "exact": false - }, - "leadingComments": [ - { - "type": "CommentLine", - "value": " @flow", - "start":0,"end":8,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":8}} - } - ] + } } ], "directives": [] diff --git a/packages/babel-parser/test/fixtures/flow/interface-types/extends-multiple-reserved-invalid-2/output.json b/packages/babel-parser/test/fixtures/flow/interface-types/extends-multiple-reserved-invalid-2/output.json index 53fdc1eadb82..a2709f366ff2 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 @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":41,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":32}}, "errors": [ - "SyntaxError: Unexpected reserved type bool (2:23)" + { + "$$ babel internal serialized type": "Error", + "message": "Unexpected reserved type bool (2:23)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "UnexpectedReservedType" + } ], "program": { "type": "Program", @@ -13,6 +19,13 @@ { "type": "InterfaceDeclaration", "start":9,"end":41,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":32}}, + "leadingComments": [ + { + "type": "CommentLine", + "value": " @flow", + "start":0,"end":8,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":8}} + } + ], "id": { "type": "Identifier", "start":19,"end":20,"loc":{"start":{"line":2,"column":10},"end":{"line":2,"column":11},"identifierName":"I"}, @@ -60,14 +73,7 @@ "indexers": [], "internalSlots": [], "exact": false - }, - "leadingComments": [ - { - "type": "CommentLine", - "value": " @flow", - "start":0,"end":8,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":8}} - } - ] + } } ], "directives": [] diff --git a/packages/babel-parser/test/fixtures/flow/interface-types/extends-reserved-invalid-1/output.json b/packages/babel-parser/test/fixtures/flow/interface-types/extends-reserved-invalid-1/output.json index a9b966d7dba8..71c8c60d2632 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 @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":36,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":27}}, "errors": [ - "SyntaxError: Unexpected reserved type bool (2:20)" + { + "$$ babel internal serialized type": "Error", + "message": "Unexpected reserved type bool (2:20)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "UnexpectedReservedType" + } ], "program": { "type": "Program", @@ -13,6 +19,13 @@ { "type": "InterfaceDeclaration", "start":9,"end":36,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":27}}, + "leadingComments": [ + { + "type": "CommentLine", + "value": " @flow", + "start":0,"end":8,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":8}} + } + ], "id": { "type": "Identifier", "start":19,"end":20,"loc":{"start":{"line":2,"column":10},"end":{"line":2,"column":11},"identifierName":"I"}, @@ -41,14 +54,7 @@ "indexers": [], "internalSlots": [], "exact": false - }, - "leadingComments": [ - { - "type": "CommentLine", - "value": " @flow", - "start":0,"end":8,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":8}} - } - ] + } } ], "directives": [] diff --git a/packages/babel-parser/test/fixtures/flow/interface-types/extends-reserved-invalid-2/output.json b/packages/babel-parser/test/fixtures/flow/interface-types/extends-reserved-invalid-2/output.json index 9c8eea94c707..7c05d22a722e 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 @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":38,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":29}}, "errors": [ - "SyntaxError: Unexpected reserved type bool (2:20)" + { + "$$ babel internal serialized type": "Error", + "message": "Unexpected reserved type bool (2:20)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "UnexpectedReservedType" + } ], "program": { "type": "Program", @@ -13,6 +19,13 @@ { "type": "InterfaceDeclaration", "start":9,"end":38,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":29}}, + "leadingComments": [ + { + "type": "CommentLine", + "value": " @flow", + "start":0,"end":8,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":8}} + } + ], "id": { "type": "Identifier", "start":19,"end":20,"loc":{"start":{"line":2,"column":10},"end":{"line":2,"column":11},"identifierName":"I"}, @@ -50,14 +63,7 @@ "indexers": [], "internalSlots": [], "exact": false - }, - "leadingComments": [ - { - "type": "CommentLine", - "value": " @flow", - "start":0,"end":8,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":8}} - } - ] + } } ], "directives": [] diff --git a/packages/babel-parser/test/fixtures/flow/interfaces-as-identifier/assignment-expression/output.json b/packages/babel-parser/test/fixtures/flow/interfaces-as-identifier/assignment-expression/output.json index e0bd14b6ea94..1cb253a2eb3c 100644 --- a/packages/babel-parser/test/fixtures/flow/interfaces-as-identifier/assignment-expression/output.json +++ b/packages/babel-parser/test/fixtures/flow/interfaces-as-identifier/assignment-expression/output.json @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":18,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":18}}, "errors": [ - "SyntaxError: Unexpected reserved word 'interface' (1:0)" + { + "$$ babel internal serialized type": "Error", + "message": "Unexpected reserved word 'interface' (1:0)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "UnexpectedReservedWord" + } ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/flow/interfaces-as-identifier/binary-expression/output.json b/packages/babel-parser/test/fixtures/flow/interfaces-as-identifier/binary-expression/output.json index d4a672ad70ad..f9924e01c92b 100644 --- a/packages/babel-parser/test/fixtures/flow/interfaces-as-identifier/binary-expression/output.json +++ b/packages/babel-parser/test/fixtures/flow/interfaces-as-identifier/binary-expression/output.json @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":14,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":14}}, "errors": [ - "SyntaxError: Unexpected reserved word 'interface' (1:0)" + { + "$$ babel internal serialized type": "Error", + "message": "Unexpected reserved word 'interface' (1:0)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "UnexpectedReservedWord" + } ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/flow/interfaces-as-identifier/call-expression/output.json b/packages/babel-parser/test/fixtures/flow/interfaces-as-identifier/call-expression/output.json index aa6500d58b08..1e4dceb919a0 100644 --- a/packages/babel-parser/test/fixtures/flow/interfaces-as-identifier/call-expression/output.json +++ b/packages/babel-parser/test/fixtures/flow/interfaces-as-identifier/call-expression/output.json @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":12,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":12}}, "errors": [ - "SyntaxError: Unexpected reserved word 'interface' (1:0)" + { + "$$ babel internal serialized type": "Error", + "message": "Unexpected reserved word 'interface' (1:0)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "UnexpectedReservedWord" + } ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/flow/interfaces-as-identifier/class-declaration/output.json b/packages/babel-parser/test/fixtures/flow/interfaces-as-identifier/class-declaration/output.json index 1193e8005e6f..1f0fc2afb676 100644 --- a/packages/babel-parser/test/fixtures/flow/interfaces-as-identifier/class-declaration/output.json +++ b/packages/babel-parser/test/fixtures/flow/interfaces-as-identifier/class-declaration/output.json @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":18,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":18}}, "errors": [ - "SyntaxError: Unexpected reserved word 'interface' (1:6)" + { + "$$ babel internal serialized type": "Error", + "message": "Unexpected reserved word 'interface' (1:6)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "UnexpectedReservedWord" + } ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/flow/interfaces-as-identifier/conditional-expression/output.json b/packages/babel-parser/test/fixtures/flow/interfaces-as-identifier/conditional-expression/output.json index f262c436627f..dddd69b5828e 100644 --- a/packages/babel-parser/test/fixtures/flow/interfaces-as-identifier/conditional-expression/output.json +++ b/packages/babel-parser/test/fixtures/flow/interfaces-as-identifier/conditional-expression/output.json @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":25,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":25}}, "errors": [ - "SyntaxError: Unexpected reserved word 'interface' (1:0)" + { + "$$ babel internal serialized type": "Error", + "message": "Unexpected reserved word 'interface' (1:0)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "UnexpectedReservedWord" + } ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/flow/interfaces-as-identifier/function-declaration/output.json b/packages/babel-parser/test/fixtures/flow/interfaces-as-identifier/function-declaration/output.json index 47fedb9e186c..8d4a378d09a7 100644 --- a/packages/babel-parser/test/fixtures/flow/interfaces-as-identifier/function-declaration/output.json +++ b/packages/babel-parser/test/fixtures/flow/interfaces-as-identifier/function-declaration/output.json @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":23,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":23}}, "errors": [ - "SyntaxError: Unexpected reserved word 'interface' (1:9)" + { + "$$ babel internal serialized type": "Error", + "message": "Unexpected reserved word 'interface' (1:9)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "UnexpectedReservedWord" + } ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/flow/interfaces-as-identifier/import-statement/output.json b/packages/babel-parser/test/fixtures/flow/interfaces-as-identifier/import-statement/output.json index d994e24f05fb..a91ef4c3d446 100644 --- a/packages/babel-parser/test/fixtures/flow/interfaces-as-identifier/import-statement/output.json +++ b/packages/babel-parser/test/fixtures/flow/interfaces-as-identifier/import-statement/output.json @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":28,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":28}}, "errors": [ - "SyntaxError: Unexpected reserved word 'interface' (1:7)" + { + "$$ babel internal serialized type": "Error", + "message": "Unexpected reserved word 'interface' (1:7)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "UnexpectedReservedWord" + } ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/flow/interfaces-as-identifier/member-expression/output.json b/packages/babel-parser/test/fixtures/flow/interfaces-as-identifier/member-expression/output.json index 6a8a618b8f55..55f946698535 100644 --- a/packages/babel-parser/test/fixtures/flow/interfaces-as-identifier/member-expression/output.json +++ b/packages/babel-parser/test/fixtures/flow/interfaces-as-identifier/member-expression/output.json @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":29,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":14}}, "errors": [ - "SyntaxError: Unexpected reserved word 'interface' (2:0)" + { + "$$ babel internal serialized type": "Error", + "message": "Unexpected reserved word 'interface' (2:0)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "UnexpectedReservedWord" + } ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/flow/interfaces-as-identifier/new-expression/output.json b/packages/babel-parser/test/fixtures/flow/interfaces-as-identifier/new-expression/output.json index 394218d16272..abbd2a4f6f00 100644 --- a/packages/babel-parser/test/fixtures/flow/interfaces-as-identifier/new-expression/output.json +++ b/packages/babel-parser/test/fixtures/flow/interfaces-as-identifier/new-expression/output.json @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":16,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":16}}, "errors": [ - "SyntaxError: Unexpected reserved word 'interface' (1:4)" + { + "$$ babel internal serialized type": "Error", + "message": "Unexpected reserved word 'interface' (1:4)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "UnexpectedReservedWord" + } ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/flow/interfaces-as-identifier/sequence-expression/output.json b/packages/babel-parser/test/fixtures/flow/interfaces-as-identifier/sequence-expression/output.json index 638420bfde16..6ef7cdc6d692 100644 --- a/packages/babel-parser/test/fixtures/flow/interfaces-as-identifier/sequence-expression/output.json +++ b/packages/babel-parser/test/fixtures/flow/interfaces-as-identifier/sequence-expression/output.json @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":19,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":19}}, "errors": [ - "SyntaxError: Unexpected reserved word 'interface' (1:1)" + { + "$$ babel internal serialized type": "Error", + "message": "Unexpected reserved word 'interface' (1:1)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "UnexpectedReservedWord" + } ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/flow/interfaces-as-identifier/unary-expression/output.json b/packages/babel-parser/test/fixtures/flow/interfaces-as-identifier/unary-expression/output.json index 47bfc9d51654..606894a98a44 100644 --- a/packages/babel-parser/test/fixtures/flow/interfaces-as-identifier/unary-expression/output.json +++ b/packages/babel-parser/test/fixtures/flow/interfaces-as-identifier/unary-expression/output.json @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":15,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":15}}, "errors": [ - "SyntaxError: Unexpected reserved word 'interface' (1:5)" + { + "$$ babel internal serialized type": "Error", + "message": "Unexpected reserved word 'interface' (1:5)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "UnexpectedReservedWord" + } ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/flow/interfaces-as-identifier/variable/output.json b/packages/babel-parser/test/fixtures/flow/interfaces-as-identifier/variable/output.json index e040c227cced..5128f24f846b 100644 --- a/packages/babel-parser/test/fixtures/flow/interfaces-as-identifier/variable/output.json +++ b/packages/babel-parser/test/fixtures/flow/interfaces-as-identifier/variable/output.json @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":24,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":24}}, "errors": [ - "SyntaxError: Unexpected reserved word 'interface' (1:6)" + { + "$$ babel internal serialized type": "Error", + "message": "Unexpected reserved word 'interface' (1:6)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "UnexpectedReservedWord" + } ], "program": { "type": "Program", 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 0cb78e7903e0..1bde11e23b57 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 @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":19,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":19}}, "errors": [ - "SyntaxError: Cannot overwrite reserved type string (1:10)" + { + "$$ babel internal serialized type": "Error", + "message": "Cannot overwrite reserved type string (1:10)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "AssignReservedType" + } ], "program": { "type": "Program", 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 ae3f5125cf1c..13d3b6c5e025 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 @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":35,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":35}}, "errors": [ - "SyntaxError: Unexpected reserved type string (1:26)" + { + "$$ babel internal serialized type": "Error", + "message": "Unexpected reserved type string (1:26)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "UnexpectedReservedType" + } ], "program": { "type": "Program", 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 663e4c8f9dc4..6aa8e9701313 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 @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":30,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":30}}, "errors": [ - "SyntaxError: Unexpected reserved type string (1:21)" + { + "$$ babel internal serialized type": "Error", + "message": "Unexpected reserved type string (1:21)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "UnexpectedReservedType" + } ], "program": { "type": "Program", 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 e056c32eb0a4..0ba65c962636 100644 --- a/packages/babel-parser/test/fixtures/flow/iterator/03/output.json +++ b/packages/babel-parser/test/fixtures/flow/iterator/03/output.json @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":20,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":20}}, "errors": [ - "SyntaxError: Invalid identifier @@asyncIterator (1:19)" + { + "$$ babel internal serialized type": "Error", + "message": "Invalid identifier @@asyncIterator (1:19)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "InvalidIdentifier" + } ], "program": { "type": "Program", 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 106b8002e3e1..165da28cba53 100644 --- a/packages/babel-parser/test/fixtures/flow/iterator/04/output.json +++ b/packages/babel-parser/test/fixtures/flow/iterator/04/output.json @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":15,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":15}}, "errors": [ - "SyntaxError: Invalid identifier @@iterator (1:14)" + { + "$$ babel internal serialized type": "Error", + "message": "Invalid identifier @@iterator (1:14)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "InvalidIdentifier" + } ], "program": { "type": "Program", 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 ca6b8b096ca9..3ac7d084ce9e 100644 --- a/packages/babel-parser/test/fixtures/flow/iterator/05/output.json +++ b/packages/babel-parser/test/fixtures/flow/iterator/05/output.json @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":33,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "errors": [ - "SyntaxError: Invalid identifier @@asyncIterator (2:17)" + { + "$$ babel internal serialized type": "Error", + "message": "Invalid identifier @@asyncIterator (2:17)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "InvalidIdentifier" + } ], "program": { "type": "Program", 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 fad3d4597882..fa8e342aee7b 100644 --- a/packages/babel-parser/test/fixtures/flow/iterator/06/output.json +++ b/packages/babel-parser/test/fixtures/flow/iterator/06/output.json @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":28,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "errors": [ - "SyntaxError: Invalid identifier @@iterator (2:12)" + { + "$$ babel internal serialized type": "Error", + "message": "Invalid identifier @@iterator (2:12)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "InvalidIdentifier" + } ], "program": { "type": "Program", 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 265adf68c112..3af775d1c6c1 100644 --- a/packages/babel-parser/test/fixtures/flow/iterator/07/output.json +++ b/packages/babel-parser/test/fixtures/flow/iterator/07/output.json @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":24,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":24}}, "errors": [ - "SyntaxError: Invalid identifier @@iterator (1:15)" + { + "$$ babel internal serialized type": "Error", + "message": "Invalid identifier @@iterator (1:15)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "InvalidIdentifier" + } ], "program": { "type": "Program", 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 278c95feaf01..61ad9c89e959 100644 --- a/packages/babel-parser/test/fixtures/flow/iterator/08/output.json +++ b/packages/babel-parser/test/fixtures/flow/iterator/08/output.json @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":29,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":29}}, "errors": [ - "SyntaxError: Invalid identifier @@asyncIterator (1:20)" + { + "$$ babel internal serialized type": "Error", + "message": "Invalid identifier @@asyncIterator (1:20)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "InvalidIdentifier" + } ], "program": { "type": "Program", 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 07177225478a..894b9fe7ef20 100644 --- a/packages/babel-parser/test/fixtures/flow/iterator/09/output.json +++ b/packages/babel-parser/test/fixtures/flow/iterator/09/output.json @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":29,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "errors": [ - "SyntaxError: Invalid identifier @@iterator (2:12)" + { + "$$ babel internal serialized type": "Error", + "message": "Invalid identifier @@iterator (2:12)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "InvalidIdentifier" + } ], "program": { "type": "Program", 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 836c3af1af2b..bb4ca096b5ae 100644 --- a/packages/babel-parser/test/fixtures/flow/iterator/10/output.json +++ b/packages/babel-parser/test/fixtures/flow/iterator/10/output.json @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":34,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "errors": [ - "SyntaxError: Invalid identifier @@asyncIterator (2:17)" + { + "$$ babel internal serialized type": "Error", + "message": "Invalid identifier @@asyncIterator (2:17)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "InvalidIdentifier" + } ], "program": { "type": "Program", 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 a97fb3437b0c..8e920a0e6612 100644 --- a/packages/babel-parser/test/fixtures/flow/iterator/11/output.json +++ b/packages/babel-parser/test/fixtures/flow/iterator/11/output.json @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":27,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "errors": [ - "SyntaxError: Invalid identifier @@random (2:10)" + { + "$$ babel internal serialized type": "Error", + "message": "Invalid identifier @@random (2:10)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "InvalidIdentifier" + } ], "program": { "type": "Program", 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 246523ff7330..eb5c2f006664 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 @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "Identifier 'C1' has already been declared (2:6)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "VarRedeclaration" + } ], "program": { "type": "Program", 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 edb012f084b6..243646a42a9b 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 @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "Identifier 'I' has already been declared (2:10)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "VarRedeclaration" + } ], "program": { "type": "Program", 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 a17be34d1705..760e10bb81e4 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 @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "Identifier 'T1' has already been declared (2:5)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "VarRedeclaration" + } ], "program": { "type": "Program", 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 200019bb51bd..bb43961b592c 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 @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "getter must not have any formal parameters (2:2)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "BadGetterArity" + } ], "program": { "type": "Program", 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 d98c7d2c4130..bcbd20a6f77d 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 @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "getter must not have any formal parameters (2:2)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "BadGetterArity" + } ], "program": { "type": "Program", 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 fa18c3c235cd..adc1c43bd9cf 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 @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "setter must have exactly one formal parameter (2:2)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "BadSetterArity" + } ], "program": { "type": "Program", 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 b2207b3a6f28..dd3558d89d56 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 @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "setter function argument must not be a rest parameter (2:2)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "BadSetterRestParameter" + } ], "program": { "type": "Program", 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 200ac258b04e..57ddf003f529 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 @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":28,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":28}}, "errors": [ - "SyntaxError: Cannot overwrite reserved type string (1:12)" + { + "$$ babel internal serialized type": "Error", + "message": "Cannot overwrite reserved type string (1:12)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "AssignReservedType" + } ], "program": { "type": "Program", 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 8472638da812..30164beb3da4 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 @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "A binding pattern parameter cannot be optional in an implementation signature. (1:11)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "OptionalBindingPattern" + } ], "program": { "type": "Program", 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 8c9ecb9c8b7d..1dfff7343d8f 100644 --- a/packages/babel-parser/test/fixtures/flow/predicates/4/output.json +++ b/packages/babel-parser/test/fixtures/flow/predicates/4/output.json @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "Spaces between `%` and `checks` are not allowed here. (1:20)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "UnexpectedSpaceBetweenModuloChecks" + } ], "program": { "type": "Program", 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 484e2d071713..3f5b04bac8b2 100644 --- a/packages/babel-parser/test/fixtures/flow/predicates/5/output.json +++ b/packages/babel-parser/test/fixtures/flow/predicates/5/output.json @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "Spaces between `%` and `checks` are not allowed here. (1:17)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "UnexpectedSpaceBetweenModuloChecks" + } ], "program": { "type": "Program", 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 92d62672928e..2aec1ed8b4f9 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 @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "Binding invalid left-hand side in function parameter list (2:11)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "InvalidLhsBinding" + } ], "program": { "type": "Program", @@ -13,6 +19,13 @@ { "type": "ExpressionStatement", "start":43,"end":67,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":24}}, + "leadingComments": [ + { + "type": "CommentLine", + "value": " Function which looks like a return type", + "start":0,"end":42,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":42}} + } + ], "expression": { "type": "ConditionalExpression", "start":43,"end":66,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":23}}, @@ -24,11 +37,11 @@ "consequent": { "type": "Identifier", "start":48,"end":49,"loc":{"start":{"line":2,"column":5},"end":{"line":2,"column":6},"identifierName":"b"}, - "name": "b", "extra": { "parenthesized": true, "parenStart": 47 - } + }, + "name": "b" }, "alternate": { "type": "ArrowFunctionExpression", @@ -63,14 +76,7 @@ "name": "e" } } - }, - "leadingComments": [ - { - "type": "CommentLine", - "value": " Function which looks like a return type", - "start":0,"end":42,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":42}} - } - ] + } } ], "directives": [] diff --git a/packages/babel-parser/test/fixtures/flow/regression/issue-58-failing-2/output.json b/packages/babel-parser/test/fixtures/flow/regression/issue-58-failing-2/output.json index f6bdf3a0ad89..22badf9a3139 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 @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "Binding invalid left-hand side in function parameter list (2:8)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "InvalidLhsBinding" + } ], "program": { "type": "Program", @@ -13,6 +19,13 @@ { "type": "ExpressionStatement", "start":47,"end":83,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":36}}, + "leadingComments": [ + { + "type": "CommentLine", + "value": " Invalid LHS parameter after type parameters", + "start":0,"end":46,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":46}} + } + ], "expression": { "type": "ConditionalExpression", "start":47,"end":82,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":35}}, @@ -66,11 +79,11 @@ "body": { "type": "Identifier", "start":71,"end":72,"loc":{"start":{"line":2,"column":24},"end":{"line":2,"column":25},"identifierName":"e"}, - "name": "e", "extra": { "parenthesized": true, "parenStart": 70 - } + }, + "name": "e" }, "typeParameters": { "type": "TypeParameterDeclaration", @@ -104,14 +117,7 @@ "name": "g" } } - }, - "leadingComments": [ - { - "type": "CommentLine", - "value": " Invalid LHS parameter after type parameters", - "start":0,"end":46,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":46}} - } - ] + } } ], "directives": [] diff --git a/packages/babel-parser/test/fixtures/flow/regression/issue-58-failing-3/output.json b/packages/babel-parser/test/fixtures/flow/regression/issue-58-failing-3/output.json index d527059cda90..7848f69f5b9d 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 @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "Binding invalid left-hand side in function parameter list (2:5)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "InvalidLhsBinding" + } ], "program": { "type": "Program", @@ -13,6 +19,13 @@ { "type": "ExpressionStatement", "start":47,"end":76,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":29}}, + "leadingComments": [ + { + "type": "CommentLine", + "value": " Invalid LHS parameter after type parameters", + "start":0,"end":46,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":46}} + } + ], "expression": { "type": "ConditionalExpression", "start":47,"end":75,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":28}}, @@ -51,11 +64,11 @@ "body": { "type": "Identifier", "start":64,"end":65,"loc":{"start":{"line":2,"column":17},"end":{"line":2,"column":18},"identifierName":"e"}, - "name": "e", "extra": { "parenthesized": true, "parenStart": 63 - } + }, + "name": "e" } }, "alternate": { @@ -77,14 +90,7 @@ "name": "g" } } - }, - "leadingComments": [ - { - "type": "CommentLine", - "value": " Invalid LHS parameter after type parameters", - "start":0,"end":46,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":46}} - } - ] + } } ], "directives": [] diff --git a/packages/babel-parser/test/fixtures/flow/regression/issue-58-failing-4/output.json b/packages/babel-parser/test/fixtures/flow/regression/issue-58-failing-4/output.json index 72ec0ee8727d..ec17798c2bd3 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 @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "Binding invalid left-hand side in function parameter list (2:11)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "InvalidLhsBinding" + } ], "program": { "type": "Program", @@ -13,6 +19,13 @@ { "type": "ExpressionStatement", "start":25,"end":60,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":35}}, + "leadingComments": [ + { + "type": "CommentLine", + "value": " Invalid LHS parameter", + "start":0,"end":24,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":24}} + } + ], "expression": { "type": "ConditionalExpression", "start":25,"end":59,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":34}}, @@ -51,11 +64,11 @@ "body": { "type": "Identifier", "start":48,"end":49,"loc":{"start":{"line":2,"column":23},"end":{"line":2,"column":24},"identifierName":"d"}, - "name": "d", "extra": { "parenthesized": true, "parenStart": 47 - } + }, + "name": "d" } }, "alternate": { @@ -77,14 +90,7 @@ "name": "g" } } - }, - "leadingComments": [ - { - "type": "CommentLine", - "value": " Invalid LHS parameter", - "start":0,"end":24,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":24}} - } - ] + } } ], "directives": [] diff --git a/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-const-declare-class/output.json b/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-const-declare-class/output.json index c3c7f880bf51..0ffcbdb40278 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 @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "Identifier 'A' has already been declared (2:14)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "VarRedeclaration" + } ], "program": { "type": "Program", 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 24563be730dc..8fca57d68073 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 @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "Identifier 'A' has already been declared (2:18)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "VarRedeclaration" + } ], "program": { "type": "Program", 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 b687d1711180..d742d05141bc 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 @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "Identifier 'A' has already been declared (2:10)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "VarRedeclaration" + } ], "program": { "type": "Program", 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 baeda3cb81d9..0e253c293e1a 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 @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "Identifier 'A' has already been declared (2:12)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "VarRedeclaration" + } ], "program": { "type": "Program", 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 efef58004674..cb592845a59f 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 @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "Identifier 'A' has already been declared (2:5)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "VarRedeclaration" + } ], "program": { "type": "Program", 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 33e3c985215c..b55374a55b3d 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 @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "Identifier 'A' has already been declared (2:18)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "VarRedeclaration" + } ], "program": { "type": "Program", 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 555f58649c80..778b03e402fb 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 @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "Identifier 'A' has already been declared (2:14)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "VarRedeclaration" + } ], "program": { "type": "Program", 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 dd8f7d4acb27..f924952097c4 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 @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "Identifier 'A' has already been declared (2:4)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "VarRedeclaration" + } ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-func-declare-func/output.json b/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-func-declare-func/output.json index ac0fe1790e79..a9466132710d 100644 --- a/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-func-declare-func/output.json +++ b/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-func-declare-func/output.json @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":43,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":27}}, "errors": [ - "SyntaxError: Identifier 'A' has already been declared (2:17)" + { + "$$ babel internal serialized type": "Error", + "message": "Identifier 'A' has already been declared (2:17)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "VarRedeclaration" + } ], "program": { "type": "Program", 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 4f2b265c8859..542f3f8c47c5 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 @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "Identifier 'A' has already been declared (2:10)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "VarRedeclaration" + } ], "program": { "type": "Program", 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 d1e848e45942..8e08c908acc4 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 @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "Identifier 'A' has already been declared (2:14)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "VarRedeclaration" + } ], "program": { "type": "Program", 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 6a4433ea75d3..ea1f6ba27fd5 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 @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "Identifier 'A' has already been declared (2:18)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "VarRedeclaration" + } ], "program": { "type": "Program", 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 d102313ba870..6bf9794e3838 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 @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "Identifier 'A' has already been declared (2:10)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "VarRedeclaration" + } ], "program": { "type": "Program", 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 085f418b8da3..045d7342c109 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 @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "Identifier 'A' has already been declared (2:12)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "VarRedeclaration" + } ], "program": { "type": "Program", 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 4f7bdf0cd238..ea8348422a3c 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 @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "Identifier 'A' has already been declared (2:5)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "VarRedeclaration" + } ], "program": { "type": "Program", 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 b68fa592840b..342c207408b5 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 @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "Identifier 'A' has already been declared (2:6)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "VarRedeclaration" + } ], "program": { "type": "Program", 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 00382a7d0f82..941ff02ef87d 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 @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "Identifier 'A' has already been declared (2:4)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "VarRedeclaration" + } ], "program": { "type": "Program", 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 bbcc52e79f84..ec918027520a 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 @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "Identifier 'A' has already been declared (2:12)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "VarRedeclaration" + } ], "program": { "type": "Program", 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 ae77d22a5326..27aa6062ee48 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 @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "Identifier 'A' has already been declared (2:5)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "VarRedeclaration" + } ], "program": { "type": "Program", 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 fcfa4d85054d..591f51804915 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 @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "Identifier 'A' has already been declared (2:4)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "VarRedeclaration" + } ], "program": { "type": "Program", 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 6170eb332b03..250c946adfab 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 @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "Identifier 'A' has already been declared (2:6)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "VarRedeclaration" + } ], "program": { "type": "Program", 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 017c30dec6cd..87eeeca0f6b3 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 @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "Identifier 'A' has already been declared (2:10)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "VarRedeclaration" + } ], "program": { "type": "Program", 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 33397a54dd82..5f2faa4c596d 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 @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "Identifier 'A' has already been declared (2:4)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "VarRedeclaration" + } ], "program": { "type": "Program", 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 13e009e688b1..314b40b48ee7 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 @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "Identifier 'A' has already been declared (2:12)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "VarRedeclaration" + } ], "program": { "type": "Program", 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 b6c3a2ed34c1..a8e7507d1994 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 @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "Identifier 'A' has already been declared (2:5)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "VarRedeclaration" + } ], "program": { "type": "Program", 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 31719046a5b5..01f78fd1d0d2 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 @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "Identifier 'A' has already been declared (2:4)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "VarRedeclaration" + } ], "program": { "type": "Program", 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 0dbab3e68b36..5dfff3a38e37 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 @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "Identifier 'A' has already been declared (2:18)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "VarRedeclaration" + } ], "program": { "type": "Program", 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 80e7ca6b69f3..4a2713f48f80 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 @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "Identifier 'A' has already been declared (2:10)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "VarRedeclaration" + } ], "program": { "type": "Program", 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 22d33f342732..298a1f1cfd11 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 @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "Identifier 'A' has already been declared (2:12)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "VarRedeclaration" + } ], "program": { "type": "Program", 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 749d355f7d5f..c9af2b48d4f4 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 @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "Identifier 'A' has already been declared (2:5)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "VarRedeclaration" + } ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/flow/this-annotation/default/output.json b/packages/babel-parser/test/fixtures/flow/this-annotation/default/output.json index 594580b04d84..0dda6942630e 100644 --- a/packages/babel-parser/test/fixtures/flow/this-annotation/default/output.json +++ b/packages/babel-parser/test/fixtures/flow/this-annotation/default/output.json @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":38,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":38}}, "errors": [ - "SyntaxError: The `this` parameter may not have a default value. (1:17)" + { + "$$ babel internal serialized type": "Error", + "message": "The `this` parameter may not have a default value. (1:17)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "ThisParamNoDefault" + } ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/flow/this-annotation/object-method-type-this-not-first/output.json b/packages/babel-parser/test/fixtures/flow/this-annotation/object-method-type-this-not-first/output.json index 8a93ef574818..0360b46e92de 100644 --- a/packages/babel-parser/test/fixtures/flow/this-annotation/object-method-type-this-not-first/output.json +++ b/packages/babel-parser/test/fixtures/flow/this-annotation/object-method-type-this-not-first/output.json @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":54,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "errors": [ - "SyntaxError: The `this` parameter must be the first function parameter. (2:20)" + { + "$$ babel internal serialized type": "Error", + "message": "The `this` parameter must be the first function parameter. (2:20)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "ThisParamMustBeFirst" + } ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/flow/this-annotation/this-arrow-function/output.json b/packages/babel-parser/test/fixtures/flow/this-annotation/this-arrow-function/output.json index 954fd71984d6..6f3fef17858b 100644 --- a/packages/babel-parser/test/fixtures/flow/this-annotation/this-arrow-function/output.json +++ b/packages/babel-parser/test/fixtures/flow/this-annotation/this-arrow-function/output.json @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":28,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":28}}, "errors": [ - "SyntaxError: Binding invalid left-hand side in function parameter list (1:9)" + { + "$$ babel internal serialized type": "Error", + "message": "Binding invalid left-hand side in function parameter list (1:9)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "InvalidLhsBinding" + } ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/flow/this-annotation/this-constructor-declare/output.json b/packages/babel-parser/test/fixtures/flow/this-annotation/this-constructor-declare/output.json index d3461e69afbc..08dd884a0696 100644 --- a/packages/babel-parser/test/fixtures/flow/this-annotation/this-constructor-declare/output.json +++ b/packages/babel-parser/test/fixtures/flow/this-annotation/this-constructor-declare/output.json @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":55,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "errors": [ - "SyntaxError: Constructors cannot have a `this` parameter; constructors don't bind `this` like other functions. (2:16)" + { + "$$ babel internal serialized type": "Error", + "message": "Constructors cannot have a `this` parameter; constructors don't bind `this` like other functions. (2:16)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "ThisParamBannedInConstructor" + } ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/flow/this-annotation/this-constructor/output.json b/packages/babel-parser/test/fixtures/flow/this-annotation/this-constructor/output.json index 3ed70ed007b6..1f944b441253 100644 --- a/packages/babel-parser/test/fixtures/flow/this-annotation/this-constructor/output.json +++ b/packages/babel-parser/test/fixtures/flow/this-annotation/this-constructor/output.json @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":42,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "errors": [ - "SyntaxError: Constructors cannot have a `this` parameter; constructors don't bind `this` like other functions. (2:2)" + { + "$$ babel internal serialized type": "Error", + "message": "Constructors cannot have a `this` parameter; constructors don't bind `this` like other functions. (2:2)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "ThisParamBannedInConstructor" + } ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/flow/this-annotation/this-getter-type/output.json b/packages/babel-parser/test/fixtures/flow/this-annotation/this-getter-type/output.json index 1d448d6fd698..9ff6f4813550 100644 --- a/packages/babel-parser/test/fixtures/flow/this-annotation/this-getter-type/output.json +++ b/packages/babel-parser/test/fixtures/flow/this-annotation/this-getter-type/output.json @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":43,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "errors": [ - "SyntaxError: A getter cannot have a `this` parameter. (2:10)" + { + "$$ babel internal serialized type": "Error", + "message": "A getter cannot have a `this` parameter. (2:10)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "GetterMayNotHaveThisParam" + } ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/flow/this-annotation/this-getter/output.json b/packages/babel-parser/test/fixtures/flow/this-annotation/this-getter/output.json index 320f898c90e4..c62440b30a5f 100644 --- a/packages/babel-parser/test/fixtures/flow/this-annotation/this-getter/output.json +++ b/packages/babel-parser/test/fixtures/flow/this-annotation/this-getter/output.json @@ -2,8 +2,20 @@ "type": "File", "start":0,"end":40,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "errors": [ - "SyntaxError: getter must not have any formal parameters (2:2)", - "SyntaxError: A getter cannot have a `this` parameter. (2:10)" + { + "$$ babel internal serialized type": "Error", + "message": "getter must not have any formal parameters (2:2)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "BadGetterArity" + }, + { + "$$ babel internal serialized type": "Error", + "message": "A getter cannot have a `this` parameter. (2:10)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "GetterMayNotHaveThisParam" + } ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/flow/this-annotation/this-no-annot/output.json b/packages/babel-parser/test/fixtures/flow/this-annotation/this-no-annot/output.json index dbbbe1ef2f31..2bb4a3910f20 100644 --- a/packages/babel-parser/test/fixtures/flow/this-annotation/this-no-annot/output.json +++ b/packages/babel-parser/test/fixtures/flow/this-annotation/this-no-annot/output.json @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":22,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":22}}, "errors": [ - "SyntaxError: A type annotation is required for the `this` parameter. (1:14)" + { + "$$ babel internal serialized type": "Error", + "message": "A type annotation is required for the `this` parameter. (1:14)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "ThisParamAnnotationRequired" + } ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/flow/this-annotation/this-not-first-type/output.json b/packages/babel-parser/test/fixtures/flow/this-annotation/this-not-first-type/output.json index e903a001115c..ca06db975a48 100644 --- a/packages/babel-parser/test/fixtures/flow/this-annotation/this-not-first-type/output.json +++ b/packages/babel-parser/test/fixtures/flow/this-annotation/this-not-first-type/output.json @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":44,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":44}}, "errors": [ - "SyntaxError: The `this` parameter must be the first function parameter. (1:22)" + { + "$$ babel internal serialized type": "Error", + "message": "The `this` parameter must be the first function parameter. (1:22)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "ThisParamMustBeFirst" + } ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/flow/this-annotation/this-not-first/output.json b/packages/babel-parser/test/fixtures/flow/this-annotation/this-not-first/output.json index 02b00d783712..a172c5b8bd57 100644 --- a/packages/babel-parser/test/fixtures/flow/this-annotation/this-not-first/output.json +++ b/packages/babel-parser/test/fixtures/flow/this-annotation/this-not-first/output.json @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":43,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":43}}, "errors": [ - "SyntaxError: The `this` parameter must be the first function parameter. (1:26)" + { + "$$ babel internal serialized type": "Error", + "message": "The `this` parameter must be the first function parameter. (1:26)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "ThisParamMustBeFirst" + } ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/flow/this-annotation/this-optional-type/output.json b/packages/babel-parser/test/fixtures/flow/this-annotation/this-optional-type/output.json index 6e19b60a59cb..4bd3d986cfb2 100644 --- a/packages/babel-parser/test/fixtures/flow/this-annotation/this-optional-type/output.json +++ b/packages/babel-parser/test/fixtures/flow/this-annotation/this-optional-type/output.json @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":33,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":33}}, "errors": [ - "SyntaxError: The `this` parameter cannot be optional. (1:10)" + { + "$$ babel internal serialized type": "Error", + "message": "The `this` parameter cannot be optional. (1:10)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "ThisParamMayNotBeOptional" + } ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/flow/this-annotation/this-optional/output.json b/packages/babel-parser/test/fixtures/flow/this-annotation/this-optional/output.json index 33bd48751feb..9cd701970275 100644 --- a/packages/babel-parser/test/fixtures/flow/this-annotation/this-optional/output.json +++ b/packages/babel-parser/test/fixtures/flow/this-annotation/this-optional/output.json @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":31,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":31}}, "errors": [ - "SyntaxError: The `this` parameter cannot be optional. (1:13)" + { + "$$ babel internal serialized type": "Error", + "message": "The `this` parameter cannot be optional. (1:13)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "ThisParamMayNotBeOptional" + } ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/flow/this-annotation/this-setter-type/output.json b/packages/babel-parser/test/fixtures/flow/this-annotation/this-setter-type/output.json index 06408c4054a1..1dde2c86fcf0 100644 --- a/packages/babel-parser/test/fixtures/flow/this-annotation/this-setter-type/output.json +++ b/packages/babel-parser/test/fixtures/flow/this-annotation/this-setter-type/output.json @@ -2,8 +2,20 @@ "type": "File", "start":0,"end":43,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "errors": [ - "SyntaxError: A setter cannot have a `this` parameter. (2:10)", - "SyntaxError: setter must have exactly one formal parameter (2:2)" + { + "$$ babel internal serialized type": "Error", + "message": "A setter cannot have a `this` parameter. (2:10)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "SetterMayNotHaveThisParam" + }, + { + "$$ babel internal serialized type": "Error", + "message": "setter must have exactly one formal parameter (2:2)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "BadSetterArity" + } ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/flow/this-annotation/this-setter/output.json b/packages/babel-parser/test/fixtures/flow/this-annotation/this-setter/output.json index b71169d3ea5d..6e5a3af923d9 100644 --- a/packages/babel-parser/test/fixtures/flow/this-annotation/this-setter/output.json +++ b/packages/babel-parser/test/fixtures/flow/this-annotation/this-setter/output.json @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":40,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "errors": [ - "SyntaxError: A setter cannot have a `this` parameter. (2:10)" + { + "$$ babel internal serialized type": "Error", + "message": "A setter cannot have a `this` parameter. (2:10)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "SetterMayNotHaveThisParam" + } ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/flow/this-annotation/this-string-literal-constructor/output.json b/packages/babel-parser/test/fixtures/flow/this-annotation/this-string-literal-constructor/output.json index c9c0891bdef7..436441bd3707 100644 --- a/packages/babel-parser/test/fixtures/flow/this-annotation/this-string-literal-constructor/output.json +++ b/packages/babel-parser/test/fixtures/flow/this-annotation/this-string-literal-constructor/output.json @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":44,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "errors": [ - "SyntaxError: Constructors cannot have a `this` parameter; constructors don't bind `this` like other functions. (2:2)" + { + "$$ babel internal serialized type": "Error", + "message": "Constructors cannot have a `this` parameter; constructors don't bind `this` like other functions. (2:2)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "ThisParamBannedInConstructor" + } ], "program": { "type": "Program", 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 bd280f5d148b..83163dc6af3d 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 @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":21,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":21}}, "errors": [ - "SyntaxError: Cannot overwrite reserved type number (1:5)" + { + "$$ babel internal serialized type": "Error", + "message": "Cannot overwrite reserved type number (1:5)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "AssignReservedType" + } ], "program": { "type": "Program", 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 a9ad9925ad29..2ad7f7e49ccd 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 @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":26,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":26}}, "errors": [ - "SyntaxError: Unexpected reserved type number (1:9)" + { + "$$ babel internal serialized type": "Error", + "message": "Unexpected reserved type number (1:9)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "UnexpectedReservedType" + } ], "program": { "type": "Program", 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 4ffc8971610e..c20ea27c15c1 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 @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":53,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "errors": [ - "SyntaxError: Unexpected reserved type string (1:11)" + { + "$$ babel internal serialized type": "Error", + "message": "Unexpected reserved type string (1:11)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "UnexpectedReservedType" + } ], "program": { "type": "Program", 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 6f5bb81982ce..7f183cc558b5 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 @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":24,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":24}}, "errors": [ - "SyntaxError: Cannot overwrite reserved type bool (1:13)" + { + "$$ babel internal serialized type": "Error", + "message": "Cannot overwrite reserved type bool (1:13)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "AssignReservedType" + } ], "program": { "type": "Program", 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 1c70bbf4c422..36e54e4b0d84 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 @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "Spread operator cannot appear in class or interface definitions (2:1)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "UnexpectedSpreadType" + } ], "program": { "type": "Program", 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 f3000dfc4440..857d9ffebbf1 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 @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":31,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":2}}, "errors": [ - "SyntaxError: Spread properties cannot have variance (3:1)" + { + "$$ babel internal serialized type": "Error", + "message": "Spread properties cannot have variance (3:1)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "SpreadVariance" + } ], "program": { "type": "Program", 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 9822fae01d58..fb2528cc0a2b 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 @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":47,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":38}}, "errors": [ - "SyntaxError: Unexpected reserved type interface (2:21)" + { + "$$ babel internal serialized type": "Error", + "message": "Unexpected reserved type interface (2:21)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "UnexpectedReservedType" + } ], "program": { "type": "Program", @@ -13,6 +19,13 @@ { "type": "VariableDeclaration", "start":9,"end":47,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":38}}, + "leadingComments": [ + { + "type": "CommentLine", + "value": " @flow", + "start":0,"end":8,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":8}} + } + ], "declarations": [ { "type": "VariableDeclarator", @@ -60,14 +73,7 @@ } } ], - "kind": "const", - "leadingComments": [ - { - "type": "CommentLine", - "value": " @flow", - "start":0,"end":8,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":8}} - } - ] + "kind": "const" } ], "directives": [] diff --git a/packages/babel-parser/test/fixtures/flow/type-annotations/typeof-reserved-invalid-3/output.json b/packages/babel-parser/test/fixtures/flow/type-annotations/typeof-reserved-invalid-3/output.json index f719b76ee8a7..016f078f874e 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 @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":45,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":36}}, "errors": [ - "SyntaxError: Unexpected reserved type number (2:22)" + { + "$$ babel internal serialized type": "Error", + "message": "Unexpected reserved type number (2:22)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "UnexpectedReservedType" + } ], "program": { "type": "Program", @@ -13,6 +19,13 @@ { "type": "VariableDeclaration", "start":9,"end":45,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":36}}, + "leadingComments": [ + { + "type": "CommentLine", + "value": " @flow", + "start":0,"end":8,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":8}} + } + ], "declarations": [ { "type": "VariableDeclarator", @@ -60,14 +73,7 @@ } } ], - "kind": "const", - "leadingComments": [ - { - "type": "CommentLine", - "value": " @flow", - "start":0,"end":8,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":8}} - } - ] + "kind": "const" } ], "directives": [] diff --git a/packages/babel-parser/test/fixtures/flow/type-annotations/typeof-reserved-invalid-4/output.json b/packages/babel-parser/test/fixtures/flow/type-annotations/typeof-reserved-invalid-4/output.json index 0335f33501c6..78bca8480551 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 @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":39,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":30}}, "errors": [ - "SyntaxError: Unexpected reserved word 'static' (2:16)" + { + "$$ babel internal serialized type": "Error", + "message": "Unexpected reserved word 'static' (2:16)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "UnexpectedReservedWord" + } ], "program": { "type": "Program", @@ -13,6 +19,13 @@ { "type": "VariableDeclaration", "start":9,"end":39,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":30}}, + "leadingComments": [ + { + "type": "CommentLine", + "value": " @flow", + "start":0,"end":8,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":8}} + } + ], "declarations": [ { "type": "VariableDeclarator", @@ -51,14 +64,7 @@ } } ], - "kind": "const", - "leadingComments": [ - { - "type": "CommentLine", - "value": " @flow", - "start":0,"end":8,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":8}} - } - ] + "kind": "const" } ], "directives": [] diff --git a/packages/babel-parser/test/fixtures/flow/type-annotations/typeof-reserved-invalid-6/output.json b/packages/babel-parser/test/fixtures/flow/type-annotations/typeof-reserved-invalid-6/output.json index 6a21871a8258..9db335dbe3a3 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 @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":49,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":40}}, "errors": [ - "SyntaxError: Unexpected reserved type interface (2:18)" + { + "$$ babel internal serialized type": "Error", + "message": "Unexpected reserved type interface (2:18)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "UnexpectedReservedType" + } ], "program": { "type": "Program", @@ -13,6 +19,13 @@ { "type": "VariableDeclaration", "start":9,"end":49,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":40}}, + "leadingComments": [ + { + "type": "CommentLine", + "value": " @flow", + "start":0,"end":8,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":8}} + } + ], "declarations": [ { "type": "VariableDeclarator", @@ -60,14 +73,7 @@ } } ], - "kind": "const", - "leadingComments": [ - { - "type": "CommentLine", - "value": " @flow", - "start":0,"end":8,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":8}} - } - ] + "kind": "const" } ], "directives": [] 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 8b2be7f584af..8cc936f61f74 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 @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "Type annotations must come before default assignments, e.g. instead of `age = 25: number` use `age: number = 25` (1:20)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "TypeBeforeInitializer" + } ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/flow/type-generics/async-arrow-invalid/output.json b/packages/babel-parser/test/fixtures/flow/type-generics/async-arrow-invalid/output.json index bccd704e2e4e..5521b9d815bc 100644 --- a/packages/babel-parser/test/fixtures/flow/type-generics/async-arrow-invalid/output.json +++ b/packages/babel-parser/test/fixtures/flow/type-generics/async-arrow-invalid/output.json @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":18,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":18}}, "errors": [ - "SyntaxError: Type parameters must come after the async keyword, e.g. instead of ` async () => {}`, use `async () => {}` (1:0)" + { + "$$ babel internal serialized type": "Error", + "message": "Type parameters must come after the async keyword, e.g. instead of ` async () => {}`, use `async () => {}` (1:0)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "UnexpectedTypeParameterBeforeAsyncArrowFunction" + } ], "program": { "type": "Program", @@ -43,4 +49,4 @@ ], "directives": [] } -} +} \ No newline at end of file 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 cbd99a19951e..608555e6845c 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 @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":34,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":34}}, "errors": [ - "SyntaxError: Cannot overwrite reserved type string (1:14)" + { + "$$ babel internal serialized type": "Error", + "message": "Cannot overwrite reserved type string (1:14)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "AssignReservedType" + } ], "program": { "type": "Program", 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 1e241ce54643..316c2546fd14 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 @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":32,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":32}}, "errors": [ - "SyntaxError: Cannot overwrite reserved type string (1:14)" + { + "$$ babel internal serialized type": "Error", + "message": "Cannot overwrite reserved type string (1:14)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "AssignReservedType" + } ], "program": { "type": "Program", 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 4598f3355fcf..f9fe254568ef 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 @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":37,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":37}}, "errors": [ - "SyntaxError: Cannot overwrite reserved type string (1:19)" + { + "$$ babel internal serialized type": "Error", + "message": "Cannot overwrite reserved type string (1:19)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "AssignReservedType" + } ], "program": { "type": "Program", 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 20c6c607313f..f98517378a25 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 @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":39,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":39}}, "errors": [ - "SyntaxError: Unexpected keyword 'debugger' (1:17)" + { + "$$ babel internal serialized type": "Error", + "message": "Unexpected keyword 'debugger' (1:17)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "UnexpectedKeyword" + } ], "program": { "type": "Program", 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 37af63c0996a..cb118f6718b5 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 @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "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)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "ImportTypeShorthandOnlyInPureImport" + } ], "program": { "type": "Program", 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 56fba75c81f5..c6053d9208f4 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 @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":36,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":36}}, "errors": [ - "SyntaxError: Cannot overwrite reserved type string (1:16)" + { + "$$ babel internal serialized type": "Error", + "message": "Cannot overwrite reserved type string (1:16)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "AssignReservedType" + } ], "program": { "type": "Program", 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 ff46538a95f6..9729cc522746 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 @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":34,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":34}}, "errors": [ - "SyntaxError: Cannot overwrite reserved type string (1:14)" + { + "$$ babel internal serialized type": "Error", + "message": "Cannot overwrite reserved type string (1:14)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "AssignReservedType" + } ], "program": { "type": "Program", 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 8d2dd58fa474..f09dbe2417dd 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 @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "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)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "ImportTypeShorthandOnlyInPureImport" + } ], "program": { "type": "Program", 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 78cb69bb8dea..75e10efbd201 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 @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":30,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":30}}, "errors": [ - "SyntaxError: Cannot overwrite reserved type string (1:12)" + { + "$$ babel internal serialized type": "Error", + "message": "Cannot overwrite reserved type string (1:12)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "AssignReservedType" + } ], "program": { "type": "Program", 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 127bd9282556..41e98c9aace1 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 @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "Type parameter declaration needs a default, since a preceding type parameter declaration has a default. (1:28)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "MissingTypeParamDefault" + } ], "program": { "type": "Program", 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 3c1f8ac956fb..fc6870caf13a 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 @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":23,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":23}}, "errors": [ - "SyntaxError: Unexpected keyword 'delete' (1:14)" + { + "$$ babel internal serialized type": "Error", + "message": "Unexpected keyword 'delete' (1:14)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "UnexpectedKeyword" + } ], "program": { "type": "Program", 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 ebd1f2cd376b..f355f1c05c81 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 @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "`_` is only allowed as a type argument to call or new (2:16)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "UnexpectedReservedUnderscore" + } ], "program": { "type": "Program", @@ -13,6 +19,13 @@ { "type": "VariableDeclaration", "start":8,"end":30,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":22}}, + "leadingComments": [ + { + "type": "CommentLine", + "value": "@flow", + "start":0,"end":7,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":7}} + } + ], "declarations": [ { "type": "VariableDeclarator", @@ -62,14 +75,7 @@ } } ], - "kind": "var", - "leadingComments": [ - { - "type": "CommentLine", - "value": "@flow", - "start":0,"end":7,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":7}} - } - ] + "kind": "var" } ], "directives": [] diff --git a/packages/babel-parser/test/fixtures/flow/typeapp-call/underscore_is_illegal_type_name/output.json b/packages/babel-parser/test/fixtures/flow/typeapp-call/underscore_is_illegal_type_name/output.json index ab4466e15218..a3a9ad066c4c 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 @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":24,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":16}}, "errors": [ - "SyntaxError: Cannot overwrite reserved type _ (2:5)" + { + "$$ babel internal serialized type": "Error", + "message": "Cannot overwrite reserved type _ (2:5)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "AssignReservedType" + } ], "program": { "type": "Program", @@ -13,6 +19,13 @@ { "type": "TypeAlias", "start":8,"end":24,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":16}}, + "leadingComments": [ + { + "type": "CommentLine", + "value": "@flow", + "start":0,"end":7,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":7}} + } + ], "id": { "type": "Identifier", "start":13,"end":14,"loc":{"start":{"line":2,"column":5},"end":{"line":2,"column":6},"identifierName":"_"}, @@ -22,14 +35,7 @@ "right": { "type": "NumberTypeAnnotation", "start":17,"end":23,"loc":{"start":{"line":2,"column":9},"end":{"line":2,"column":15}} - }, - "leadingComments": [ - { - "type": "CommentLine", - "value": "@flow", - "start":0,"end":7,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":7}} - } - ] + } } ], "directives": [] diff --git a/packages/babel-parser/test/fixtures/flow/typeapp-call/underscore_is_illegal_type_param_name/output.json b/packages/babel-parser/test/fixtures/flow/typeapp-call/underscore_is_illegal_type_param_name/output.json index a0f7c08fcadc..13f2c8fb3b10 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 @@ -2,8 +2,20 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "Unexpected reserved type _ (2:13)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "UnexpectedReservedType" + }, + { + "$$ babel internal serialized type": "Error", + "message": "`_` is only allowed as a type argument to call or new (2:19)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "UnexpectedReservedUnderscore" + } ], "program": { "type": "Program", @@ -14,6 +26,13 @@ { "type": "TypeAlias", "start":8,"end":28,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":20}}, + "leadingComments": [ + { + "type": "CommentLine", + "value": "@flow", + "start":0,"end":7,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":7}} + } + ], "id": { "type": "Identifier", "start":13,"end":20,"loc":{"start":{"line":2,"column":5},"end":{"line":2,"column":12},"identifierName":"Generic"}, @@ -40,14 +59,7 @@ "start":26,"end":27,"loc":{"start":{"line":2,"column":18},"end":{"line":2,"column":19},"identifierName":"_"}, "name": "_" } - }, - "leadingComments": [ - { - "type": "CommentLine", - "value": "@flow", - "start":0,"end":7,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":7}} - } - ] + } } ], "directives": [] diff --git a/packages/babel-parser/test/fixtures/flow/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 84a61889a5fc..f0035d192479 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 @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "The type cast expression is expected to be wrapped with parenthesis (1:10)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "TypeCastInPattern" + } ], "program": { "type": "Program", 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 c56ca182c299..4142d8b4b332 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 @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "The type cast expression is expected to be wrapped with parenthesis (1:13)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "TypeCastInPattern" + } ], "program": { "type": "Program", 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 5eb20e808dfa..370bb0ac3be6 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 @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "The type cast expression is expected to be wrapped with parenthesis (1:15)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "TypeCastInPattern" + } ], "program": { "type": "Program", 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 60c8b992e95f..ead71ea73eb8 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 @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "The type cast expression is expected to be wrapped with parenthesis (1:5)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "TypeCastInPattern" + } ], "program": { "type": "Program", @@ -16,6 +22,10 @@ "expression": { "type": "SequenceExpression", "start":1,"end":8,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":8}}, + "extra": { + "parenthesized": true, + "parenStart": 0 + }, "expressions": [ { "type": "Identifier", @@ -45,11 +55,7 @@ } } } - ], - "extra": { - "parenthesized": true, - "parenStart": 0 - } + ] } } ], 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 6fef5e583406..b3dafd8ba963 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 @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "The type cast expression is expected to be wrapped with parenthesis (1:2)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "TypeCastInPattern" + } ], "program": { "type": "Program", 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 2dfd651b7a6b..092f2f11a2ac 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 @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "The type cast expression is expected to be wrapped with parenthesis (1:3)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "TypeCastInPattern" + } ], "program": { "type": "Program", @@ -16,6 +22,10 @@ "expression": { "type": "ArrayExpression", "start":1,"end":12,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":12}}, + "extra": { + "parenthesized": true, + "parenStart": 0 + }, "elements": [ { "type": "TypeCastExpression", @@ -34,11 +44,7 @@ } } } - ], - "extra": { - "parenthesized": true, - "parenStart": 0 - } + ] } } ], diff --git a/packages/babel-parser/test/fixtures/flow/typecasts/fails-in-array-expression-3/output.json b/packages/babel-parser/test/fixtures/flow/typecasts/fails-in-array-expression-3/output.json index 98c3f55f974e..1d1a06e65a00 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 @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "The type cast expression is expected to be wrapped with parenthesis (1:7)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "TypeCastInPattern" + } ], "program": { "type": "Program", @@ -16,6 +22,10 @@ "expression": { "type": "ArrayExpression", "start":1,"end":17,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":17}}, + "extra": { + "parenthesized": true, + "parenStart": 0 + }, "elements": [ { "type": "Identifier", @@ -45,11 +55,7 @@ } ] } - ], - "extra": { - "parenthesized": true, - "parenStart": 0 - } + ] } } ], 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 06d2a6430d16..1af96ec82b12 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 @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "The type cast expression is expected to be wrapped with parenthesis (1:9)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "TypeCastInPattern" + } ], "program": { "type": "Program", 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 9633347434f8..0227308317db 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 @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "The type cast expression is expected to be wrapped with parenthesis (1:13)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "TypeCastInPattern" + } ], "program": { "type": "Program", 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 404503d8655f..d0ecc2b32ae5 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 @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "JSX attributes must only be assigned a non-empty expression (1:9)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "AttributeIsEmpty" + } ], "program": { "type": "Program", 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 d70e7d0fc17c..412a9d37b8da 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 @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "Expected corresponding JSX closing tag for <> (1:2)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "MissingClosingTagFragment" + } ], "program": { "type": "Program", 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 54ddb9bae05b..53a7da424b96 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 @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "Expected corresponding JSX closing tag for (1:5)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "MissingClosingTagElement" + } ], "program": { "type": "Program", 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 a5d5ef8d53f4..31e7d19fc80d 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 @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "Expected corresponding JSX closing tag for (1:11)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "MissingClosingTagElement" + } ], "program": { "type": "Program", 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 dc0f88188df6..4abac9095d64 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 @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":8,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":8}}, "errors": [ - "SyntaxError: Unexpected space in placeholder. (1:5)" + { + "$$ babel internal serialized type": "Error", + "message": "Unexpected space in placeholder. (1:5)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "UnexpectedSpace" + } ], "program": { "type": "Program", 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 1855819ef9ca..df62d1571e55 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 @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":8,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":8}}, "errors": [ - "SyntaxError: Unexpected space in placeholder. (1:2)" + { + "$$ babel internal serialized type": "Error", + "message": "Unexpected space in placeholder. (1:2)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "UnexpectedSpace" + } ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/placeholders/variable/let-context-3/output.json b/packages/babel-parser/test/fixtures/placeholders/variable/let-context-3/output.json index d4fef28640ba..195961f5984f 100644 --- a/packages/babel-parser/test/fixtures/placeholders/variable/let-context-3/output.json +++ b/packages/babel-parser/test/fixtures/placeholders/variable/let-context-3/output.json @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":32,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":32}}, "errors": [ - "SyntaxError: Missing semicolon (1:13)" + { + "$$ babel internal serialized type": "Error", + "message": "Missing semicolon (1:13)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "MissingSemicolon" + } ], "program": { "type": "Program", 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 f8e8595b61c9..1d1ee97cf942 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 @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":68,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":68}}, "errors": [ - "SyntaxError: Escape sequence in keyword asserts (1:49)" + { + "$$ babel internal serialized type": "Error", + "message": "Escape sequence in keyword asserts (1:49)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "InvalidEscapedReservedWord" + } ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/typescript/assign/parenthesized-object-assign/output.json b/packages/babel-parser/test/fixtures/typescript/assign/parenthesized-object-assign/output.json index 69e8d31055c7..47c02f478d4c 100644 --- a/packages/babel-parser/test/fixtures/typescript/assign/parenthesized-object-assign/output.json +++ b/packages/babel-parser/test/fixtures/typescript/assign/parenthesized-object-assign/output.json @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":8,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":8}}, "errors": [ - "SyntaxError: Invalid parenthesized assignment pattern (1:0)" + { + "$$ babel internal serialized type": "Error", + "message": "Invalid parenthesized assignment pattern (1:0)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "InvalidParenthesizedAssignment" + } ], "program": { "type": "Program", 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 e2c60e35e2ad..dd0139c1de55 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 @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "Unexpected type cast in parameter position. (1:7)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "UnexpectedTypeCastInParameter" + } ], "program": { "type": "Program", 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 399b0fb6572f..89c36c09d825 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 @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "Unexpected type cast in parameter position. (1:7)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "UnexpectedTypeCastInParameter" + } ], "program": { "type": "Program", 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 10d0beeb57d2..535974784e47 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 @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "Unexpected type cast in parameter position. (1:1)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "UnexpectedTypeCastInParameter" + } ], "program": { "type": "Program", 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 81af16cb094e..b5ad0f11f42d 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 @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "Unexpected type cast in parameter position. (1:1)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "UnexpectedTypeCastInParameter" + } ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/typescript/cast/invalid/output.json b/packages/babel-parser/test/fixtures/typescript/cast/invalid/output.json index 331f76ac5365..d933bbe17220 100644 --- a/packages/babel-parser/test/fixtures/typescript/cast/invalid/output.json +++ b/packages/babel-parser/test/fixtures/typescript/cast/invalid/output.json @@ -2,12 +2,48 @@ "type": "File", "start":0,"end":36,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":11}}, "errors": [ - "SyntaxError: Did not expect a type annotation here. (1:2)", - "SyntaxError: Did not expect a type annotation here. (2:2)", - "SyntaxError: Did not expect a type annotation here. (2:6)", - "SyntaxError: Did not expect a type annotation here. (3:2)", - "SyntaxError: Did not expect a type annotation here. (4:2)", - "SyntaxError: Did not expect a type annotation here. (4:7)" + { + "$$ babel internal serialized type": "Error", + "message": "Did not expect a type annotation here. (1:2)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "UnexpectedTypeAnnotation" + }, + { + "$$ babel internal serialized type": "Error", + "message": "Did not expect a type annotation here. (2:2)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "UnexpectedTypeAnnotation" + }, + { + "$$ babel internal serialized type": "Error", + "message": "Did not expect a type annotation here. (2:6)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "UnexpectedTypeAnnotation" + }, + { + "$$ babel internal serialized type": "Error", + "message": "Did not expect a type annotation here. (3:2)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "UnexpectedTypeAnnotation" + }, + { + "$$ babel internal serialized type": "Error", + "message": "Did not expect a type annotation here. (4:2)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "UnexpectedTypeAnnotation" + }, + { + "$$ babel internal serialized type": "Error", + "message": "Did not expect a type annotation here. (4:7)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "UnexpectedTypeAnnotation" + } ], "program": { "type": "Program", 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 397ff94c3c7d..98a835aff64f 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 @@ -2,8 +2,20 @@ "type": "File", "start":0,"end":26,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":14}}, "errors": [ - "SyntaxError: Did not expect a type annotation here. (1:6)", - "SyntaxError: Did not expect a type annotation here. (2:9)" + { + "$$ babel internal serialized type": "Error", + "message": "Did not expect a type annotation here. (1:6)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "UnexpectedTypeAnnotation" + }, + { + "$$ babel internal serialized type": "Error", + "message": "Did not expect a type annotation here. (2:9)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "UnexpectedTypeAnnotation" + } ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/typescript/class/abstract-method-in-non-abstract-class-1/output.json b/packages/babel-parser/test/fixtures/typescript/class/abstract-method-in-non-abstract-class-1/output.json index b1f22a4e62f1..85da7bccf8ce 100644 --- a/packages/babel-parser/test/fixtures/typescript/class/abstract-method-in-non-abstract-class-1/output.json +++ b/packages/babel-parser/test/fixtures/typescript/class/abstract-method-in-non-abstract-class-1/output.json @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":34,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "errors": [ - "SyntaxError: Abstract methods can only appear within an abstract class. (2:2)" + { + "$$ babel internal serialized type": "Error", + "message": "Abstract methods can only appear within an abstract class. (2:2)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "NonAbstractClassHasAbstractMethod" + } ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/typescript/class/abstract-method-in-non-abstract-class-2/output.json b/packages/babel-parser/test/fixtures/typescript/class/abstract-method-in-non-abstract-class-2/output.json index e304b1af3eef..da5d04141294 100644 --- a/packages/babel-parser/test/fixtures/typescript/class/abstract-method-in-non-abstract-class-2/output.json +++ b/packages/babel-parser/test/fixtures/typescript/class/abstract-method-in-non-abstract-class-2/output.json @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":84,"loc":{"start":{"line":1,"column":0},"end":{"line":7,"column":1}}, "errors": [ - "SyntaxError: Abstract methods can only appear within an abstract class. (4:6)" + { + "$$ babel internal serialized type": "Error", + "message": "Abstract methods can only appear within an abstract class. (4:6)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "NonAbstractClassHasAbstractMethod" + } ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/typescript/class/abstract-method-in-non-abstract-class-3/output.json b/packages/babel-parser/test/fixtures/typescript/class/abstract-method-in-non-abstract-class-3/output.json index ff36ce77b1c7..2a6ef9bebcea 100644 --- a/packages/babel-parser/test/fixtures/typescript/class/abstract-method-in-non-abstract-class-3/output.json +++ b/packages/babel-parser/test/fixtures/typescript/class/abstract-method-in-non-abstract-class-3/output.json @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":52,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":52}}, "errors": [ - "SyntaxError: Abstract methods can only appear within an abstract class. (1:31)" + { + "$$ babel internal serialized type": "Error", + "message": "Abstract methods can only appear within an abstract class. (1:31)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "NonAbstractClassHasAbstractMethod" + } ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/typescript/class/abstract-method-with-body-computed/output.json b/packages/babel-parser/test/fixtures/typescript/class/abstract-method-with-body-computed/output.json index 35955f48a99a..a3aaf1459de8 100644 --- a/packages/babel-parser/test/fixtures/typescript/class/abstract-method-with-body-computed/output.json +++ b/packages/babel-parser/test/fixtures/typescript/class/abstract-method-with-body-computed/output.json @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":46,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "errors": [ - "SyntaxError: Method '[foo()]' cannot have an implementation because it is marked abstract. (2:2)" + { + "$$ babel internal serialized type": "Error", + "message": "Method '[foo()]' cannot have an implementation because it is marked abstract. (2:2)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "AbstractMethodHasImplementation" + } ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/typescript/class/abstract-method-with-body/output.json b/packages/babel-parser/test/fixtures/typescript/class/abstract-method-with-body/output.json index 27e781a2b908..b17ec354d09c 100644 --- a/packages/babel-parser/test/fixtures/typescript/class/abstract-method-with-body/output.json +++ b/packages/babel-parser/test/fixtures/typescript/class/abstract-method-with-body/output.json @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":45,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "errors": [ - "SyntaxError: Method 'method' cannot have an implementation because it is marked abstract. (2:2)" + { + "$$ babel internal serialized type": "Error", + "message": "Method 'method' cannot have an implementation because it is marked abstract. (2:2)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "AbstractMethodHasImplementation" + } ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/typescript/class/constructor-with-type-parameters/output.json b/packages/babel-parser/test/fixtures/typescript/class/constructor-with-type-parameters/output.json index 38964cd9c251..ec67dd921daf 100644 --- a/packages/babel-parser/test/fixtures/typescript/class/constructor-with-type-parameters/output.json +++ b/packages/babel-parser/test/fixtures/typescript/class/constructor-with-type-parameters/output.json @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":39,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "errors": [ - "SyntaxError: Type parameters cannot appear on a constructor declaration. (2:13)" + { + "$$ babel internal serialized type": "Error", + "message": "Type parameters cannot appear on a constructor declaration. (2:13)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "ConstructorHasTypeParameters" + } ], "program": { "type": "Program", 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 c7c1398ea0f3..abe3ee7a1fee 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 @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":43,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "errors": [ - "SyntaxError: Initializers are not allowed in ambient contexts. (2:22)" + { + "$$ babel internal serialized type": "Error", + "message": "Initializers are not allowed in ambient contexts. (2:22)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "DeclareClassFieldHasInitializer" + } ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/typescript/class/declare-initializer/output.json b/packages/babel-parser/test/fixtures/typescript/class/declare-initializer/output.json index 1c94185430d2..7871085ad717 100644 --- a/packages/babel-parser/test/fixtures/typescript/class/declare-initializer/output.json +++ b/packages/babel-parser/test/fixtures/typescript/class/declare-initializer/output.json @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":38,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "errors": [ - "SyntaxError: Initializers are not allowed in ambient contexts. (2:8)" + { + "$$ babel internal serialized type": "Error", + "message": "Initializers are not allowed in ambient contexts. (2:8)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "DeclareClassFieldHasInitializer" + } ], "program": { "type": "Program", 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 ffa963c815c3..1eab63e13bf6 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 @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "Class methods cannot have the 'declare' modifier (2:2)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "ClassMethodHasDeclare" + } ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/typescript/class/declare-new-line-abstract/output.json b/packages/babel-parser/test/fixtures/typescript/class/declare-new-line-abstract/output.json index 04a02c759f73..760adf37d75e 100644 --- a/packages/babel-parser/test/fixtures/typescript/class/declare-new-line-abstract/output.json +++ b/packages/babel-parser/test/fixtures/typescript/class/declare-new-line-abstract/output.json @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":27,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":10}}, "errors": [ - "SyntaxError: Missing semicolon (1:7)" + { + "$$ babel internal serialized type": "Error", + "message": "Missing semicolon (1:7)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "MissingSemicolon" + } ], "program": { "type": "Program", 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 945b98a43008..b4a15fe6b17f 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 @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":41,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "errors": [ - "SyntaxError: Duplicate modifier: 'declare' (2:17)" + { + "$$ babel internal serialized type": "Error", + "message": "Duplicate modifier: 'declare' (2:17)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "DuplicateModifier" + } ], "program": { "type": "Program", 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 d902e7d6b78f..d0c8b159c7b7 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 @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":48,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "errors": [ - "SyntaxError: Duplicate modifier: 'declare' (2:24)" + { + "$$ babel internal serialized type": "Error", + "message": "Duplicate modifier: 'declare' (2:24)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "DuplicateModifier" + } ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/typescript/class/duplicates-accessibility/output.json b/packages/babel-parser/test/fixtures/typescript/class/duplicates-accessibility/output.json index 8f1fde109674..e22675fb958d 100644 --- a/packages/babel-parser/test/fixtures/typescript/class/duplicates-accessibility/output.json +++ b/packages/babel-parser/test/fixtures/typescript/class/duplicates-accessibility/output.json @@ -2,12 +2,48 @@ "type": "File", "start":0,"end":127,"loc":{"start":{"line":1,"column":0},"end":{"line":7,"column":1}}, "errors": [ - "SyntaxError: Accessibility modifier already seen. (2:9)", - "SyntaxError: Accessibility modifier already seen. (3:10)", - "SyntaxError: Accessibility modifier already seen. (4:12)", - "SyntaxError: Accessibility modifier already seen. (5:9)", - "SyntaxError: Accessibility modifier already seen. (6:9)", - "SyntaxError: Accessibility modifier already seen. (6:19)" + { + "$$ babel internal serialized type": "Error", + "message": "Accessibility modifier already seen. (2:9)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "DuplicateAccessibilityModifier" + }, + { + "$$ babel internal serialized type": "Error", + "message": "Accessibility modifier already seen. (3:10)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "DuplicateAccessibilityModifier" + }, + { + "$$ babel internal serialized type": "Error", + "message": "Accessibility modifier already seen. (4:12)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "DuplicateAccessibilityModifier" + }, + { + "$$ babel internal serialized type": "Error", + "message": "Accessibility modifier already seen. (5:9)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "DuplicateAccessibilityModifier" + }, + { + "$$ babel internal serialized type": "Error", + "message": "Accessibility modifier already seen. (6:9)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "DuplicateAccessibilityModifier" + }, + { + "$$ babel internal serialized type": "Error", + "message": "Accessibility modifier already seen. (6:19)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "DuplicateAccessibilityModifier" + } ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/typescript/class/empty-type-parameters/output.json b/packages/babel-parser/test/fixtures/typescript/class/empty-type-parameters/output.json index 390592c558de..ca495236d96b 100644 --- a/packages/babel-parser/test/fixtures/typescript/class/empty-type-parameters/output.json +++ b/packages/babel-parser/test/fixtures/typescript/class/empty-type-parameters/output.json @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":12,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":12}}, "errors": [ - "SyntaxError: Type parameter list cannot be empty. (1:7)" + { + "$$ babel internal serialized type": "Error", + "message": "Type parameter list cannot be empty. (1:7)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "EmptyTypeParameters" + } ], "program": { "type": "Program", 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 c27b6af00f12..951c2060768e 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 @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":25,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":1}}, "errors": [ - "SyntaxError: 'extends' list cannot be empty. (1:22)" + { + "$$ babel internal serialized type": "Error", + "message": "'extends' list cannot be empty. (1:22)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "EmptyHeritageClauseType" + } ], "program": { "type": "Program", 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 ba6f83ebb007..468bee48994d 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 @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":36,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":1}}, "errors": [ - "SyntaxError: 'implements' list cannot be empty. (1:33)" + { + "$$ babel internal serialized type": "Error", + "message": "'implements' list cannot be empty. (1:33)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "EmptyHeritageClauseType" + } ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/typescript/class/generator-method-with-modifiers/output.json b/packages/babel-parser/test/fixtures/typescript/class/generator-method-with-modifiers/output.json index cb1e08d842ba..36e274b23de7 100644 --- a/packages/babel-parser/test/fixtures/typescript/class/generator-method-with-modifiers/output.json +++ b/packages/babel-parser/test/fixtures/typescript/class/generator-method-with-modifiers/output.json @@ -2,8 +2,20 @@ "type": "File", "start":0,"end":139,"loc":{"start":{"line":1,"column":0},"end":{"line":9,"column":1}}, "errors": [ - "SyntaxError: Abstract methods can only appear within an abstract class. (5:2)", - "SyntaxError: Method 'd' cannot have an implementation because it is marked abstract. (5:2)" + { + "$$ babel internal serialized type": "Error", + "message": "Abstract methods can only appear within an abstract class. (5:2)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "NonAbstractClassHasAbstractMethod" + }, + { + "$$ babel internal serialized type": "Error", + "message": "Method 'd' cannot have an implementation because it is marked abstract. (5:2)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "AbstractMethodHasImplementation" + } ], "program": { "type": "Program", 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 19e0d7bc5a9e..49b359497ed2 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 @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":24,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":1}}, "errors": [ - "SyntaxError: 'implements' list cannot be empty. (1:21)" + { + "$$ babel internal serialized type": "Error", + "message": "'implements' list cannot be empty. (1:21)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "EmptyHeritageClauseType" + } ], "program": { "type": "Program", 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 85529184ac19..86902a6a3d6e 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 @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "Class methods cannot have the 'readonly' modifier (2:4)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "ClassMethodHasReadonly" + } ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/typescript/class/modifiers-index-signatures/output.json b/packages/babel-parser/test/fixtures/typescript/class/modifiers-index-signatures/output.json index 2001c8258f84..3050478abe3a 100644 --- a/packages/babel-parser/test/fixtures/typescript/class/modifiers-index-signatures/output.json +++ b/packages/babel-parser/test/fixtures/typescript/class/modifiers-index-signatures/output.json @@ -2,12 +2,48 @@ "type": "File", "start":0,"end":210,"loc":{"start":{"line":1,"column":0},"end":{"line":8,"column":1}}, "errors": [ - "SyntaxError: Index signatures cannot have the 'abstract' modifier (2:2)", - "SyntaxError: Index signatures cannot have the 'static' modifier (3:2)", - "SyntaxError: Index signatures cannot have the 'declare' modifier (4:2)", - "SyntaxError: Index signatures cannot have an accessibility modifier ('private') (5:2)", - "SyntaxError: Index signatures cannot have an accessibility modifier ('public') (6:2)", - "SyntaxError: Index signatures cannot have an accessibility modifier ('protected') (7:2)" + { + "$$ babel internal serialized type": "Error", + "message": "Index signatures cannot have the 'abstract' modifier (2:2)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "IndexSignatureHasAbstract" + }, + { + "$$ babel internal serialized type": "Error", + "message": "Index signatures cannot have the 'static' modifier (3:2)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "IndexSignatureHasStatic" + }, + { + "$$ babel internal serialized type": "Error", + "message": "Index signatures cannot have the 'declare' modifier (4:2)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "IndexSignatureHasDeclare" + }, + { + "$$ babel internal serialized type": "Error", + "message": "Index signatures cannot have an accessibility modifier ('private') (5:2)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "IndexSignatureHasAccessibility" + }, + { + "$$ babel internal serialized type": "Error", + "message": "Index signatures cannot have an accessibility modifier ('public') (6:2)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "IndexSignatureHasAccessibility" + }, + { + "$$ babel internal serialized type": "Error", + "message": "Index signatures cannot have an accessibility modifier ('protected') (7:2)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "IndexSignatureHasAccessibility" + } ], "program": { "type": "Program", 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 08e9c163117a..d4beb2419305 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 @@ -2,8 +2,20 @@ "type": "File", "start":0,"end":83,"loc":{"start":{"line":1,"column":0},"end":{"line":6,"column":1}}, "errors": [ - "SyntaxError: A parameter property may not be declared using a binding pattern. (2:16)", - "SyntaxError: A parameter property may not be declared using a binding pattern. (5:16)" + { + "$$ babel internal serialized type": "Error", + "message": "A parameter property may not be declared using a binding pattern. (2:16)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "UnsupportedParameterPropertyKind" + }, + { + "$$ babel internal serialized type": "Error", + "message": "A parameter property may not be declared using a binding pattern. (5:16)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "UnsupportedParameterPropertyKind" + } ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/typescript/class/parameter-properties-not-constructor/output.json b/packages/babel-parser/test/fixtures/typescript/class/parameter-properties-not-constructor/output.json index 58e506aa9ece..92a05c632d4b 100644 --- a/packages/babel-parser/test/fixtures/typescript/class/parameter-properties-not-constructor/output.json +++ b/packages/babel-parser/test/fixtures/typescript/class/parameter-properties-not-constructor/output.json @@ -2,13 +2,55 @@ "type": "File", "start":0,"end":261,"loc":{"start":{"line":1,"column":0},"end":{"line":11,"column":1}}, "errors": [ - "SyntaxError: A parameter property is only allowed in a constructor implementation. (3:8)", - "SyntaxError: A parameter property is only allowed in a constructor implementation. (4:8)", - "SyntaxError: A parameter property is only allowed in a constructor implementation. (5:8)", - "SyntaxError: A parameter property is only allowed in a constructor implementation. (6:8)", - "SyntaxError: A parameter property is only allowed in a constructor implementation. (7:8)", - "SyntaxError: A parameter property is only allowed in a constructor implementation. (9:8)", - "SyntaxError: A parameter property is only allowed in a constructor implementation. (10:8)" + { + "$$ babel internal serialized type": "Error", + "message": "A parameter property is only allowed in a constructor implementation. (3:8)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "UnexpectedParameterModifier" + }, + { + "$$ babel internal serialized type": "Error", + "message": "A parameter property is only allowed in a constructor implementation. (4:8)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "UnexpectedParameterModifier" + }, + { + "$$ babel internal serialized type": "Error", + "message": "A parameter property is only allowed in a constructor implementation. (5:8)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "UnexpectedParameterModifier" + }, + { + "$$ babel internal serialized type": "Error", + "message": "A parameter property is only allowed in a constructor implementation. (6:8)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "UnexpectedParameterModifier" + }, + { + "$$ babel internal serialized type": "Error", + "message": "A parameter property is only allowed in a constructor implementation. (7:8)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "UnexpectedParameterModifier" + }, + { + "$$ babel internal serialized type": "Error", + "message": "A parameter property is only allowed in a constructor implementation. (9:8)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "UnexpectedParameterModifier" + }, + { + "$$ babel internal serialized type": "Error", + "message": "A parameter property is only allowed in a constructor implementation. (10:8)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "UnexpectedParameterModifier" + } ], "program": { "type": "Program", @@ -116,6 +158,13 @@ { "type": "TSParameterProperty", "start":210,"end":224,"loc":{"start":{"line":9,"column":8},"end":{"line":9,"column":22}}, + "leadingComments": [ + { + "type": "CommentLine", + "value": " Also works on AssignmentPattern", + "start":167,"end":201,"loc":{"start":{"line":8,"column":8},"end":{"line":8,"column":42}} + } + ], "readonly": true, "parameter": { "type": "AssignmentPattern", @@ -134,14 +183,7 @@ }, "value": 0 } - }, - "leadingComments": [ - { - "type": "CommentLine", - "value": " Also works on AssignmentPattern", - "start":167,"end":201,"loc":{"start":{"line":8,"column":8},"end":{"line":8,"column":42}} - } - ] + } }, { "type": "TSParameterProperty", 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 59f5d53634e7..38bf5d7ade2c 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 @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "Private elements cannot have the 'abstract' modifier. (2:2)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "PrivateElementHasAbstract" + } ], "program": { "type": "Program", 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 5e3dd363ef99..a1dbb1aa278f 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 @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "Private elements cannot have an accessibility modifier ('private') (2:2)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "PrivateElementHasAccessibility" + } ], "program": { "type": "Program", 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 8a49738f30e3..88423cf62f9c 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 @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "Private elements cannot have an accessibility modifier ('protected') (2:2)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "PrivateElementHasAccessibility" + } ], "program": { "type": "Program", 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 0bf961bf5037..65e521465c1a 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 @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "Private elements cannot have an accessibility modifier ('public') (2:2)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "PrivateElementHasAccessibility" + } ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/typescript/declare/function/output.json b/packages/babel-parser/test/fixtures/typescript/declare/function/output.json index 490c73486849..cf63e377f507 100644 --- a/packages/babel-parser/test/fixtures/typescript/declare/function/output.json +++ b/packages/babel-parser/test/fixtures/typescript/declare/function/output.json @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":25,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":25}}, "errors": [ - "SyntaxError: An implementation cannot be declared in ambient contexts. (1:0)" + { + "$$ babel internal serialized type": "Error", + "message": "An implementation cannot be declared in ambient contexts. (1:0)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "DeclareFunctionHasImplementation" + } ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/typescript/declare/module-class/output.json b/packages/babel-parser/test/fixtures/typescript/declare/module-class/output.json index baf67a410c24..b94d611c8fcc 100644 --- a/packages/babel-parser/test/fixtures/typescript/declare/module-class/output.json +++ b/packages/babel-parser/test/fixtures/typescript/declare/module-class/output.json @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":57,"loc":{"start":{"line":1,"column":0},"end":{"line":5,"column":1}}, "errors": [ - "SyntaxError: Initializers are not allowed in ambient contexts. (3:10)" + { + "$$ babel internal serialized type": "Error", + "message": "Initializers are not allowed in ambient contexts. (3:10)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "DeclareClassFieldHasInitializer" + } ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/typescript/declare/module-function/output.json b/packages/babel-parser/test/fixtures/typescript/declare/module-function/output.json index ce844216f0ed..38d21b206374 100644 --- a/packages/babel-parser/test/fixtures/typescript/declare/module-function/output.json +++ b/packages/babel-parser/test/fixtures/typescript/declare/module-function/output.json @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":40,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "errors": [ - "SyntaxError: An implementation cannot be declared in ambient contexts. (2:2)" + { + "$$ babel internal serialized type": "Error", + "message": "An implementation cannot be declared in ambient contexts. (2:2)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "DeclareFunctionHasImplementation" + } ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/typescript/declare/namespace-class/output.json b/packages/babel-parser/test/fixtures/typescript/declare/namespace-class/output.json index 503a33e792dd..02d6af2d1bea 100644 --- a/packages/babel-parser/test/fixtures/typescript/declare/namespace-class/output.json +++ b/packages/babel-parser/test/fixtures/typescript/declare/namespace-class/output.json @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":60,"loc":{"start":{"line":1,"column":0},"end":{"line":5,"column":1}}, "errors": [ - "SyntaxError: Initializers are not allowed in ambient contexts. (3:10)" + { + "$$ babel internal serialized type": "Error", + "message": "Initializers are not allowed in ambient contexts. (3:10)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "DeclareClassFieldHasInitializer" + } ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/typescript/declare/namespace-function/output.json b/packages/babel-parser/test/fixtures/typescript/declare/namespace-function/output.json index 251434a13486..7542f5817421 100644 --- a/packages/babel-parser/test/fixtures/typescript/declare/namespace-function/output.json +++ b/packages/babel-parser/test/fixtures/typescript/declare/namespace-function/output.json @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":43,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "errors": [ - "SyntaxError: An implementation cannot be declared in ambient contexts. (2:2)" + { + "$$ babel internal serialized type": "Error", + "message": "An implementation cannot be declared in ambient contexts. (2:2)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "DeclareFunctionHasImplementation" + } ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/typescript/function/empty-type-parameters/output.json b/packages/babel-parser/test/fixtures/typescript/function/empty-type-parameters/output.json index 9a537950d4b7..a23cfdc84f5a 100644 --- a/packages/babel-parser/test/fixtures/typescript/function/empty-type-parameters/output.json +++ b/packages/babel-parser/test/fixtures/typescript/function/empty-type-parameters/output.json @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":19,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":19}}, "errors": [ - "SyntaxError: Type parameter list cannot be empty. (1:12)" + { + "$$ babel internal serialized type": "Error", + "message": "Type parameter list cannot be empty. (1:12)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "EmptyTypeParameters" + } ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/typescript/function/parameter-properties/output.json b/packages/babel-parser/test/fixtures/typescript/function/parameter-properties/output.json index f3a3c8a823c6..b3ff8f87b359 100644 --- a/packages/babel-parser/test/fixtures/typescript/function/parameter-properties/output.json +++ b/packages/babel-parser/test/fixtures/typescript/function/parameter-properties/output.json @@ -2,13 +2,55 @@ "type": "File", "start":0,"end":158,"loc":{"start":{"line":1,"column":0},"end":{"line":9,"column":4}}, "errors": [ - "SyntaxError: A parameter property is only allowed in a constructor implementation. (2:2)", - "SyntaxError: A parameter property is only allowed in a constructor implementation. (3:2)", - "SyntaxError: A parameter property is only allowed in a constructor implementation. (4:2)", - "SyntaxError: A parameter property is only allowed in a constructor implementation. (5:2)", - "SyntaxError: A parameter property is only allowed in a constructor implementation. (6:2)", - "SyntaxError: A parameter property is only allowed in a constructor implementation. (7:2)", - "SyntaxError: A parameter property is only allowed in a constructor implementation. (8:2)" + { + "$$ babel internal serialized type": "Error", + "message": "A parameter property is only allowed in a constructor implementation. (2:2)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "UnexpectedParameterModifier" + }, + { + "$$ babel internal serialized type": "Error", + "message": "A parameter property is only allowed in a constructor implementation. (3:2)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "UnexpectedParameterModifier" + }, + { + "$$ babel internal serialized type": "Error", + "message": "A parameter property is only allowed in a constructor implementation. (4:2)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "UnexpectedParameterModifier" + }, + { + "$$ babel internal serialized type": "Error", + "message": "A parameter property is only allowed in a constructor implementation. (5:2)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "UnexpectedParameterModifier" + }, + { + "$$ babel internal serialized type": "Error", + "message": "A parameter property is only allowed in a constructor implementation. (6:2)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "UnexpectedParameterModifier" + }, + { + "$$ babel internal serialized type": "Error", + "message": "A parameter property is only allowed in a constructor implementation. (7:2)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "UnexpectedParameterModifier" + }, + { + "$$ babel internal serialized type": "Error", + "message": "A parameter property is only allowed in a constructor implementation. (8:2)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "UnexpectedParameterModifier" + } ], "program": { "type": "Program", 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 8472638da812..672a8b26c811 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 @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "A binding pattern parameter cannot be optional in an implementation signature. (1:11)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "PatternIsOptional" + } ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/typescript/import/export-import-type/output.json b/packages/babel-parser/test/fixtures/typescript/import/export-import-type/output.json index e2dc9b3429bb..77003a45763e 100644 --- a/packages/babel-parser/test/fixtures/typescript/import/export-import-type/output.json +++ b/packages/babel-parser/test/fixtures/typescript/import/export-import-type/output.json @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":27,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":27}}, "errors": [ - "SyntaxError: An import alias can not use 'import type' (1:23)" + { + "$$ babel internal serialized type": "Error", + "message": "An import alias can not use 'import type' (1:23)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "ImportAliasHasImportType" + } ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/typescript/import/type-equals/output.json b/packages/babel-parser/test/fixtures/typescript/import/type-equals/output.json index aa41cc16a54e..405ec483d6b1 100644 --- a/packages/babel-parser/test/fixtures/typescript/import/type-equals/output.json +++ b/packages/babel-parser/test/fixtures/typescript/import/type-equals/output.json @@ -2,8 +2,20 @@ "type": "File", "start":0,"end":39,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":18}}, "errors": [ - "SyntaxError: An import alias can not use 'import type' (1:16)", - "SyntaxError: An import alias can not use 'import type' (2:16)" + { + "$$ babel internal serialized type": "Error", + "message": "An import alias can not use 'import type' (1:16)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "ImportAliasHasImportType" + }, + { + "$$ babel internal serialized type": "Error", + "message": "An import alias can not use 'import type' (2:16)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "ImportAliasHasImportType" + } ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/typescript/interface/abstract/output.json b/packages/babel-parser/test/fixtures/typescript/interface/abstract/output.json index dd5eecede71b..ca0271cd15d0 100644 --- a/packages/babel-parser/test/fixtures/typescript/interface/abstract/output.json +++ b/packages/babel-parser/test/fixtures/typescript/interface/abstract/output.json @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":41,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "errors": [ - "SyntaxError: 'abstract' modifier can only appear on a class, method, or property declaration. (1:0)" + { + "$$ babel internal serialized type": "Error", + "message": "'abstract' modifier can only appear on a class, method, or property declaration. (1:0)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "NonClassMethodPropertyHasAbstractModifer" + } ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/typescript/interface/declare-new-line/output.json b/packages/babel-parser/test/fixtures/typescript/interface/declare-new-line/output.json index 5158d520298c..bba5c25c6b9b 100644 --- a/packages/babel-parser/test/fixtures/typescript/interface/declare-new-line/output.json +++ b/packages/babel-parser/test/fixtures/typescript/interface/declare-new-line/output.json @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":22,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":2}}, "errors": [ - "SyntaxError: Missing semicolon (1:7)" + { + "$$ babel internal serialized type": "Error", + "message": "Missing semicolon (1:7)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "MissingSemicolon" + } ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/typescript/interface/export-abstract-interface/output.json b/packages/babel-parser/test/fixtures/typescript/interface/export-abstract-interface/output.json index d1172b3d8d5e..61ee30e354a2 100644 --- a/packages/babel-parser/test/fixtures/typescript/interface/export-abstract-interface/output.json +++ b/packages/babel-parser/test/fixtures/typescript/interface/export-abstract-interface/output.json @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":32,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "errors": [ - "SyntaxError: 'abstract' modifier can only appear on a class, method, or property declaration. (1:7)" + { + "$$ babel internal serialized type": "Error", + "message": "'abstract' modifier can only appear on a class, method, or property declaration. (1:7)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "NonClassMethodPropertyHasAbstractModifer" + } ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/typescript/interface/invalid-abstract-interface/output.json b/packages/babel-parser/test/fixtures/typescript/interface/invalid-abstract-interface/output.json index 9e1d3aec785f..a3d4d8c88d19 100644 --- a/packages/babel-parser/test/fixtures/typescript/interface/invalid-abstract-interface/output.json +++ b/packages/babel-parser/test/fixtures/typescript/interface/invalid-abstract-interface/output.json @@ -2,8 +2,20 @@ "type": "File", "start":0,"end":25,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":6}}, "errors": [ - "SyntaxError: Missing semicolon (1:8)", - "SyntaxError: Missing semicolon (2:3)" + { + "$$ babel internal serialized type": "Error", + "message": "Missing semicolon (1:8)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "MissingSemicolon" + }, + { + "$$ babel internal serialized type": "Error", + "message": "Missing semicolon (2:3)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "MissingSemicolon" + } ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/typescript/interface/invalid-modifiers-method/output.json b/packages/babel-parser/test/fixtures/typescript/interface/invalid-modifiers-method/output.json index 080f46b132ef..9d5f229490ca 100644 --- a/packages/babel-parser/test/fixtures/typescript/interface/invalid-modifiers-method/output.json +++ b/packages/babel-parser/test/fixtures/typescript/interface/invalid-modifiers-method/output.json @@ -2,13 +2,55 @@ "type": "File", "start":0,"end":124,"loc":{"start":{"line":1,"column":0},"end":{"line":9,"column":1}}, "errors": [ - "SyntaxError: 'private' modifier cannot appear on a type member. (2:2)", - "SyntaxError: 'public' modifier cannot appear on a type member. (3:2)", - "SyntaxError: 'protected' modifier cannot appear on a type member. (4:2)", - "SyntaxError: 'static' modifier cannot appear on a type member. (5:2)", - "SyntaxError: 'declare' modifier cannot appear on a type member. (6:2)", - "SyntaxError: 'abstract' modifier cannot appear on a type member. (7:2)", - "SyntaxError: 'readonly' modifier can only appear on a property declaration or index signature. (8:2)" + { + "$$ babel internal serialized type": "Error", + "message": "'private' modifier cannot appear on a type member. (2:2)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "InvalidModifierOnTypeMember" + }, + { + "$$ babel internal serialized type": "Error", + "message": "'public' modifier cannot appear on a type member. (3:2)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "InvalidModifierOnTypeMember" + }, + { + "$$ babel internal serialized type": "Error", + "message": "'protected' modifier cannot appear on a type member. (4:2)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "InvalidModifierOnTypeMember" + }, + { + "$$ babel internal serialized type": "Error", + "message": "'static' modifier cannot appear on a type member. (5:2)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "InvalidModifierOnTypeMember" + }, + { + "$$ babel internal serialized type": "Error", + "message": "'declare' modifier cannot appear on a type member. (6:2)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "InvalidModifierOnTypeMember" + }, + { + "$$ babel internal serialized type": "Error", + "message": "'abstract' modifier cannot appear on a type member. (7:2)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "InvalidModifierOnTypeMember" + }, + { + "$$ babel internal serialized type": "Error", + "message": "'readonly' modifier can only appear on a property declaration or index signature. (8:2)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "ReadonlyForMethodSignature" + } ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/typescript/interface/invalid-modifiers-property/output.json b/packages/babel-parser/test/fixtures/typescript/interface/invalid-modifiers-property/output.json index be58676dc3a4..809449a608d5 100644 --- a/packages/babel-parser/test/fixtures/typescript/interface/invalid-modifiers-property/output.json +++ b/packages/babel-parser/test/fixtures/typescript/interface/invalid-modifiers-property/output.json @@ -2,12 +2,48 @@ "type": "File", "start":0,"end":96,"loc":{"start":{"line":1,"column":0},"end":{"line":8,"column":1}}, "errors": [ - "SyntaxError: 'private' modifier cannot appear on a type member. (2:2)", - "SyntaxError: 'public' modifier cannot appear on a type member. (3:2)", - "SyntaxError: 'protected' modifier cannot appear on a type member. (4:2)", - "SyntaxError: 'static' modifier cannot appear on a type member. (5:2)", - "SyntaxError: 'declare' modifier cannot appear on a type member. (6:2)", - "SyntaxError: 'abstract' modifier cannot appear on a type member. (7:2)" + { + "$$ babel internal serialized type": "Error", + "message": "'private' modifier cannot appear on a type member. (2:2)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "InvalidModifierOnTypeMember" + }, + { + "$$ babel internal serialized type": "Error", + "message": "'public' modifier cannot appear on a type member. (3:2)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "InvalidModifierOnTypeMember" + }, + { + "$$ babel internal serialized type": "Error", + "message": "'protected' modifier cannot appear on a type member. (4:2)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "InvalidModifierOnTypeMember" + }, + { + "$$ babel internal serialized type": "Error", + "message": "'static' modifier cannot appear on a type member. (5:2)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "InvalidModifierOnTypeMember" + }, + { + "$$ babel internal serialized type": "Error", + "message": "'declare' modifier cannot appear on a type member. (6:2)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "InvalidModifierOnTypeMember" + }, + { + "$$ babel internal serialized type": "Error", + "message": "'abstract' modifier cannot appear on a type member. (7:2)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "InvalidModifierOnTypeMember" + } ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/typescript/interface/new-line-error/output.json b/packages/babel-parser/test/fixtures/typescript/interface/new-line-error/output.json index f379134be8af..50901105cc68 100644 --- a/packages/babel-parser/test/fixtures/typescript/interface/new-line-error/output.json +++ b/packages/babel-parser/test/fixtures/typescript/interface/new-line-error/output.json @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":14,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":4}}, "errors": [ - "SyntaxError: Missing semicolon (2:1)" + { + "$$ babel internal serialized type": "Error", + "message": "Missing semicolon (2:1)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "MissingSemicolon" + } ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/typescript/module-namespace/module-declare-new-line/output.json b/packages/babel-parser/test/fixtures/typescript/module-namespace/module-declare-new-line/output.json index 1ba41584fb21..e1215c0c27e5 100644 --- a/packages/babel-parser/test/fixtures/typescript/module-namespace/module-declare-new-line/output.json +++ b/packages/babel-parser/test/fixtures/typescript/module-namespace/module-declare-new-line/output.json @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":48,"loc":{"start":{"line":1,"column":0},"end":{"line":8,"column":2}}, "errors": [ - "SyntaxError: Missing semicolon (6:7)" + { + "$$ babel internal serialized type": "Error", + "message": "Missing semicolon (6:7)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "MissingSemicolon" + } ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/typescript/module-namespace/module-new-line-error/output.json b/packages/babel-parser/test/fixtures/typescript/module-namespace/module-new-line-error/output.json index 5c7e547bf607..1debf552477e 100644 --- a/packages/babel-parser/test/fixtures/typescript/module-namespace/module-new-line-error/output.json +++ b/packages/babel-parser/test/fixtures/typescript/module-namespace/module-new-line-error/output.json @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":13,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":6}}, "errors": [ - "SyntaxError: Missing semicolon (2:3)" + { + "$$ babel internal serialized type": "Error", + "message": "Missing semicolon (2:3)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "MissingSemicolon" + } ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/typescript/module-namespace/namespace-declare-new-line/output.json b/packages/babel-parser/test/fixtures/typescript/module-namespace/namespace-declare-new-line/output.json index 738b0bfc7701..13ca1b14f6c6 100644 --- a/packages/babel-parser/test/fixtures/typescript/module-namespace/namespace-declare-new-line/output.json +++ b/packages/babel-parser/test/fixtures/typescript/module-namespace/namespace-declare-new-line/output.json @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":56,"loc":{"start":{"line":1,"column":0},"end":{"line":8,"column":2}}, "errors": [ - "SyntaxError: Missing semicolon (6:7)" + { + "$$ babel internal serialized type": "Error", + "message": "Missing semicolon (6:7)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "MissingSemicolon" + } ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/typescript/module-namespace/namespace-new-line-error/output.json b/packages/babel-parser/test/fixtures/typescript/module-namespace/namespace-new-line-error/output.json index 33ffb7be102a..0e9ad94418f7 100644 --- a/packages/babel-parser/test/fixtures/typescript/module-namespace/namespace-new-line-error/output.json +++ b/packages/babel-parser/test/fixtures/typescript/module-namespace/namespace-new-line-error/output.json @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":16,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":6}}, "errors": [ - "SyntaxError: Missing semicolon (2:3)" + { + "$$ babel internal serialized type": "Error", + "message": "Missing semicolon (2:3)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "MissingSemicolon" + } ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/typescript/module-namespace/top-level-await/output.json b/packages/babel-parser/test/fixtures/typescript/module-namespace/top-level-await/output.json index a99125a44c6f..e6c5db98cae9 100644 --- a/packages/babel-parser/test/fixtures/typescript/module-namespace/top-level-await/output.json +++ b/packages/babel-parser/test/fixtures/typescript/module-namespace/top-level-await/output.json @@ -2,7 +2,12 @@ "type": "File", "start":0,"end":39,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "errors": [ - "SyntaxError: 'await' is only allowed within async functions and at the top levels of modules (2:14)" + { + "$$ babel internal serialized type": "Error", + "message": "'await' is only allowed within async functions and at the top levels of modules (2:14)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR" + } ], "program": { "type": "Program", 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 b3b42d74d8e3..a99e085b8b20 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 @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "Identifier 'A' has already been declared (2:6)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "VarRedeclaration" + } ], "program": { "type": "Program", 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 a1cc8e60fcc4..78197b0a9df3 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 @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "Identifier 'A' has already been declared (2:5)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "VarRedeclaration" + } ], "program": { "type": "Program", 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 caddda18d801..0f8bc367f488 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 @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "Identifier 'A' has already been declared (2:5)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "VarRedeclaration" + } ], "program": { "type": "Program", 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 baf3fa807a05..c3b4d031c22e 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 @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "Identifier 'X' has already been declared (2:5)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "VarRedeclaration" + } ], "program": { "type": "Program", 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 6a310f817190..28de2e1b274c 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 @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "Identifier 'X' has already been declared (2:6)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "VarRedeclaration" + } ], "program": { "type": "Program", 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 0660bfd16649..f089c87b4f65 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 @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "Identifier 'X' has already been declared (2:11)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "VarRedeclaration" + } ], "program": { "type": "Program", 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 d254111a610a..274da710ce06 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 @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "Identifier 'Foo' has already been declared (2:9)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "VarRedeclaration" + } ], "program": { "type": "Program", 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 62bf37e86c3f..47579f6c8fa0 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 @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "Identifier 'X' has already been declared (2:10)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "VarRedeclaration" + } ], "program": { "type": "Program", 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 cf541c4247d4..ce26cdaf4da5 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 @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "Identifier 'Foo' has already been declared (2:4)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "VarRedeclaration" + } ], "program": { "type": "Program", 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 7b8d2e208cc2..8fdfaab233ee 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 @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "Identifier 'X' has already been declared (2:5)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "VarRedeclaration" + } ], "program": { "type": "Program", 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 cf541c4247d4..ce26cdaf4da5 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 @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "Identifier 'Foo' has already been declared (2:4)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "VarRedeclaration" + } ], "program": { "type": "Program", 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 2613394dc026..035d09541dd5 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 @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "Identifier 'Foo' has already been declared (2:5)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "VarRedeclaration" + } ], "program": { "type": "Program", 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 27a720cd09d3..8a8f655dcc25 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 @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "Identifier 'X' has already been declared (2:5)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "VarRedeclaration" + } ], "program": { "type": "Program", 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 cb3f09c087df..d7a0b73a7c33 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 @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "Identifier 'Foo' has already been declared (2:5)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "VarRedeclaration" + } ], "program": { "type": "Program", 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 7738c56de634..4e0220698db9 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 @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "Identifier 'A' has already been declared (2:6)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "VarRedeclaration" + } ], "program": { "type": "Program", 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 775af3064133..f5f8bf58a60b 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 @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "Identifier 'A' has already been declared (2:5)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "VarRedeclaration" + } ], "program": { "type": "Program", 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 2e27314bf592..8d174f73e58e 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 @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "Identifier 'A' has already been declared (2:10)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "VarRedeclaration" + } ], "program": { "type": "Program", 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 48fee42b09ad..4c8a95cd59e4 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 @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "Identifier 'A' has already been declared (2:5)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "VarRedeclaration" + } ], "program": { "type": "Program", 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 cb3f09c087df..d7a0b73a7c33 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 @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "Identifier 'Foo' has already been declared (2:5)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "VarRedeclaration" + } ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/typescript/tsx/cast-invalid/output.json b/packages/babel-parser/test/fixtures/typescript/tsx/cast-invalid/output.json index 945b8714ec0e..b63ed9a82de0 100644 --- a/packages/babel-parser/test/fixtures/typescript/tsx/cast-invalid/output.json +++ b/packages/babel-parser/test/fixtures/typescript/tsx/cast-invalid/output.json @@ -2,8 +2,20 @@ "type": "File", "start":0,"end":85,"loc":{"start":{"line":1,"column":0},"end":{"line":5,"column":1}}, "errors": [ - "SyntaxError: Did not expect a type annotation here. (3:21)", - "SyntaxError: Did not expect a type annotation here. (3:42)" + { + "$$ babel internal serialized type": "Error", + "message": "Did not expect a type annotation here. (3:21)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "UnexpectedTypeAnnotation" + }, + { + "$$ babel internal serialized type": "Error", + "message": "Did not expect a type annotation here. (3:42)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "UnexpectedTypeAnnotation" + } ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/typescript/type-alias/declare-new-line/output.json b/packages/babel-parser/test/fixtures/typescript/type-alias/declare-new-line/output.json index 89ebf2f1f64a..bd1acf8c0abc 100644 --- a/packages/babel-parser/test/fixtures/typescript/type-alias/declare-new-line/output.json +++ b/packages/babel-parser/test/fixtures/typescript/type-alias/declare-new-line/output.json @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":23,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":10}}, "errors": [ - "SyntaxError: Missing semicolon (1:7)" + { + "$$ babel internal serialized type": "Error", + "message": "Missing semicolon (1:7)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "MissingSemicolon" + } ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/typescript/type-arguments/empty-function/output.json b/packages/babel-parser/test/fixtures/typescript/type-arguments/empty-function/output.json index 1bbd06a7cd95..11ccdc238f47 100644 --- a/packages/babel-parser/test/fixtures/typescript/type-arguments/empty-function/output.json +++ b/packages/babel-parser/test/fixtures/typescript/type-arguments/empty-function/output.json @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":7,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":7}}, "errors": [ - "SyntaxError: Type argument list cannot be empty. (1:3)" + { + "$$ babel internal serialized type": "Error", + "message": "Type argument list cannot be empty. (1:3)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "EmptyTypeArguments" + } ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/typescript/type-arguments/empty-interface-extends/output.json b/packages/babel-parser/test/fixtures/typescript/type-arguments/empty-interface-extends/output.json index 220b78470f2f..ebd660a34d2b 100644 --- a/packages/babel-parser/test/fixtures/typescript/type-arguments/empty-interface-extends/output.json +++ b/packages/babel-parser/test/fixtures/typescript/type-arguments/empty-interface-extends/output.json @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":26,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":26}}, "errors": [ - "SyntaxError: Type argument list cannot be empty. (1:21)" + { + "$$ babel internal serialized type": "Error", + "message": "Type argument list cannot be empty. (1:21)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "EmptyTypeArguments" + } ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/typescript/type-arguments/empty-interface-implements/output.json b/packages/babel-parser/test/fixtures/typescript/type-arguments/empty-interface-implements/output.json index cc11dd5cbae0..79e1302710d8 100644 --- a/packages/babel-parser/test/fixtures/typescript/type-arguments/empty-interface-implements/output.json +++ b/packages/babel-parser/test/fixtures/typescript/type-arguments/empty-interface-implements/output.json @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":25,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":25}}, "errors": [ - "SyntaxError: Type argument list cannot be empty. (1:20)" + { + "$$ babel internal serialized type": "Error", + "message": "Type argument list cannot be empty. (1:20)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "EmptyTypeArguments" + } ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/typescript/type-arguments/empty-new/output.json b/packages/babel-parser/test/fixtures/typescript/type-arguments/empty-new/output.json index a885c67948a0..b63e0eb1018d 100644 --- a/packages/babel-parser/test/fixtures/typescript/type-arguments/empty-new/output.json +++ b/packages/babel-parser/test/fixtures/typescript/type-arguments/empty-new/output.json @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":10,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":10}}, "errors": [ - "SyntaxError: Type argument list cannot be empty. (1:5)" + { + "$$ babel internal serialized type": "Error", + "message": "Type argument list cannot be empty. (1:5)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "EmptyTypeArguments" + } ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/typescript/type-arguments/empty-superclass/output.json b/packages/babel-parser/test/fixtures/typescript/type-arguments/empty-superclass/output.json index f9d1a8f64dfc..aa142705a9be 100644 --- a/packages/babel-parser/test/fixtures/typescript/type-arguments/empty-superclass/output.json +++ b/packages/babel-parser/test/fixtures/typescript/type-arguments/empty-superclass/output.json @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":22,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":22}}, "errors": [ - "SyntaxError: Type argument list cannot be empty. (1:17)" + { + "$$ babel internal serialized type": "Error", + "message": "Type argument list cannot be empty. (1:17)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "EmptyTypeArguments" + } ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/typescript/type-arguments/empty-tsx/output.json b/packages/babel-parser/test/fixtures/typescript/type-arguments/empty-tsx/output.json index 8d7819a040e2..f641afea283e 100644 --- a/packages/babel-parser/test/fixtures/typescript/type-arguments/empty-tsx/output.json +++ b/packages/babel-parser/test/fixtures/typescript/type-arguments/empty-tsx/output.json @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":23,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":23}}, "errors": [ - "SyntaxError: Type argument list cannot be empty. (1:13)" + { + "$$ babel internal serialized type": "Error", + "message": "Type argument list cannot be empty. (1:13)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "EmptyTypeArguments" + } ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/typescript/type-arguments/empty-type-import/output.json b/packages/babel-parser/test/fixtures/typescript/type-arguments/empty-type-import/output.json index ef26442d29a4..9ce80f4cc095 100644 --- a/packages/babel-parser/test/fixtures/typescript/type-arguments/empty-type-import/output.json +++ b/packages/babel-parser/test/fixtures/typescript/type-arguments/empty-type-import/output.json @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":20,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":20}}, "errors": [ - "SyntaxError: Type argument list cannot be empty. (1:17)" + { + "$$ babel internal serialized type": "Error", + "message": "Type argument list cannot be empty. (1:17)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "EmptyTypeArguments" + } ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/typescript/type-arguments/empty-type-ref/output.json b/packages/babel-parser/test/fixtures/typescript/type-arguments/empty-type-ref/output.json index b12a70a3a674..2e0660677192 100644 --- a/packages/babel-parser/test/fixtures/typescript/type-arguments/empty-type-ref/output.json +++ b/packages/babel-parser/test/fixtures/typescript/type-arguments/empty-type-ref/output.json @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":13,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":13}}, "errors": [ - "SyntaxError: Type argument list cannot be empty. (1:10)" + { + "$$ babel internal serialized type": "Error", + "message": "Type argument list cannot be empty. (1:10)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "EmptyTypeArguments" + } ], "program": { "type": "Program", 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 3df1338cbc58..1163d269bee2 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 @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "A type-only import can specify a default import or named bindings, but not both. (1:0)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "TypeImportCannotSpecifyDefaultAndNamed" + } ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/typescript/types/import-type-dynamic-errors/output.json b/packages/babel-parser/test/fixtures/typescript/types/import-type-dynamic-errors/output.json index 0a28271d346e..ee246876acf0 100644 --- a/packages/babel-parser/test/fixtures/typescript/types/import-type-dynamic-errors/output.json +++ b/packages/babel-parser/test/fixtures/typescript/types/import-type-dynamic-errors/output.json @@ -2,9 +2,27 @@ "type": "File", "start":0,"end":63,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":19}}, "errors": [ - "SyntaxError: Argument in a type import must be a string literal (1:16)", - "SyntaxError: Argument in a type import must be a string literal (2:16)", - "SyntaxError: Argument in a type import must be a string literal (3:16)" + { + "$$ babel internal serialized type": "Error", + "message": "Argument in a type import must be a string literal (1:16)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "UnsupportedImportTypeArgument" + }, + { + "$$ babel internal serialized type": "Error", + "message": "Argument in a type import must be a string literal (2:16)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "UnsupportedImportTypeArgument" + }, + { + "$$ babel internal serialized type": "Error", + "message": "Argument in a type import must be a string literal (3:16)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "UnsupportedImportTypeArgument" + } ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/typescript/types/intrinsic-keyword-error/output.json b/packages/babel-parser/test/fixtures/typescript/types/intrinsic-keyword-error/output.json index ffd6e5a2a929..bd95a36575cc 100644 --- a/packages/babel-parser/test/fixtures/typescript/types/intrinsic-keyword-error/output.json +++ b/packages/babel-parser/test/fixtures/typescript/types/intrinsic-keyword-error/output.json @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":28,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":28}}, "errors": [ - "SyntaxError: Missing semicolon (1:20)" + { + "$$ babel internal serialized type": "Error", + "message": "Missing semicolon (1:20)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "MissingSemicolon" + } ], "program": { "type": "Program", 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 05caa4bb0bc0..674925e00503 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 @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "'readonly' type modifier is only permitted on array and tuple literal types. (1:11)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "UnexpectedReadonly" + } ], "program": { "type": "Program", @@ -13,6 +19,13 @@ { "type": "TSTypeAliasDeclaration", "start":0,"end":27,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":27}}, + "trailingComments": [ + { + "type": "CommentLine", + "value": " Error", + "start":29,"end":37,"loc":{"start":{"line":1,"column":29},"end":{"line":1,"column":37}} + } + ], "id": { "type": "Identifier", "start":5,"end":8,"loc":{"start":{"line":1,"column":5},"end":{"line":1,"column":8},"identifierName":"T30"}, @@ -26,14 +39,7 @@ "type": "TSStringKeyword", "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}} - } - ] + } } ], "directives": [] 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 95f72e236eb9..70249ea6d669 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 @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "'readonly' type modifier is only permitted on array and tuple literal types. (1:11)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "UnexpectedReadonly" + } ], "program": { "type": "Program", @@ -13,6 +19,13 @@ { "type": "TSTypeAliasDeclaration", "start":0,"end":22,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":22}}, + "trailingComments": [ + { + "type": "CommentLine", + "value": " Error", + "start":24,"end":32,"loc":{"start":{"line":1,"column":24},"end":{"line":1,"column":32}} + } + ], "id": { "type": "Identifier", "start":5,"end":8,"loc":{"start":{"line":1,"column":5},"end":{"line":1,"column":8},"identifierName":"T31"}, @@ -31,14 +44,7 @@ "name": "T" } } - }, - "trailingComments": [ - { - "type": "CommentLine", - "value": " Error", - "start":24,"end":32,"loc":{"start":{"line":1,"column":24},"end":{"line":1,"column":32}} - } - ] + } } ], "directives": [] 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 852a87e4d306..4057a84d843f 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 @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "'readonly' type modifier is only permitted on array and tuple literal types. (1:11)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "UnexpectedReadonly" + } ], "program": { "type": "Program", @@ -13,6 +19,13 @@ { "type": "TSTypeAliasDeclaration", "start":0,"end":38,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":38}}, + "trailingComments": [ + { + "type": "CommentLine", + "value": " Error", + "start":40,"end":48,"loc":{"start":{"line":1,"column":40},"end":{"line":1,"column":48}} + } + ], "id": { "type": "Identifier", "start":5,"end":8,"loc":{"start":{"line":1,"column":5},"end":{"line":1,"column":8},"identifierName":"T32"}, @@ -35,14 +48,7 @@ } } } - }, - "trailingComments": [ - { - "type": "CommentLine", - "value": " Error", - "start":40,"end":48,"loc":{"start":{"line":1,"column":40},"end":{"line":1,"column":48}} - } - ] + } } ], "directives": [] 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 b787889c9d34..395c2e970c6f 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 @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "'readonly' type modifier is only permitted on array and tuple literal types. (1:11)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "UnexpectedReadonly" + } ], "program": { "type": "Program", @@ -13,6 +19,13 @@ { "type": "TSTypeAliasDeclaration", "start":0,"end":34,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":34}}, + "trailingComments": [ + { + "type": "CommentLine", + "value": " Error", + "start":36,"end":44,"loc":{"start":{"line":1,"column":36},"end":{"line":1,"column":44}} + } + ], "id": { "type": "Identifier", "start":5,"end":8,"loc":{"start":{"line":1,"column":5},"end":{"line":1,"column":8},"identifierName":"T33"}, @@ -41,14 +54,7 @@ ] } } - }, - "trailingComments": [ - { - "type": "CommentLine", - "value": " Error", - "start":36,"end":44,"loc":{"start":{"line":1,"column":36},"end":{"line":1,"column":44}} - } - ] + } } ], "directives": [] diff --git a/packages/babel-parser/test/fixtures/typescript/types/tuple-invalid-label-1/output.json b/packages/babel-parser/test/fixtures/typescript/types/tuple-invalid-label-1/output.json index f78fc791b541..119d62de242f 100644 --- a/packages/babel-parser/test/fixtures/typescript/types/tuple-invalid-label-1/output.json +++ b/packages/babel-parser/test/fixtures/typescript/types/tuple-invalid-label-1/output.json @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":18,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":18}}, "errors": [ - "SyntaxError: Tuple members must be labeled with a simple identifier. (1:10)" + { + "$$ babel internal serialized type": "Error", + "message": "Tuple members must be labeled with a simple identifier. (1:10)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "InvalidTupleMemberLabel" + } ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/typescript/types/tuple-invalid-label-2/output.json b/packages/babel-parser/test/fixtures/typescript/types/tuple-invalid-label-2/output.json index 37710a11ffc3..5aa960c010f3 100644 --- a/packages/babel-parser/test/fixtures/typescript/types/tuple-invalid-label-2/output.json +++ b/packages/babel-parser/test/fixtures/typescript/types/tuple-invalid-label-2/output.json @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":19,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":19}}, "errors": [ - "SyntaxError: Tuple members must be labeled with a simple identifier. (1:10)" + { + "$$ babel internal serialized type": "Error", + "message": "Tuple members must be labeled with a simple identifier. (1:10)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "InvalidTupleMemberLabel" + } ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/typescript/types/tuple-labeled-after-unlabeled/output.json b/packages/babel-parser/test/fixtures/typescript/types/tuple-labeled-after-unlabeled/output.json index c0deaecdd5f3..0125d9f73591 100644 --- a/packages/babel-parser/test/fixtures/typescript/types/tuple-labeled-after-unlabeled/output.json +++ b/packages/babel-parser/test/fixtures/typescript/types/tuple-labeled-after-unlabeled/output.json @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":19,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":19}}, "errors": [ - "SyntaxError: Tuple members must all have names or all not have names. (1:13)" + { + "$$ babel internal serialized type": "Error", + "message": "Tuple members must all have names or all not have names. (1:13)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "MixedLabeledAndUnlabeledElements" + } ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/typescript/types/tuple-labeled-before-unlabeled/output.json b/packages/babel-parser/test/fixtures/typescript/types/tuple-labeled-before-unlabeled/output.json index 083db448c753..8ad05a66bc76 100644 --- a/packages/babel-parser/test/fixtures/typescript/types/tuple-labeled-before-unlabeled/output.json +++ b/packages/babel-parser/test/fixtures/typescript/types/tuple-labeled-before-unlabeled/output.json @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":19,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":19}}, "errors": [ - "SyntaxError: Tuple members must all have names or all not have names. (1:16)" + { + "$$ babel internal serialized type": "Error", + "message": "Tuple members must all have names or all not have names. (1:16)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "MixedLabeledAndUnlabeledElements" + } ], "program": { "type": "Program", 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 f15efb254a34..74324d4dcec6 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 @@ -2,7 +2,13 @@ "type": "File", "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)" + { + "$$ babel internal serialized type": "Error", + "message": "A required element cannot follow an optional element. (1:17)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "OptionalTypeBeforeRequired" + } ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/typescript/types/tuple-required-after-labeled-optional/output.json b/packages/babel-parser/test/fixtures/typescript/types/tuple-required-after-labeled-optional/output.json index 6675981261a0..b8d36667f8a2 100644 --- a/packages/babel-parser/test/fixtures/typescript/types/tuple-required-after-labeled-optional/output.json +++ b/packages/babel-parser/test/fixtures/typescript/types/tuple-required-after-labeled-optional/output.json @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":23,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":23}}, "errors": [ - "SyntaxError: A required element cannot follow an optional element. (1:17)" + { + "$$ babel internal serialized type": "Error", + "message": "A required element cannot follow an optional element. (1:17)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "OptionalTypeBeforeRequired" + } ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/typescript/types/tuple-unlabeled-spread-after-labeled/output.json b/packages/babel-parser/test/fixtures/typescript/types/tuple-unlabeled-spread-after-labeled/output.json index 24e7d290ecd6..e88e9b6622d3 100644 --- a/packages/babel-parser/test/fixtures/typescript/types/tuple-unlabeled-spread-after-labeled/output.json +++ b/packages/babel-parser/test/fixtures/typescript/types/tuple-unlabeled-spread-after-labeled/output.json @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":22,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":22}}, "errors": [ - "SyntaxError: Tuple members must all have names or all not have names. (1:19)" + { + "$$ babel internal serialized type": "Error", + "message": "Tuple members must all have names or all not have names. (1:19)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "MixedLabeledAndUnlabeledElements" + } ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/typescript/types/tuple-unlabeled-spread-before-labeled/output.json b/packages/babel-parser/test/fixtures/typescript/types/tuple-unlabeled-spread-before-labeled/output.json index 5115e0744bd4..53722081dea2 100644 --- a/packages/babel-parser/test/fixtures/typescript/types/tuple-unlabeled-spread-before-labeled/output.json +++ b/packages/babel-parser/test/fixtures/typescript/types/tuple-unlabeled-spread-before-labeled/output.json @@ -2,7 +2,13 @@ "type": "File", "start":0,"end":22,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":22}}, "errors": [ - "SyntaxError: Tuple members must all have names or all not have names. (1:16)" + { + "$$ babel internal serialized type": "Error", + "message": "Tuple members must all have names or all not have names. (1:16)", + "name": "SyntaxError", + "code": "BABEL_PARSER_SYNTAX_ERROR", + "reasonCode": "MixedLabeledAndUnlabeledElements" + } ], "program": { "type": "Program",