From df021c7f23f6017c3df687708e5aa985d34b9cdf Mon Sep 17 00:00:00 2001 From: Sebastian McKenzie Date: Tue, 11 Aug 2015 00:59:15 +0100 Subject: [PATCH] add esprima tests and fix bugs picked up by it --- src/options.js | 5 - src/parser/expression.js | 160 +++-- src/parser/lval.js | 19 +- src/parser/statement.js | 89 ++- src/parser/util.js | 17 + src/plugins/flow.js | 64 +- .../core/uncategorised/484/expected.json | 117 ++++ .../core/uncategorised/485/expected.json | 117 ++++ .../core/uncategorised/488/expected.json | 149 +++++ .../core/uncategorised/489/expected.json | 149 +++++ .../core/uncategorised/491/expected.json | 149 +++++ .../core/uncategorised/495/expected.json | 134 +++++ .../core/uncategorised/496/expected.json | 134 +++++ .../core/uncategorised/511/expected.json | 134 +++++ .../core/uncategorised/512/expected.json | 117 ++++ .../core/uncategorised/515/expected.json | 134 +++++ .../core/uncategorised/516/expected.json | 134 +++++ .../core/uncategorised/520/expected.json | 150 +++++ .../core/uncategorised/521/expected.json | 150 +++++ .../core/uncategorised/536/expected.json | 83 +++ test/fixtures/esprima/LICENSE | 21 + .../migrated_0000/actual.js | 2 + .../migrated_0000/expected.json | 129 ++++ .../migrated_0001/actual.js | 2 + .../migrated_0001/expected.json | 129 ++++ .../migrated_0002/actual.js | 1 + .../migrated_0002/expected.json | 129 ++++ .../migrated_0003/actual.js | 2 + .../migrated_0003/expected.json | 197 ++++++ .../migrated_0004/actual.js | 2 + .../migrated_0004/expected.json | 130 ++++ .../migrated_0005/actual.js | 2 + .../migrated_0005/expected.json | 198 ++++++ .../migrated_0006/actual.js | 2 + .../migrated_0006/expected.json | 198 ++++++ .../migrated_0007/actual.js | 2 + .../migrated_0007/expected.json | 130 ++++ .../migrated_0008/actual.js | 2 + .../migrated_0008/expected.json | 198 ++++++ .../migrated_0009/actual.js | 2 + .../migrated_0009/expected.json | 198 ++++++ .../migrated_0010/actual.js | 2 + .../migrated_0010/expected.json | 132 ++++ .../migrated_0011/actual.js | 2 + .../migrated_0011/expected.json | 200 ++++++ .../migrated_0012/actual.js | 2 + .../migrated_0012/expected.json | 200 ++++++ .../migrated_0013/actual.js | 2 + .../migrated_0013/expected.json | 112 ++++ .../migrated_0014/actual.js | 2 + .../migrated_0014/expected.json | 181 ++++++ .../migrated_0015/actual.js | 2 + .../migrated_0015/expected.json | 181 ++++++ .../declaration-const/migrated_0000/actual.js | 1 + .../migrated_0000/expected.json | 100 +++ .../declaration-const/migrated_0001/actual.js | 1 + .../migrated_0001/expected.json | 117 ++++ .../declaration-const/migrated_0002/actual.js | 1 + .../migrated_0002/expected.json | 215 +++++++ .../declaration-function/dupe-param/actual.js | 1 + .../empty-param/actual.js | 1 + .../empty-param/expected.json | 150 +++++ .../migrated_0000/actual.js | 1 + .../migrated_0000/expected.json | 131 ++++ .../migrated_0001/actual.js | 1 + .../migrated_0001/expected.json | 83 +++ .../migrated_0002/actual.js | 1 + .../migrated_0002/expected.json | 83 +++ .../migrated_0003/actual.js | 1 + .../migrated_0003/expected.json | 116 ++++ .../migrated_0004/actual.js | 1 + .../migrated_0004/expected.json | 132 ++++ .../migrated_0005/actual.js | 1 + .../migrated_0005/expected.json | 168 ++++++ .../migrated_0006/actual.js | 1 + .../migrated_0006/expected.json | 148 +++++ .../migrated_0007/actual.js | 1 + .../migrated_0007/expected.json | 164 +++++ .../migrated_0008/actual.js | 1 + .../migrated_0008/expected.json | 165 +++++ .../migrated_0009/actual.js | 1 + .../migrated_0009/expected.json | 132 ++++ .../migrated_0010/actual.js | 1 + .../migrated_0010/expected.json | 132 ++++ .../migrated_0011/actual.js | 1 + .../migrated_0011/expected.json | 180 ++++++ .../migrated_0012/actual.js | 1 + .../migrated_0012/expected.json | 84 +++ .../migrated_0013/actual.js | 1 + .../migrated_0013/expected.json | 100 +++ .../migrated_0014/actual.js | 1 + .../migrated_0014/expected.json | 151 +++++ .../declaration-let/migrated_0000/actual.js | 1 + .../migrated_0000/expected.json | 83 +++ .../declaration-let/migrated_0001/actual.js | 1 + .../migrated_0001/expected.json | 100 +++ .../declaration-let/migrated_0002/actual.js | 1 + .../migrated_0002/expected.json | 117 ++++ .../declaration-let/migrated_0003/actual.js | 1 + .../migrated_0003/expected.json | 215 +++++++ .../directive-prolog/migrated_0000/actual.js | 1 + .../migrated_0000/expected.json | 180 ++++++ .../directive-prolog/migrated_0001/actual.js | 1 + .../migrated_0001/expected.json | 180 ++++++ .../array-binding-pattern-01/actual.js | 1 + .../array-binding-pattern-01/expected.json | 136 +++++ .../array-binding-pattern-02/actual.js | 1 + .../array-binding-pattern-02/expected.json | 135 +++++ .../array-binding-pattern-03/actual.js | 1 + .../array-binding-pattern-03/expected.json | 150 +++++ .../array-binding-pattern-empty/actual.js | 1 + .../array-binding-pattern-empty/expected.json | 102 ++++ .../elision/actual.js | 1 + .../elision/expected.json | 105 ++++ .../invalid-dup-param/actual.js | 1 + .../invalid-dup-param/expected.json | 183 ++++++ .../invalid-dup-param/options.json | 3 + .../invalid-elision-after-rest/actual.js | 1 + .../invalid-elision-after-rest/expected.json | 150 +++++ .../invalid-elision-after-rest/options.json | 3 + .../dupe-param-1/actual.js | 2 + .../dupe-param-2/actual.js | 2 + .../dupe-param-3/actual.js | 2 + .../es2015-array-pattern/elision/actual.js | 1 + .../elision/expected.json | 117 ++++ .../empty-pattern-catch-param/actual.js | 1 + .../empty-pattern-catch-param/expected.json | 113 ++++ .../empty-pattern-fn/actual.js | 1 + .../empty-pattern-fn/expected.json | 100 +++ .../empty-pattern-lexical/actual.js | 1 + .../empty-pattern-lexical/expected.json | 98 +++ .../empty-pattern-var/actual.js | 1 + .../empty-pattern-var/expected.json | 100 +++ .../es2015-array-pattern/hole/actual.js | 1 + .../es2015-array-pattern/hole/expected.json | 134 +++++ .../nested-pattern/actual.js | 1 + .../nested-pattern/expected.json | 117 ++++ .../patterned-catch-dupe/actual.js | 1 + .../patterned-catch-dupe/expected.json | 146 +++++ .../patterned-catch-dupe/options.json | 3 + .../patterned-catch/actual.js | 1 + .../patterned-catch/expected.json | 464 ++++++++++++++ .../es2015-array-pattern/rest/actual.js | 1 + .../es2015-array-pattern/rest/expected.json | 132 ++++ .../es2015-array-pattern/rest/options.json | 3 + .../tailing-hold/actual.js | 1 + .../tailing-hold/expected.json | 118 ++++ .../with-default-catch-param-fail/actual.js | 1 + .../options.json | 3 + .../with-default-catch-param/actual.js | 1 + .../with-default-catch-param/expected.json | 163 +++++ .../with-default-fn/actual.js | 1 + .../with-default-fn/expected.json | 150 +++++ .../with-object-pattern/actual.js | 1 + .../with-object-pattern/expected.json | 169 ++++++ .../arrow-rest-forgetting-comma/actual.js | 1 + .../arrow-rest-forgetting-comma/options.json | 3 + .../actual.js | 1 + .../expected.json | 149 +++++ .../arrow-with-multiple-rest/actual.js | 1 + .../arrow-with-multiple-rest/options.json | 3 + .../arrow-with-only-rest/actual.js | 1 + .../arrow-with-only-rest/expected.json | 117 ++++ .../actual.js | 1 + .../options.json | 3 + .../invalid-duplicated-params/actual.js | 1 + .../invalid-duplicated-params/options.json | 3 + .../invalid-line-terminator-arrow/actual.js | 2 + .../options.json | 3 + .../invalid-param-strict-mode/actual.js | 1 + .../invalid-param-strict-mode/expected.json | 134 +++++ .../invalid-param-strict-mode/options.json | 3 + .../migrated_0000/actual.js | 1 + .../migrated_0000/expected.json | 85 +++ .../migrated_0001/actual.js | 1 + .../migrated_0001/expected.json | 102 ++++ .../migrated_0002/actual.js | 1 + .../migrated_0002/expected.json | 102 ++++ .../migrated_0003/actual.js | 1 + .../migrated_0003/expected.json | 118 ++++ .../migrated_0004/actual.js | 1 + .../migrated_0004/expected.json | 134 +++++ .../migrated_0005/actual.js | 1 + .../migrated_0005/expected.json | 155 +++++ .../migrated_0006/actual.js | 1 + .../migrated_0006/expected.json | 165 +++++ .../migrated_0007/actual.js | 1 + .../migrated_0007/expected.json | 150 +++++ .../migrated_0008/actual.js | 1 + .../migrated_0008/expected.json | 165 +++++ .../migrated_0009/actual.js | 1 + .../migrated_0009/expected.json | 102 ++++ .../migrated_0010/actual.js | 1 + .../migrated_0010/expected.json | 102 ++++ .../migrated_0011/actual.js | 1 + .../migrated_0011/expected.json | 102 ++++ .../migrated_0012/actual.js | 1 + .../migrated_0012/expected.json | 118 ++++ .../migrated_0013/actual.js | 1 + .../migrated_0013/expected.json | 135 +++++ .../migrated_0014/actual.js | 1 + .../migrated_0014/expected.json | 151 +++++ .../migrated_0015/actual.js | 1 + .../migrated_0015/expected.json | 101 ++++ .../migrated_0016/actual.js | 1 + .../migrated_0016/expected.json | 138 +++++ .../migrated_0017/actual.js | 1 + .../migrated_0017/expected.json | 203 +++++++ .../migrated_0018/actual.js | 1 + .../migrated_0018/expected.json | 116 ++++ .../migrated_0019/actual.js | 1 + .../migrated_0019/expected.json | 149 +++++ .../migrated_0020/actual.js | 1 + .../migrated_0020/expected.json | 100 +++ .../actual.js | 1 + .../options.json | 3 + .../actual.js | 1 + .../options.json | 3 + .../object-binding-pattern/expected.json | 32 + .../invalid-member-expr.failure.json | 1 + .../invalid-member-expr.js | 1 + .../invalid-method-in-pattern.failure.json | 1 + .../invalid-method-in-pattern.js | 1 + .../invalid-nested-param.failure.json | 1 + .../invalid-nested-param.js | 1 + ...d-pattern-without-parenthesis.failure.json | 1 + .../invalid-pattern-without-parenthesis.js | 1 + ...nvalid-rest-in-object-pattern.failure.json | 1 + .../invalid-rest-in-object-pattern.js | 1 + .../nested-cover-grammar.js | 1 + .../object-binding-pattern-01.js | 1 + .../object-binding-pattern-empty.js | 1 + .../param-with-rest-without-arrow/actual.js | 1 + .../options.json | 3 + .../rest-without-arrow/actual.js | 1 + .../rest-without-arrow/options.json | 3 + .../migrated_0000/actual.js | 1 + .../migrated_0000/expected.json | 66 ++ .../migrated_0001/actual.js | 1 + .../migrated_0001/expected.json | 66 ++ .../migrated_0002/actual.js | 1 + .../migrated_0002/expected.json | 66 ++ .../migrated_0003/actual.js | 1 + .../migrated_0003/expected.json | 66 ++ .../migrated_0004/actual.js | 1 + .../migrated_0004/expected.json | 66 ++ .../migrated_0005/actual.js | 1 + .../migrated_0005/expected.json | 66 ++ .../es2015-class/migrated_0000/actual.js | 1 + .../es2015-class/migrated_0000/expected.json | 81 +++ .../es2015-class/migrated_0001/actual.js | 1 + .../es2015-class/migrated_0001/expected.json | 98 +++ .../es2015-class/migrated_0002/actual.js | 1 + .../es2015-class/migrated_0002/expected.json | 81 +++ .../es2015-class/migrated_0003/actual.js | 1 + .../es2015-class/migrated_0003/expected.json | 81 +++ .../es2015-class/migrated_0004/actual.js | 1 + .../es2015-class/migrated_0004/expected.json | 151 +++++ .../es2015-class/migrated_0005/actual.js | 1 + .../es2015-class/migrated_0005/expected.json | 220 +++++++ .../es2015-class/migrated_0006/actual.js | 1 + .../es2015-class/migrated_0006/expected.json | 220 +++++++ .../es2015-class/migrated_0007/actual.js | 1 + .../es2015-class/migrated_0007/expected.json | 220 +++++++ .../es2015-class/migrated_0008/actual.js | 1 + .../es2015-class/migrated_0008/expected.json | 220 +++++++ .../es2015-class/migrated_0009/actual.js | 1 + .../es2015-class/migrated_0009/expected.json | 151 +++++ .../es2015-class/migrated_0010/actual.js | 1 + .../es2015-class/migrated_0010/expected.json | 237 ++++++++ .../es2015-class/migrated_0011/actual.js | 1 + .../es2015-class/migrated_0011/expected.json | 306 ++++++++++ .../es2015-class/migrated_0012/actual.js | 1 + .../es2015-class/migrated_0012/expected.json | 151 +++++ .../es2015-class/migrated_0013/actual.js | 1 + .../es2015-class/migrated_0013/expected.json | 151 +++++ .../es2015-class/migrated_0014/actual.js | 1 + .../es2015-class/migrated_0014/expected.json | 220 +++++++ .../es2015-class/migrated_0015/actual.js | 1 + .../es2015-class/migrated_0015/expected.json | 151 +++++ .../es2015-class/migrated_0016/actual.js | 1 + .../es2015-class/migrated_0016/expected.json | 147 +++++ .../es2015-class/migrated_0017/actual.js | 1 + .../es2015-class/migrated_0017/expected.json | 151 +++++ .../es2015-class/migrated_0018/actual.js | 1 + .../es2015-class/migrated_0018/expected.json | 151 +++++ .../es2015-class/migrated_0019/actual.js | 1 + .../es2015-class/migrated_0019/expected.json | 224 +++++++ .../es2015-class/migrated_0020/actual.js | 1 + .../es2015-class/migrated_0020/expected.json | 220 +++++++ .../es2015-class/migrated_0021/actual.js | 1 + .../es2015-class/migrated_0021/expected.json | 153 +++++ .../es2015-class/migrated_0022/actual.js | 1 + .../es2015-class/migrated_0022/expected.json | 82 +++ .../es2015-class/migrated_0023/actual.js | 1 + .../es2015-class/migrated_0023/expected.json | 97 +++ .../es2015-class/migrated_0024/actual.js | 1 + .../es2015-class/migrated_0024/expected.json | 99 +++ .../es2015-class/migrated_0025/actual.js | 1 + .../es2015-class/migrated_0025/expected.json | 114 ++++ .../es2015-class/migrated_0026/actual.js | 1 + .../es2015-class/migrated_0026/expected.json | 168 ++++++ .../migrated_0000/actual.js | 1 + .../migrated_0000/expected.json | 165 +++++ .../migrated_0001/actual.js | 1 + .../migrated_0001/expected.json | 133 ++++ .../migrated_0002/actual.js | 1 + .../migrated_0002/expected.json | 217 +++++++ .../dup-assignment/actual.js | 1 + .../dup-assignment/expected.json | 163 +++++ .../elision/actual.js | 1 + .../elision/expected.json | 101 ++++ .../member-expr-in-rest/actual.js | 1 + .../member-expr-in-rest/expected.json | 164 +++++ .../nested-assignment/actual.js | 1 + .../nested-assignment/expected.json | 293 +++++++++ .../nested-cover-grammar/actual.js | 1 + .../nested-cover-grammar/expected.json | 198 ++++++ .../simple-assignment/actual.js | 1 + .../simple-assignment/expected.json | 115 ++++ .../empty-object-pattern-assignment/actual.js | 1 + .../expected.json | 99 +++ .../invalid-lhs-01/actual.js | 1 + .../invalid-lhs-01/options.json | 3 + .../invalid-lhs-02/actual.js | 1 + .../invalid-lhs-02/options.json | 3 + .../invalid-pattern-with-method/actual.js | 1 + .../invalid-pattern-with-method/options.json | 3 + .../nested-cover-grammar/actual.js | 1 + .../nested-cover-grammar/expected.json | 555 +++++++++++++++++ .../object-pattern-assignment/actual.js | 8 + .../object-pattern-assignment/expected.json | 568 ++++++++++++++++++ .../invalid-cover-grammar/actual.js | 1 + .../invalid-cover-grammar/options.json | 3 + .../invalid-group-assignment/actual.js | 1 + .../invalid-group-assignment/options.json | 3 + .../export-const-number/actual.js | 1 + .../export-const-number/expected.json | 117 ++++ .../export-default-array/actual.js | 1 + .../export-default-array/expected.json | 64 ++ .../export-default-class/actual.js | 1 + .../export-default-class/expected.json | 81 +++ .../export-default-expression/actual.js | 1 + .../export-default-expression/expected.json | 101 ++++ .../export-default-function/actual.js | 1 + .../export-default-function/expected.json | 83 +++ .../export-default-named-function/actual.js | 1 + .../expected.json | 98 +++ .../export-default-number/actual.js | 1 + .../export-default-number/expected.json | 66 ++ .../export-default-object/actual.js | 1 + .../export-default-object/expected.json | 118 ++++ .../export-default-value/actual.js | 1 + .../export-default-value/expected.json | 64 ++ .../export-from-batch/actual.js | 1 + .../export-from-batch/expected.json | 66 ++ .../export-from-default/actual.js | 1 + .../export-from-default/expected.json | 116 ++++ .../export-from-named-as-default/actual.js | 1 + .../expected.json | 116 ++++ .../export-from-named-as-specifier/actual.js | 1 + .../expected.json | 116 ++++ .../export-from-named-as-specifiers/actual.js | 1 + .../expected.json | 163 +++++ .../export-from-specifier/actual.js | 1 + .../export-from-specifier/expected.json | 116 ++++ .../export-from-specifiers/actual.js | 1 + .../export-from-specifiers/expected.json | 163 +++++ .../export-function-declaration/actual.js | 1 + .../export-function-declaration/expected.json | 133 ++++ .../export-function/actual.js | 1 + .../export-function/expected.json | 100 +++ .../export-let-number/actual.js | 1 + .../export-let-number/expected.json | 117 ++++ .../export-named-as-default/actual.js | 1 + .../export-named-as-default/expected.json | 99 +++ .../export-named-as-specifier/actual.js | 1 + .../export-named-as-specifier/expected.json | 99 +++ .../export-named-as-specifiers/actual.js | 1 + .../export-named-as-specifiers/expected.json | 146 +++++ .../export-named-empty/actual.js | 1 + .../export-named-empty/expected.json | 51 ++ .../export-named-specifier/actual.js | 1 + .../export-named-specifier/expected.json | 99 +++ .../export-named-specifiers-comma/actual.js | 1 + .../expected.json | 146 +++++ .../export-named-specifiers/actual.js | 1 + .../export-named-specifiers/expected.json | 146 +++++ .../export-var-anonymous-function/actual.js | 1 + .../expected.json | 134 +++++ .../export-var-number/actual.js | 1 + .../export-var-number/expected.json | 117 ++++ .../export-var/actual.js | 1 + .../export-var/expected.json | 100 +++ .../actual.js | 1 + .../options.json | 3 + .../invalid-export-batch-token/actual.js | 1 + .../invalid-export-batch-token/options.json | 3 + .../invalid-export-default-equal/actual.js | 1 + .../invalid-export-default-equal/options.json | 3 + .../invalid-export-default-token/actual.js | 1 + .../invalid-export-default-token/options.json | 3 + .../invalid-export-default/actual.js | 1 + .../invalid-export-default/options.json | 3 + .../invalid-export-named-default/actual.js | 1 + .../invalid-export-named-default/options.json | 3 + .../es2015-export-declaration/options.json | 3 + .../for-of-array-pattern-let/actual.js | 1 + .../for-of-array-pattern-let/expected.json | 162 +++++ .../for-of-array-pattern/actual.js | 1 + .../for-of-array-pattern/expected.json | 128 ++++ .../for-of-object-pattern-const/actual.js | 1 + .../for-of-object-pattern-const/expected.json | 232 +++++++ .../for-of-object-pattern/actual.js | 1 + .../for-of-object-pattern/expected.json | 198 ++++++ .../es2015-for-of/for-of-with-const/actual.js | 1 + .../for-of-with-const/expected.json | 129 ++++ .../es2015-for-of/for-of-with-let/actual.js | 1 + .../for-of-with-let/expected.json | 129 ++++ .../es2015-for-of/for-of-with-var/actual.js | 1 + .../for-of-with-var/expected.json | 129 ++++ .../esprima/es2015-for-of/for-of/actual.js | 1 + .../es2015-for-of/for-of/expected.json | 95 +++ .../invalid-const-init/actual.js | 1 + .../invalid-const-init/options.json | 3 + .../es2015-for-of/invalid-let-init/actual.js | 1 + .../invalid-let-init/options.json | 3 + .../es2015-for-of/invalid-lhs-init/actual.js | 1 + .../invalid-lhs-init/options.json | 3 + .../es2015-for-of/invalid-var-init/actual.js | 1 + .../invalid-var-init/expected.json | 146 +++++ .../invalid-var-init/options.json | 3 + .../esprima/es2015-for-of/let-of-of/actual.js | 1 + .../es2015-for-of/let-of-of/expected.json | 129 ++++ .../es2015-for-of/unexpected-number/actual.js | 1 + .../unexpected-number/options.json | 3 + .../actual.js | 1 + .../expected.json | 132 ++++ .../actual.js | 1 + .../expected.json | 133 ++++ .../actual.js | 1 + .../expected.json | 133 ++++ .../generator-declaration/actual.js | 1 + .../generator-declaration/expected.json | 83 +++ .../generator-expression-rest-param/actual.js | 1 + .../expected.json | 116 ++++ .../actual.js | 1 + .../expected.json | 133 ++++ .../actual.js | 1 + .../expected.json | 181 ++++++ .../generator-expression-with-yield/actual.js | 1 + .../expected.json | 134 +++++ .../generator-expression/actual.js | 1 + .../generator-expression/expected.json | 84 +++ .../actual.js | 3 + .../options.json | 3 + .../actual.js | 1 + .../options.json | 3 + .../generator-method-with-params/actual.js | 1 + .../expected.json | 185 ++++++ .../actual.js | 1 + .../expected.json | 186 ++++++ .../actual.js | 1 + .../expected.json | 186 ++++++ .../actual.js | 4 + .../expected.json | 202 +++++++ .../generator-method-with-yield/actual.js | 1 + .../generator-method-with-yield/expected.json | 169 ++++++ .../generator-method/actual.js | 1 + .../generator-method/expected.json | 136 +++++ .../actual.js | 3 + .../options.json | 3 + .../actual.js | 1 + .../options.json | 3 + .../actual.js | 3 + .../options.json | 3 + .../actual.js | 3 + .../options.json | 3 + .../actual.js | 3 + .../options.json | 3 + .../actual.js | 3 + .../options.json | 3 + .../actual.js | 3 + .../options.json | 3 + .../incomplete-yield-delegate/actual.js | 1 + .../incomplete-yield-delegate/options.json | 3 + .../malformed-generator-method-2/actual.js | 1 + .../malformed-generator-method-2/options.json | 3 + .../malformed-generator-method/actual.js | 1 + .../malformed-generator-method/options.json | 3 + .../actual.js | 1 + .../expected.json | 151 +++++ .../static-generator-method/actual.js | 1 + .../static-generator-method/expected.json | 151 +++++ .../dakuten_handakuten/actual.js | 1 + .../dakuten_handakuten/expected.json | 96 +++ .../es2015-identifier/escaped_all/actual.js | 1 + .../escaped_all/expected.json | 83 +++ .../escaped_math_alef/actual.js | 1 + .../escaped_math_alef/expected.json | 83 +++ .../escaped_math_dal_part/actual.js | 1 + .../escaped_math_dal_part/expected.json | 83 +++ .../escaped_math_kaf_lam/actual.js | 1 + .../escaped_math_kaf_lam/expected.json | 83 +++ .../escaped_math_zain_start/actual.js | 1 + .../escaped_math_zain_start/expected.json | 83 +++ .../es2015-identifier/escaped_part/actual.js | 1 + .../escaped_part/expected.json | 83 +++ .../es2015-identifier/escaped_start/actual.js | 1 + .../escaped_start/expected.json | 83 +++ .../es2015-identifier/estimated/actual.js | 1 + .../es2015-identifier/estimated/expected.json | 83 +++ .../ethiopic_digits/actual.js | 1 + .../ethiopic_digits/expected.json | 83 +++ .../invalid_escaped_surrogate_pairs/actual.js | 1 + .../options.json | 3 + .../invalid_expression_await/actual.js | 1 + .../invalid_expression_await/options.json | 3 + .../invalid_function_wait/actual.js | 1 + .../invalid_function_wait/expected.json | 83 +++ .../invalid_function_wait/options.json | 3 + .../invalid_id_smp/actual.js | 1 + .../invalid_id_smp/options.json | 3 + .../invalid_lone_surrogate/actual.js | 1 + .../invalid_lone_surrogate/expected.json | 100 +++ .../invalid_lone_surrogate/options.json | 3 + .../invalid_var_await/actual.js | 1 + .../invalid_var_await/options.json | 3 + .../es2015-identifier/math_alef/actual.js | 1 + .../es2015-identifier/math_alef/expected.json | 83 +++ .../es2015-identifier/math_dal_part/actual.js | 1 + .../math_dal_part/expected.json | 83 +++ .../es2015-identifier/math_kaf_lam/actual.js | 1 + .../math_kaf_lam/expected.json | 83 +++ .../math_zain_start/actual.js | 1 + .../math_zain_start/expected.json | 83 +++ .../es2015-identifier/module_await/actual.js | 1 + .../module_await/expected.json | 98 +++ .../es2015-identifier/valid_await/actual.js | 1 + .../valid_await/expected.json | 115 ++++ .../es2015-identifier/weierstrass/actual.js | 1 + .../weierstrass/expected.json | 83 +++ .../weierstrass_weierstrass/actual.js | 1 + .../weierstrass_weierstrass/expected.json | 83 +++ .../actual.js | 1 + .../expected.json | 146 +++++ .../actual.js | 1 + .../expected.json | 130 ++++ .../import-default-as/actual.js | 1 + .../import-default-as/expected.json | 115 ++++ .../import-default/actual.js | 1 + .../import-default/expected.json | 99 +++ .../import-jquery/actual.js | 1 + .../import-jquery/expected.json | 99 +++ .../import-module/actual.js | 1 + .../import-module/expected.json | 67 +++ .../import-named-as-specifier/actual.js | 1 + .../import-named-as-specifier/expected.json | 115 ++++ .../import-named-as-specifiers/actual.js | 1 + .../import-named-as-specifiers/expected.json | 162 +++++ .../import-named-empty/actual.js | 1 + .../import-named-empty/expected.json | 67 +++ .../import-named-specifier/actual.js | 1 + .../import-named-specifier/expected.json | 115 ++++ .../import-named-specifiers-comma/actual.js | 1 + .../expected.json | 162 +++++ .../import-named-specifiers/actual.js | 1 + .../import-named-specifiers/expected.json | 162 +++++ .../import-namespace-specifier/actual.js | 1 + .../import-namespace-specifier/expected.json | 99 +++ .../import-null-as-nil/actual.js | 1 + .../import-null-as-nil/expected.json | 115 ++++ .../actual.js | 1 + .../options.json | 3 + .../actual.js | 1 + .../options.json | 3 + .../actual.js | 1 + .../options.json | 3 + .../actual.js | 1 + .../options.json | 3 + .../invalid-import-default/actual.js | 1 + .../invalid-import-default/options.json | 3 + .../invalid-import-missing-comma/actual.js | 1 + .../invalid-import-missing-comma/options.json | 3 + .../actual.js | 1 + .../options.json | 3 + .../invalid-import-module-specifier/actual.js | 1 + .../options.json | 3 + .../actual.js | 1 + .../options.json | 3 + .../actual.js | 1 + .../options.json | 3 + .../actual.js | 1 + .../options.json | 3 + .../actual.js | 1 + .../options.json | 3 + .../actual.js | 1 + .../options.json | 3 + .../invalid-import-specifiers/actual.js | 1 + .../invalid-import-specifiers/options.json | 3 + .../es2015-import-declaration/options.json | 3 + .../actual.js | 1 + .../options.json | 3 + .../invalid_const_forin/actual.js | 1 + .../invalid_const_forin/options.json | 3 + .../invalid_let_forin/actual.js | 1 + .../invalid_let_forin/options.json | 3 + .../migrated_0000/actual.js | 1 + .../migrated_0000/expected.json | 184 ++++++ .../assign-new-target/actual.js | 3 + .../assign-new-target/expected.json | 180 ++++++ .../invalid-dots/actual.js | 1 + .../invalid-dots/options.json | 3 + .../invalid-new-target/actual.js | 1 + .../invalid-new-target/expected.json | 129 ++++ .../invalid-new-target/options.json | 3 + .../new-new-target/actual.js | 3 + .../new-new-target/expected.json | 162 +++++ .../new-target-declaration/actual.js | 3 + .../new-target-declaration/expected.json | 146 +++++ .../new-target-expression/actual.js | 1 + .../new-target-expression/expected.json | 180 ++++++ .../new-target-invoke/actual.js | 3 + .../new-target-invoke/expected.json | 162 +++++ .../new-target-precedence/actual.js | 3 + .../new-target-precedence/expected.json | 178 ++++++ .../unknown-property/actual.js | 1 + .../unknown-property/options.json | 3 + .../migrated_0000/actual.js | 1 + .../migrated_0000/expected.json | 167 +++++ .../migrated_0001/actual.js | 1 + .../migrated_0001/expected.json | 184 ++++++ .../migrated_0002/actual.js | 1 + .../migrated_0002/expected.json | 169 ++++++ .../migrated_0003/actual.js | 1 + .../migrated_0003/expected.json | 167 +++++ .../migrated_0004/actual.js | 1 + .../migrated_0004/expected.json | 167 +++++ .../actual.js | 1 + .../options.json | 3 + .../actual.js | 1 + .../options.json | 3 + .../actual.js | 1 + .../expected.json | 170 ++++++ .../options.json | 3 + .../invalid-proto-identifiers/actual.js | 1 + .../invalid-proto-identifiers/options.json | 3 + .../actual.js | 1 + .../options.json | 3 + .../invalid-proto-literal-shorthand/actual.js | 1 + .../expected.json | 172 ++++++ .../options.json | 3 + .../invalid-proto-literals/actual.js | 1 + .../invalid-proto-literals/options.json | 3 + .../actual.js | 1 + .../options.json | 3 + .../actual.js | 1 + .../expected.json | 170 ++++++ .../options.json | 3 + .../invalid-proto-shorthand-literal/actual.js | 1 + .../expected.json | 172 ++++++ .../options.json | 3 + .../invalid-proto-shorthands/actual.js | 1 + .../invalid-proto-shorthands/expected.json | 168 ++++++ .../invalid-proto-shorthands/options.json | 3 + .../proto-identifier-getter-setter/actual.js | 1 + .../expected.json | 276 +++++++++ .../proto-identifier-getter/actual.js | 1 + .../proto-identifier-getter/expected.json | 189 ++++++ .../proto-identifier-method/actual.js | 1 + .../proto-identifier-method/expected.json | 189 ++++++ .../proto-identifier-setter/actual.js | 1 + .../proto-identifier-setter/expected.json | 206 +++++++ .../proto-literal-getter-setter/actual.js | 1 + .../proto-literal-getter-setter/expected.json | 278 +++++++++ .../proto-literal-getter/actual.js | 1 + .../proto-literal-getter/expected.json | 191 ++++++ .../proto-literal-method/actual.js | 1 + .../proto-literal-method/expected.json | 191 ++++++ .../proto-literal-setter/actual.js | 1 + .../proto-literal-setter/expected.json | 208 +++++++ .../migrated_0000/actual.js | 1 + .../migrated_0000/expected.json | 199 ++++++ .../es2015-object-pattern/elision/actual.js | 1 + .../elision/expected.json | 152 +++++ .../empty-catch-param/actual.js | 1 + .../empty-catch-param/expected.json | 113 ++++ .../es2015-object-pattern/empty-fn/actual.js | 1 + .../empty-fn/expected.json | 100 +++ .../empty-for-lex/actual.js | 1 + .../empty-for-lex/expected.json | 131 ++++ .../empty-lexical/actual.js | 1 + .../empty-lexical/expected.json | 100 +++ .../es2015-object-pattern/empty-var/actual.js | 1 + .../empty-var/expected.json | 100 +++ .../es2015-object-pattern/nested/actual.js | 1 + .../nested/expected.json | 152 +++++ .../properties/actual.js | 1 + .../properties/expected.json | 439 ++++++++++++++ .../migrated_0000/actual.js | 1 + .../migrated_0000/expected.json | 66 ++ .../migrated_0001/actual.js | 1 + .../migrated_0001/expected.json | 66 ++ .../migrated_0002/actual.js | 1 + .../migrated_0002/expected.json | 150 +++++ .../migrated_0003/actual.js | 1 + .../migrated_0003/expected.json | 66 ++ .../migrated_0004/actual.js | 1 + .../migrated_0004/expected.json | 66 ++ .../migrated_0005/actual.js | 1 + .../migrated_0005/expected.json | 66 ++ .../migrated_0006/actual.js | 1 + .../migrated_0006/expected.json | 150 +++++ .../function-declaration/actual.js | 1 + .../function-declaration/expected.json | 131 ++++ .../function-expression/actual.js | 1 + .../function-expression/expected.json | 163 +++++ .../object-method/actual.js | 1 + .../object-method/expected.json | 215 +++++++ .../object-shorthand-method/actual.js | 1 + .../object-shorthand-method/expected.json | 199 ++++++ .../call-multi-spread/actual.js | 1 + .../call-multi-spread/expected.json | 174 ++++++ .../call-spread-default/actual.js | 1 + .../call-spread-default/expected.json | 160 +++++ .../call-spread-first/actual.js | 1 + .../call-spread-first/expected.json | 144 +++++ .../call-spread-number/actual.js | 1 + .../call-spread-number/expected.json | 114 ++++ .../call-spread/actual.js | 1 + .../call-spread/expected.json | 112 ++++ .../invalid-call-dot-dot/actual.js | 1 + .../invalid-call-dot-dot/options.json | 3 + .../invalid-call-dots/actual.js | 1 + .../invalid-call-dots/options.json | 3 + .../invalid-call-spreads/actual.js | 1 + .../invalid-call-spreads/options.json | 3 + .../invalid-new-dot-dot/actual.js | 1 + .../invalid-new-dot-dot/options.json | 3 + .../invalid-new-dots/actual.js | 1 + .../invalid-new-dots/options.json | 3 + .../invalid-new-spreads/actual.js | 1 + .../invalid-new-spreads/options.json | 3 + .../new-multi-spread/actual.js | 1 + .../new-multi-spread/expected.json | 174 ++++++ .../new-spread-default/actual.js | 1 + .../new-spread-default/expected.json | 160 +++++ .../new-spread-first/actual.js | 1 + .../new-spread-first/expected.json | 144 +++++ .../new-spread-number/actual.js | 1 + .../new-spread-number/expected.json | 114 ++++ .../new-spread/actual.js | 1 + .../new-spread/expected.json | 112 ++++ .../arrow_super/actual.js | 5 + .../arrow_super/expected.json | 232 +++++++ .../constructor_super/actual.js | 5 + .../constructor_super/expected.json | 213 +++++++ .../invalid_super_access/actual.js | 5 + .../invalid_super_access/options.json | 3 + .../invalid_super_id/actual.js | 3 + .../invalid_super_id/expected.json | 232 +++++++ .../invalid_super_id/options.json | 3 + .../actual.js | 1 + .../options.json | 3 + .../es2015-super-property/new_super/actual.js | 5 + .../new_super/expected.json | 245 ++++++++ .../super_computed/actual.js | 5 + .../super_computed/expected.json | 231 +++++++ .../super_member/actual.js | 5 + .../super_member/expected.json | 229 +++++++ .../after-switch/actual.js | 1 + .../after-switch/options.json | 3 + .../dollar-sign/actual.js | 1 + .../dollar-sign/expected.json | 86 +++ .../escape-sequences/actual.js | 1 + .../escape-sequences/expected.json | 100 +++ .../invalid-escape/actual.js | 1 + .../invalid-escape/options.json | 3 + .../line-terminators/actual.js | 1 + .../line-terminators/expected.json | 100 +++ .../literal-escape-sequences/actual.js | 1 + .../literal-escape-sequences/expected.json | 100 +++ .../new-expression/actual.js | 1 + .../new-expression/expected.json | 133 ++++ .../octal-literal/actual.js | 1 + .../octal-literal/expected.json | 86 +++ .../octal-literal/options.json | 3 + .../strict-octal-literal/actual.js | 1 + .../strict-octal-literal/expected.json | 119 ++++ .../strict-octal-literal/options.json | 3 + .../tagged-interpolation/actual.js | 1 + .../tagged-interpolation/expected.json | 154 +++++ .../actual.js | 1 + .../expected.json | 267 ++++++++ .../es2015-template-literals/tagged/actual.js | 1 + .../tagged/expected.json | 117 ++++ .../unclosed-interpolation/actual.js | 1 + .../unclosed-interpolation/options.json | 3 + .../unclosed-nested/actual.js | 1 + .../unclosed-nested/options.json | 3 + .../unclosed/actual.js | 1 + .../unclosed/options.json | 3 + .../untagged/actual.js | 1 + .../untagged/expected.json | 86 +++ .../migrated_0000/actual.js | 1 + .../migrated_0000/expected.json | 100 +++ .../migrated_0001/actual.js | 1 + .../migrated_0001/expected.json | 100 +++ .../migrated_0002/actual.js | 1 + .../migrated_0002/expected.json | 100 +++ .../invalid-yield-binding-property/actual.js | 1 + .../options.json | 3 + .../invalid-yield-expression/actual.js | 1 + .../invalid-yield-expression/options.json | 3 + .../actual.js | 1 + .../expected.json | 200 ++++++ .../options.json | 3 + .../actual.js | 1 + .../options.json | 3 + .../actual.js | 1 + .../options.json | 3 + .../invalid-yield-generator-catch/actual.js | 1 + .../expected.json | 164 +++++ .../options.json | 3 + .../actual.js | 1 + .../options.json | 3 + .../actual.js | 1 + .../options.json | 3 + .../actual.js | 1 + .../expected.json | 99 +++ .../options.json | 3 + .../actual.js | 1 + .../expected.json | 101 ++++ .../options.json | 3 + .../actual.js | 1 + .../expected.json | 132 ++++ .../options.json | 3 + .../actual.js | 1 + .../options.json | 3 + .../actual.js | 1 + .../options.json | 3 + .../actual.js | 1 + .../options.json | 3 + .../actual.js | 1 + .../expected.json | 100 +++ .../options.json | 3 + .../invalid-yield-generator-rest/actual.js | 1 + .../expected.json | 163 +++++ .../invalid-yield-generator-rest/options.json | 3 + .../actual.js | 1 + .../options.json | 3 + .../actual.js | 1 + .../options.json | 3 + .../actual.js | 1 + .../expected.json | 134 +++++ .../options.json | 3 + .../actual.js | 1 + .../options.json | 3 + .../actual.js | 1 + .../expected.json | 164 +++++ .../options.json | 3 + .../actual.js | 1 + .../options.json | 3 + .../actual.js | 1 + .../options.json | 3 + .../actual.js | 1 + .../options.json | 3 + .../actual.js | 1 + .../options.json | 3 + .../actual.js | 1 + .../expected.json | 117 ++++ .../options.json | 3 + .../actual.js | 1 + .../expected.json | 133 ++++ .../options.json | 3 + .../invalid-yield-strict-identifier/actual.js | 1 + .../options.json | 3 + .../actual.js | 1 + .../options.json | 3 + .../actual.js | 1 + .../options.json | 3 + .../actual.js | 1 + .../options.json | 3 + .../yield-array-pattern/actual.js | 1 + .../yield-array-pattern/expected.json | 114 ++++ .../yield-arrow-concise-body/actual.js | 1 + .../yield-arrow-concise-body/expected.json | 132 ++++ .../yield-arrow-function-body/actual.js | 1 + .../yield-arrow-function-body/expected.json | 164 +++++ .../yield-arrow-parameter-default/actual.js | 1 + .../expected.json | 131 ++++ .../yield-arrow-parameter-name/actual.js | 1 + .../yield-arrow-parameter-name/expected.json | 102 ++++ .../yield-binding-element/actual.js | 1 + .../yield-binding-element/expected.json | 150 +++++ .../yield-binding-property/actual.js | 1 + .../yield-binding-property/expected.json | 150 +++++ .../yield-call-expression-property/actual.js | 1 + .../expected.json | 163 +++++ .../yield-catch-parameter/actual.js | 1 + .../yield-catch-parameter/expected.json | 113 ++++ .../yield-expression-precedence/actual.js | 1 + .../yield-expression-precedence/expected.json | 260 ++++++++ .../actual.js | 1 + .../expected.json | 100 +++ .../yield-function-declaration/actual.js | 1 + .../yield-function-declaration/expected.json | 83 +++ .../actual.js | 1 + .../expected.json | 101 ++++ .../yield-function-expression/actual.js | 1 + .../yield-function-expression/expected.json | 99 +++ .../actual.js | 1 + .../expected.json | 183 ++++++ .../yield-generator-arrow-default/actual.js | 1 + .../expected.json | 183 ++++++ .../actual.js | 1 + .../expected.json | 215 +++++++ .../yield-generator-declaration/actual.js | 1 + .../yield-generator-declaration/expected.json | 83 +++ .../actual.js | 1 + .../expected.json | 131 ++++ .../actual.js | 1 + .../actual.js | 1 + .../expected.json | 185 ++++++ .../yield-generator-method/actual.js | 1 + .../yield-generator-method/expected.json | 136 +++++ .../actual.js | 1 + .../expected.json | 152 +++++ .../yield-lexical-declaration/actual.js | 1 + .../yield-lexical-declaration/expected.json | 100 +++ .../actual.js | 1 + .../expected.json | 163 +++++ .../es2015-yield/yield-method/actual.js | 1 + .../es2015-yield/yield-method/expected.json | 136 +++++ .../yield-parameter-object-pattern/actual.js | 1 + .../expected.json | 152 +++++ .../yield-rest-parameter/actual.js | 1 + .../yield-rest-parameter/expected.json | 115 ++++ .../yield-strict-binding-property/actual.js | 1 + .../expected.json | 183 ++++++ .../yield-strict-method/actual.js | 1 + .../yield-strict-method/expected.json | 169 ++++++ .../yield-super-property/actual.js | 1 + .../yield-super-property/expected.json | 229 +++++++ .../yield-variable-declaration/actual.js | 1 + .../yield-variable-declaration/expected.json | 83 +++ .../yield-yield-expression-delegate/actual.js | 1 + .../expected.json | 132 ++++ .../yield-yield-expression/actual.js | 1 + .../yield-yield-expression/expected.json | 132 ++++ .../migrated_0000/actual.js | 1 + .../migrated_0000/expected.json | 96 +++ .../migrated_0001/actual.js | 1 + .../migrated_0001/expected.json | 96 +++ .../migrated_0002/actual.js | 1 + .../migrated_0002/expected.json | 100 +++ .../migrated_0000/actual.js | 1 + .../migrated_0000/expected.json | 98 +++ .../migrated_0001/actual.js | 1 + .../migrated_0001/expected.json | 98 +++ .../migrated_0002/actual.js | 1 + .../migrated_0002/expected.json | 98 +++ .../migrated_0003/actual.js | 1 + .../migrated_0003/expected.json | 98 +++ .../migrated_0004/actual.js | 1 + .../migrated_0004/expected.json | 98 +++ .../migrated_0005/actual.js | 1 + .../migrated_0005/expected.json | 98 +++ .../migrated_0006/actual.js | 1 + .../migrated_0006/expected.json | 98 +++ .../migrated_0007/actual.js | 1 + .../migrated_0007/expected.json | 98 +++ .../migrated_0008/actual.js | 1 + .../migrated_0008/expected.json | 98 +++ .../migrated_0009/actual.js | 1 + .../migrated_0009/expected.json | 98 +++ .../migrated_0010/actual.js | 1 + .../migrated_0010/expected.json | 98 +++ .../migrated_0011/actual.js | 1 + .../migrated_0011/expected.json | 98 +++ .../migrated_0012/actual.js | 1 + .../migrated_0012/expected.json | 98 +++ .../migrated_0013/actual.js | 1 + .../migrated_0013/expected.json | 98 +++ .../migrated_0000/actual.js | 1 + .../migrated_0000/expected.json | 96 +++ .../migrated_0001/actual.js | 1 + .../migrated_0001/expected.json | 96 +++ .../migrated_0002/actual.js | 1 + .../migrated_0002/expected.json | 96 +++ .../migrated_0000/actual.js | 1 + .../migrated_0000/expected.json | 96 +++ .../migrated_0001/actual.js | 1 + .../migrated_0001/expected.json | 96 +++ .../migrated_0002/actual.js | 1 + .../migrated_0002/expected.json | 128 ++++ .../migrated_0003/actual.js | 1 + .../migrated_0003/expected.json | 128 ++++ .../migrated_0004/actual.js | 1 + .../migrated_0004/expected.json | 128 ++++ .../migrated_0005/actual.js | 1 + .../migrated_0005/expected.json | 128 ++++ .../expression-binary/migrated_0000/actual.js | 1 + .../migrated_0000/expected.json | 128 ++++ .../expression-binary/migrated_0001/actual.js | 1 + .../migrated_0001/expected.json | 128 ++++ .../expression-binary/migrated_0002/actual.js | 1 + .../migrated_0002/expected.json | 128 ++++ .../expression-binary/migrated_0003/actual.js | 1 + .../migrated_0003/expected.json | 128 ++++ .../expression-binary/migrated_0004/actual.js | 1 + .../migrated_0004/expected.json | 128 ++++ .../expression-binary/migrated_0005/actual.js | 1 + .../migrated_0005/expected.json | 128 ++++ .../expression-binary/migrated_0006/actual.js | 1 + .../migrated_0006/expected.json | 128 ++++ .../expression-binary/migrated_0007/actual.js | 1 + .../migrated_0007/expected.json | 128 ++++ .../expression-binary/migrated_0008/actual.js | 1 + .../migrated_0008/expected.json | 128 ++++ .../expression-binary/migrated_0009/actual.js | 1 + .../migrated_0009/expected.json | 128 ++++ .../expression-binary/migrated_0010/actual.js | 1 + .../migrated_0010/expected.json | 128 ++++ .../expression-binary/migrated_0011/actual.js | 1 + .../migrated_0011/expected.json | 128 ++++ .../expression-binary/migrated_0012/actual.js | 1 + .../migrated_0012/expected.json | 128 ++++ .../expression-binary/migrated_0013/actual.js | 1 + .../migrated_0013/expected.json | 128 ++++ .../expression-binary/migrated_0014/actual.js | 1 + .../migrated_0014/expected.json | 128 ++++ .../expression-binary/migrated_0015/actual.js | 1 + .../migrated_0015/expected.json | 128 ++++ .../expression-binary/migrated_0016/actual.js | 1 + .../migrated_0016/expected.json | 128 ++++ .../expression-binary/migrated_0017/actual.js | 1 + .../migrated_0017/expected.json | 128 ++++ .../migrated_0000/actual.js | 1 + .../migrated_0000/expected.json | 96 +++ .../migrated_0001/actual.js | 1 + .../migrated_0001/expected.json | 96 +++ .../migrated_0002/actual.js | 1 + .../migrated_0002/expected.json | 96 +++ .../migrated_0000/actual.js | 1 + .../migrated_0000/expected.json | 384 ++++++++++++ .../migrated_0000/actual.js | 1 + .../migrated_0000/expected.json | 115 ++++ .../migrated_0001/actual.js | 1 + .../migrated_0001/expected.json | 147 +++++ .../migrated_0002/actual.js | 1 + .../migrated_0002/expected.json | 150 +++++ .../migrated_0000/actual.js | 1 + .../migrated_0000/expected.json | 96 +++ .../migrated_0001/actual.js | 1 + .../migrated_0001/expected.json | 96 +++ .../migrated_0002/actual.js | 1 + .../migrated_0002/expected.json | 96 +++ .../migrated_0003/actual.js | 1 + .../migrated_0003/expected.json | 96 +++ .../migrated_0000/actual.js | 1 + .../migrated_0000/expected.json | 136 +++++ .../migrated_0001/actual.js | 1 + .../migrated_0001/expected.json | 135 +++++ .../migrated_0000/actual.js | 1 + .../migrated_0000/expected.json | 80 +++ .../migrated_0001/actual.js | 1 + .../migrated_0001/expected.json | 80 +++ .../migrated_0002/actual.js | 1 + .../migrated_0002/expected.json | 96 +++ .../migrated_0003/actual.js | 1 + .../migrated_0003/expected.json | 96 +++ .../migrated_0004/actual.js | 1 + .../migrated_0004/expected.json | 128 ++++ .../migrated_0005/actual.js | 1 + .../migrated_0005/expected.json | 112 ++++ .../migrated_0006/actual.js | 1 + .../migrated_0006/expected.json | 112 ++++ .../migrated_0007/actual.js | 1 + .../migrated_0007/expected.json | 129 ++++ .../migrated_0008/actual.js | 1 + .../migrated_0008/expected.json | 113 ++++ .../migrated_0009/actual.js | 1 + .../migrated_0009/expected.json | 81 +++ .../migrated_0010/actual.js | 1 + .../migrated_0010/expected.json | 96 +++ .../migrated_0011/actual.js | 1 + .../migrated_0011/expected.json | 128 ++++ .../migrated_0012/actual.js | 1 + .../migrated_0012/expected.json | 160 +++++ .../migrated_0013/actual.js | 1 + .../migrated_0013/expected.json | 129 ++++ .../migrated_0014/actual.js | 1 + .../migrated_0014/expected.json | 96 +++ .../migrated_0015/actual.js | 1 + .../migrated_0015/expected.json | 130 ++++ .../migrated_0016/actual.js | 1 + .../migrated_0016/expected.json | 131 ++++ .../migrated_0017/actual.js | 1 + .../migrated_0017/expected.json | 234 ++++++++ .../migrated_0018/actual.js | 1 + .../migrated_0018/expected.json | 195 ++++++ .../migrated_0019/actual.js | 1 + .../migrated_0019/expected.json | 96 +++ .../migrated_0020/actual.js | 1 + .../migrated_0020/expected.json | 96 +++ .../migrated_0021/actual.js | 1 + .../migrated_0021/expected.json | 96 +++ .../migrated_0022/actual.js | 1 + .../migrated_0022/expected.json | 96 +++ .../migrated_0000/actual.js | 1 + .../migrated_0000/expected.json | 96 +++ .../migrated_0001/actual.js | 1 + .../migrated_0001/expected.json | 96 +++ .../migrated_0002/actual.js | 1 + .../migrated_0002/expected.json | 96 +++ .../migrated_0000/actual.js | 1 + .../migrated_0000/expected.json | 81 +++ .../migrated_0001/actual.js | 1 + .../migrated_0001/expected.json | 81 +++ .../migrated_0002/actual.js | 1 + .../migrated_0002/expected.json | 81 +++ .../migrated_0003/actual.js | 1 + .../migrated_0003/expected.json | 81 +++ .../migrated_0004/actual.js | 1 + .../migrated_0004/expected.json | 81 +++ .../migrated_0005/actual.js | 1 + .../migrated_0005/expected.json | 81 +++ .../expression-primary/array/expected.json | 32 + .../expression-primary/array/migrated_0000.js | 1 + .../expression-primary/array/migrated_0001.js | 1 + .../expression-primary/array/migrated_0002.js | 1 + .../expression-primary/array/migrated_0003.js | 1 + .../expression-primary/array/migrated_0004.js | 1 + .../expression-primary/array/migrated_0005.js | 1 + .../expression-primary/array/migrated_0006.js | 1 + .../expression-primary/array/migrated_0007.js | 1 + .../array/migrated_0008.source.js | 1 + .../array/migrated_0009.source.js | 1 + .../array/migrated_0010.source.js | 1 + .../array/migrated_0011.source.js | 1 + .../array/migrated_0012.source.js | 1 + .../expression-primary/literal/expected.json | 32 + .../literal/numeric/migrated_0000.js | 1 + .../literal/numeric/migrated_0001.js | 1 + .../literal/numeric/migrated_0002.js | 1 + .../literal/numeric/migrated_0003.js | 1 + .../literal/numeric/migrated_0004.js | 1 + .../literal/numeric/migrated_0005.js | 1 + .../literal/numeric/migrated_0006.js | 1 + .../literal/numeric/migrated_0007.js | 1 + .../literal/numeric/migrated_0008.js | 1 + .../literal/numeric/migrated_0009.js | 1 + .../literal/numeric/migrated_0010.js | 1 + .../literal/numeric/migrated_0011.js | 1 + .../literal/numeric/migrated_0012.js | 1 + .../literal/numeric/migrated_0013.js | 1 + .../literal/numeric/migrated_0014.js | 1 + .../literal/numeric/migrated_0015.js | 1 + .../literal/numeric/migrated_0016.js | 1 + .../literal/numeric/migrated_0017.js | 1 + .../literal/numeric/migrated_0018.js | 1 + .../literal/numeric/migrated_0019.js | 1 + .../literal/numeric/migrated_0020.js | 1 + .../literal/numeric/migrated_0021.js | 1 + .../literal/numeric/migrated_0022.js | 1 + .../literal/numeric/migrated_0023.js | 1 + .../literal/numeric/migrated_0024.js | 1 + .../regular-expression/migrated_0000.js | 1 + .../regular-expression/migrated_0001.js | 1 + .../regular-expression/migrated_0002.js | 1 + .../regular-expression/migrated_0003.js | 1 + .../regular-expression/migrated_0004.js | 1 + .../migrated_0005.source.js | 1 + .../migrated_0006.failure.json | 6 + .../migrated_0006.source.js | 1 + .../regular-expression/migrated_0007.js | 1 + .../regular-expression/migrated_0008.js | 1 + .../regular-expression/migrated_0009.js | 1 + .../regular-expression/migrated_0010.js | 1 + .../regular-expression/migrated_0011.js | 1 + .../regular-expression/migrated_0012.js | 1 + .../regular-expression/migrated_0013.js | 1 + .../u-flag-invalid-range-4-hex.failure.json | 6 + .../u-flag-invalid-range-4-hex.js | 1 + .../u-flag-invalid-range-var-hex.failure.json | 6 + .../u-flag-invalid-range-var-hex.js | 1 + .../u-flag-surrogate-pair.js | 1 + .../regular-expression/u-flag-valid-range.js | 1 + .../literal/string/migrated_0000.js | 1 + .../literal/string/migrated_0001.js | 1 + .../literal/string/migrated_0002.source.js | 1 + .../literal/string/migrated_0003.js | 1 + .../literal/string/migrated_0006.js | 1 + .../literal/string/migrated_0007.js | 2 + .../literal/string/migrated_0008.js | 1 + .../literal/string/migrated_0009.js | 1 + .../literal/string/migrated_0010.js | 1 + .../literal/string/migrated_0011.js | 1 + .../literal/string/migrated_0012.js | 1 + .../literal/string/migrated_0013.js | 1 + .../literal/string/migrated_0015.js | 1 + .../literal/string/migrated_0016.js | 1 + .../literal/string/migrated_0017.js | 2 + .../literal/string/migrated_0018.js | 1 + .../expression-primary/object/expected.json | 32 + .../object/migrated_0000.js | 1 + .../object/migrated_0001.js | 1 + .../object/migrated_0002.js | 1 + .../object/migrated_0003.js | 1 + .../object/migrated_0004.js | 1 + .../object/migrated_0005.js | 1 + .../object/migrated_0006.js | 1 + .../object/migrated_0007.js | 1 + .../object/migrated_0008.js | 1 + .../object/migrated_0009.js | 1 + .../object/migrated_0010.js | 1 + .../object/migrated_0011.js | 1 + .../object/migrated_0012.js | 1 + .../object/migrated_0013.js | 1 + .../object/migrated_0014.js | 1 + .../object/migrated_0015.js | 1 + .../object/migrated_0016.js | 1 + .../object/migrated_0017.js | 1 + .../object/migrated_0018.js | 1 + .../object/migrated_0019.js | 1 + .../object/migrated_0020.js | 1 + .../object/migrated_0021.js | 1 + .../object/migrated_0022.js | 1 + .../object/migrated_0023.js | 1 + .../object/migrated_0024.js | 1 + .../object/migrated_0025.js | 1 + .../object/migrated_0026.js | 1 + .../object/migrated_0027.js | 1 + .../object/migrated_0028.js | 1 + .../object/migrated_0029.js | 1 + .../object/migrated_0030.js | 1 + .../object/migrated_0031.js | 1 + .../object/migrated_0032.js | 1 + .../object/migrated_0033.js | 1 + .../object/migrated_0034.js | 1 + .../object/migrated_0035.js | 1 + .../object/migrated_0036.js | 1 + .../object/migrated_0037.js | 1 + .../object/migrated_0038.js | 1 + .../expression-primary/other/expected.json | 32 + .../expression-primary/other/migrated_0000.js | 1 + .../expression-primary/other/migrated_0001.js | 1 + .../expression-primary/other/migrated_0002.js | 3 + .../expression-primary/other/migrated_0003.js | 1 + .../migrated_0000/actual.js | 1 + .../migrated_0000/expected.json | 96 +++ .../migrated_0001/actual.js | 1 + .../migrated_0001/expected.json | 96 +++ .../migrated_0002/actual.js | 1 + .../migrated_0002/expected.json | 96 +++ .../migrated_0003/actual.js | 1 + .../migrated_0003/expected.json | 96 +++ .../migrated_0004/actual.js | 1 + .../migrated_0004/expected.json | 96 +++ .../migrated_0005/actual.js | 1 + .../migrated_0005/expected.json | 96 +++ .../migrated_0006/actual.js | 1 + .../migrated_0006/expected.json | 128 ++++ .../expression-unary/migrated_0000/actual.js | 1 + .../migrated_0000/expected.json | 81 +++ .../expression-unary/migrated_0001/actual.js | 1 + .../migrated_0001/expected.json | 81 +++ .../expression-unary/migrated_0002/actual.js | 1 + .../migrated_0002/expected.json | 81 +++ .../expression-unary/migrated_0003/actual.js | 1 + .../migrated_0003/expected.json | 81 +++ .../expression-unary/migrated_0004/actual.js | 1 + .../migrated_0004/expected.json | 81 +++ .../expression-unary/migrated_0005/actual.js | 1 + .../migrated_0005/expected.json | 81 +++ .../expression-unary/migrated_0006/actual.js | 1 + .../migrated_0006/expected.json | 81 +++ .../expression-unary/migrated_0007/actual.js | 1 + .../migrated_0007/expected.json | 81 +++ .../expression-unary/migrated_0008/actual.js | 1 + .../migrated_0008/expected.json | 81 +++ .../expression-unary/migrated_0009/actual.js | 1 + .../migrated_0009/expected.json | 81 +++ .../expression-unary/migrated_0010/actual.js | 1 + .../migrated_0010/expected.json | 81 +++ .../expression-unary/migrated_0011/actual.js | 1 + .../migrated_0011/expected.json | 81 +++ .../expression-unary/migrated_0012/actual.js | 1 + .../migrated_0012/expected.json | 81 +++ .../invalid-syntax/GH-1106-00/actual.js | 1 + .../invalid-syntax/GH-1106-00/options.json | 3 + .../invalid-syntax/GH-1106-01/actual.js | 1 + .../invalid-syntax/GH-1106-01/options.json | 3 + .../invalid-syntax/GH-1106-02/actual.js | 1 + .../invalid-syntax/GH-1106-02/options.json | 3 + .../invalid-syntax/GH-1106-03/actual.js | 1 + .../invalid-syntax/GH-1106-03/options.json | 3 + .../invalid-syntax/GH-1106-04/actual.js | 1 + .../invalid-syntax/GH-1106-04/options.json | 3 + .../invalid-syntax/GH-1106-05/actual.js | 1 + .../invalid-syntax/GH-1106-05/options.json | 3 + .../invalid-syntax/GH-1106-06/actual.js | 1 + .../invalid-syntax/GH-1106-06/options.json | 3 + .../invalid-syntax/GH-1106-07/actual.js | 1 + .../invalid-syntax/GH-1106-07/options.json | 3 + .../invalid-syntax/GH-1106-09/actual.js | 1 + .../invalid-syntax/GH-1106-09/expected.json | 66 ++ .../invalid-syntax/GH-1106-09/options.json | 3 + .../invalid-syntax/migrated_0000/actual.js | 1 + .../invalid-syntax/migrated_0000/options.json | 3 + .../invalid-syntax/migrated_0001/actual.js | 1 + .../invalid-syntax/migrated_0001/options.json | 3 + .../invalid-syntax/migrated_0002/actual.js | 1 + .../invalid-syntax/migrated_0002/options.json | 3 + .../invalid-syntax/migrated_0003/actual.js | 1 + .../invalid-syntax/migrated_0003/options.json | 3 + .../invalid-syntax/migrated_0004/actual.js | 1 + .../invalid-syntax/migrated_0004/options.json | 3 + .../invalid-syntax/migrated_0005/actual.js | 1 + .../invalid-syntax/migrated_0005/options.json | 3 + .../invalid-syntax/migrated_0006/actual.js | 1 + .../invalid-syntax/migrated_0006/options.json | 3 + .../invalid-syntax/migrated_0007/actual.js | 1 + .../invalid-syntax/migrated_0007/options.json | 3 + .../invalid-syntax/migrated_0008/actual.js | 1 + .../invalid-syntax/migrated_0008/options.json | 3 + .../invalid-syntax/migrated_0009/actual.js | 1 + .../invalid-syntax/migrated_0009/options.json | 3 + .../invalid-syntax/migrated_0010/actual.js | 1 + .../invalid-syntax/migrated_0010/options.json | 3 + .../invalid-syntax/migrated_0011/actual.js | 1 + .../invalid-syntax/migrated_0011/options.json | 3 + .../invalid-syntax/migrated_0012/actual.js | 1 + .../invalid-syntax/migrated_0012/options.json | 3 + .../invalid-syntax/migrated_0013/actual.js | 1 + .../invalid-syntax/migrated_0013/options.json | 3 + .../invalid-syntax/migrated_0014/actual.js | 1 + .../invalid-syntax/migrated_0014/options.json | 3 + .../invalid-syntax/migrated_0015/actual.js | 1 + .../invalid-syntax/migrated_0015/options.json | 3 + .../invalid-syntax/migrated_0016/actual.js | 1 + .../invalid-syntax/migrated_0016/options.json | 3 + .../invalid-syntax/migrated_0017/actual.js | 1 + .../invalid-syntax/migrated_0017/options.json | 3 + .../invalid-syntax/migrated_0018/actual.js | 1 + .../invalid-syntax/migrated_0018/options.json | 3 + .../invalid-syntax/migrated_0019/actual.js | 1 + .../invalid-syntax/migrated_0019/options.json | 3 + .../invalid-syntax/migrated_0020/actual.js | 1 + .../invalid-syntax/migrated_0020/options.json | 3 + .../invalid-syntax/migrated_0021/actual.js | 1 + .../invalid-syntax/migrated_0021/options.json | 3 + .../invalid-syntax/migrated_0022/actual.js | 1 + .../invalid-syntax/migrated_0022/options.json | 3 + .../invalid-syntax/migrated_0023/actual.js | 1 + .../invalid-syntax/migrated_0023/options.json | 3 + .../invalid-syntax/migrated_0024/actual.js | 1 + .../invalid-syntax/migrated_0024/options.json | 3 + .../invalid-syntax/migrated_0025/actual.js | 1 + .../invalid-syntax/migrated_0025/options.json | 3 + .../invalid-syntax/migrated_0026/actual.js | 1 + .../invalid-syntax/migrated_0026/options.json | 3 + .../invalid-syntax/migrated_0027/actual.js | 1 + .../invalid-syntax/migrated_0027/options.json | 3 + .../invalid-syntax/migrated_0028/actual.js | 1 + .../invalid-syntax/migrated_0028/options.json | 3 + .../invalid-syntax/migrated_0029/actual.js | 1 + .../invalid-syntax/migrated_0029/options.json | 3 + .../invalid-syntax/migrated_0030/actual.js | 1 + .../invalid-syntax/migrated_0030/options.json | 3 + .../invalid-syntax/migrated_0031/actual.js | 2 + .../invalid-syntax/migrated_0031/options.json | 3 + .../invalid-syntax/migrated_0032/actual.js | 1 + .../invalid-syntax/migrated_0032/options.json | 3 + .../invalid-syntax/migrated_0033/actual.js | 1 + .../migrated_0033/expected.json | 100 +++ .../invalid-syntax/migrated_0033/options.json | 3 + .../invalid-syntax/migrated_0034/actual.js | 1 + .../migrated_0034/expected.json | 100 +++ .../invalid-syntax/migrated_0034/options.json | 3 + .../invalid-syntax/migrated_0035/actual.js | 1 + .../invalid-syntax/migrated_0035/options.json | 3 + .../invalid-syntax/migrated_0036/actual.js | 1 + .../migrated_0036/expected.json | 100 +++ .../invalid-syntax/migrated_0036/options.json | 3 + .../invalid-syntax/migrated_0037/actual.js | 1 + .../migrated_0037/expected.json | 100 +++ .../invalid-syntax/migrated_0037/options.json | 3 + .../invalid-syntax/migrated_0038/actual.js | 1 + .../invalid-syntax/migrated_0038/options.json | 3 + .../invalid-syntax/migrated_0039/actual.js | 1 + .../invalid-syntax/migrated_0039/options.json | 3 + .../invalid-syntax/migrated_0040/actual.js | 2 + .../invalid-syntax/migrated_0040/options.json | 3 + .../invalid-syntax/migrated_0041/actual.js | 1 + .../migrated_0041/expected.json | 100 +++ .../invalid-syntax/migrated_0041/options.json | 3 + .../invalid-syntax/migrated_0042/actual.js | 1 + .../migrated_0042/expected.json | 100 +++ .../invalid-syntax/migrated_0042/options.json | 3 + .../invalid-syntax/migrated_0043/actual.js | 1 + .../migrated_0043/expected.json | 100 +++ .../invalid-syntax/migrated_0043/options.json | 3 + .../invalid-syntax/migrated_0044/actual.js | 1 + .../migrated_0044/expected.json | 100 +++ .../invalid-syntax/migrated_0044/options.json | 3 + .../invalid-syntax/migrated_0045/actual.js | 1 + .../invalid-syntax/migrated_0045/options.json | 3 + .../invalid-syntax/migrated_0046/actual.js | 1 + .../invalid-syntax/migrated_0046/options.json | 3 + .../invalid-syntax/migrated_0047/actual.js | 1 + .../invalid-syntax/migrated_0047/options.json | 3 + .../invalid-syntax/migrated_0048/actual.js | 1 + .../migrated_0048/expected.json | 100 +++ .../invalid-syntax/migrated_0048/options.json | 3 + .../invalid-syntax/migrated_0049/actual.js | 1 + .../migrated_0049/expected.json | 100 +++ .../invalid-syntax/migrated_0049/options.json | 3 + .../invalid-syntax/migrated_0050/actual.js | 1 + .../migrated_0050/expected.json | 100 +++ .../invalid-syntax/migrated_0050/options.json | 3 + .../invalid-syntax/migrated_0051/actual.js | 1 + .../migrated_0051/expected.json | 100 +++ .../invalid-syntax/migrated_0051/options.json | 3 + .../invalid-syntax/migrated_0052/actual.js | 1 + .../invalid-syntax/migrated_0052/options.json | 3 + .../invalid-syntax/migrated_0053/actual.js | 1 + .../invalid-syntax/migrated_0053/options.json | 3 + .../invalid-syntax/migrated_0054/actual.js | 1 + .../invalid-syntax/migrated_0054/options.json | 3 + .../invalid-syntax/migrated_0055/actual.js | 1 + .../invalid-syntax/migrated_0055/options.json | 3 + .../invalid-syntax/migrated_0056/actual.js | 1 + .../invalid-syntax/migrated_0056/options.json | 3 + .../invalid-syntax/migrated_0057/actual.js | 1 + .../invalid-syntax/migrated_0057/options.json | 3 + .../invalid-syntax/migrated_0058/actual.js | 1 + .../invalid-syntax/migrated_0058/options.json | 3 + .../invalid-syntax/migrated_0059/actual.js | 1 + .../invalid-syntax/migrated_0059/options.json | 3 + .../invalid-syntax/migrated_0060/actual.js | 1 + .../invalid-syntax/migrated_0060/options.json | 3 + .../invalid-syntax/migrated_0061/actual.js | 1 + .../invalid-syntax/migrated_0061/options.json | 3 + .../invalid-syntax/migrated_0062/actual.js | 2 + .../invalid-syntax/migrated_0062/options.json | 3 + .../invalid-syntax/migrated_0063/actual.js | 1 + .../invalid-syntax/migrated_0063/options.json | 3 + .../invalid-syntax/migrated_0064/actual.js | 1 + .../invalid-syntax/migrated_0064/options.json | 3 + .../invalid-syntax/migrated_0065/actual.js | 1 + .../invalid-syntax/migrated_0065/options.json | 3 + .../invalid-syntax/migrated_0066/actual.js | 1 + .../invalid-syntax/migrated_0066/options.json | 3 + .../invalid-syntax/migrated_0067/actual.js | 1 + .../invalid-syntax/migrated_0067/options.json | 3 + .../invalid-syntax/migrated_0068/actual.js | 1 + .../invalid-syntax/migrated_0068/options.json | 3 + .../invalid-syntax/migrated_0069/actual.js | 1 + .../invalid-syntax/migrated_0069/options.json | 3 + .../invalid-syntax/migrated_0070/actual.js | 3 + .../invalid-syntax/migrated_0070/options.json | 3 + .../invalid-syntax/migrated_0071/actual.js | 1 + .../invalid-syntax/migrated_0071/options.json | 3 + .../invalid-syntax/migrated_0072/actual.js | 1 + .../invalid-syntax/migrated_0072/options.json | 3 + .../invalid-syntax/migrated_0073/actual.js | 1 + .../invalid-syntax/migrated_0073/options.json | 3 + .../invalid-syntax/migrated_0074/actual.js | 1 + .../invalid-syntax/migrated_0074/options.json | 3 + .../invalid-syntax/migrated_0075/actual.js | 1 + .../invalid-syntax/migrated_0075/options.json | 3 + .../invalid-syntax/migrated_0076/actual.js | 1 + .../invalid-syntax/migrated_0076/options.json | 3 + .../invalid-syntax/migrated_0077/actual.js | 1 + .../invalid-syntax/migrated_0077/options.json | 3 + .../invalid-syntax/migrated_0078/actual.js | 1 + .../invalid-syntax/migrated_0078/options.json | 3 + .../invalid-syntax/migrated_0080/actual.js | 1 + .../invalid-syntax/migrated_0080/options.json | 3 + .../invalid-syntax/migrated_0081/actual.js | 1 + .../invalid-syntax/migrated_0081/options.json | 3 + .../invalid-syntax/migrated_0082/actual.js | 1 + .../invalid-syntax/migrated_0082/options.json | 3 + .../invalid-syntax/migrated_0083/actual.js | 1 + .../invalid-syntax/migrated_0083/options.json | 3 + .../invalid-syntax/migrated_0084/actual.js | 1 + .../invalid-syntax/migrated_0084/options.json | 3 + .../invalid-syntax/migrated_0085/actual.js | 1 + .../invalid-syntax/migrated_0085/options.json | 3 + .../invalid-syntax/migrated_0086/actual.js | 1 + .../invalid-syntax/migrated_0086/options.json | 3 + .../invalid-syntax/migrated_0087/actual.js | 1 + .../invalid-syntax/migrated_0087/options.json | 3 + .../invalid-syntax/migrated_0088/actual.js | 1 + .../invalid-syntax/migrated_0088/options.json | 3 + .../invalid-syntax/migrated_0089/actual.js | 1 + .../invalid-syntax/migrated_0089/options.json | 3 + .../invalid-syntax/migrated_0090/actual.js | 1 + .../invalid-syntax/migrated_0090/options.json | 3 + .../invalid-syntax/migrated_0091/actual.js | 1 + .../invalid-syntax/migrated_0091/options.json | 3 + .../invalid-syntax/migrated_0092/actual.js | 1 + .../migrated_0092/expected.json | 118 ++++ .../invalid-syntax/migrated_0092/options.json | 3 + .../invalid-syntax/migrated_0093/actual.js | 1 + .../invalid-syntax/migrated_0093/options.json | 3 + .../invalid-syntax/migrated_0094/actual.js | 1 + .../invalid-syntax/migrated_0094/options.json | 3 + .../invalid-syntax/migrated_0095/actual.js | 1 + .../invalid-syntax/migrated_0095/options.json | 3 + .../invalid-syntax/migrated_0096/actual.js | 1 + .../invalid-syntax/migrated_0096/options.json | 3 + .../invalid-syntax/migrated_0097/actual.js | 1 + .../invalid-syntax/migrated_0097/options.json | 3 + .../invalid-syntax/migrated_0098/actual.js | 1 + .../invalid-syntax/migrated_0098/options.json | 3 + .../invalid-syntax/migrated_0099/actual.js | 1 + .../invalid-syntax/migrated_0099/options.json | 3 + .../invalid-syntax/migrated_0100/actual.js | 1 + .../invalid-syntax/migrated_0100/options.json | 3 + .../invalid-syntax/migrated_0101/actual.js | 1 + .../migrated_0101/expected.json | 167 +++++ .../invalid-syntax/migrated_0101/options.json | 3 + .../invalid-syntax/migrated_0102/actual.js | 1 + .../invalid-syntax/migrated_0102/options.json | 3 + .../invalid-syntax/migrated_0103/actual.js | 1 + .../invalid-syntax/migrated_0103/options.json | 3 + .../invalid-syntax/migrated_0104/actual.js | 1 + .../invalid-syntax/migrated_0104/options.json | 3 + .../invalid-syntax/migrated_0105/actual.js | 1 + .../invalid-syntax/migrated_0105/options.json | 3 + .../invalid-syntax/migrated_0106/actual.js | 1 + .../invalid-syntax/migrated_0106/options.json | 3 + .../invalid-syntax/migrated_0107/actual.js | 1 + .../invalid-syntax/migrated_0107/options.json | 3 + .../invalid-syntax/migrated_0108/actual.js | 1 + .../invalid-syntax/migrated_0108/options.json | 3 + .../invalid-syntax/migrated_0109/actual.js | 1 + .../invalid-syntax/migrated_0109/options.json | 3 + .../invalid-syntax/migrated_0110/actual.js | 1 + .../invalid-syntax/migrated_0110/options.json | 3 + .../invalid-syntax/migrated_0111/actual.js | 1 + .../invalid-syntax/migrated_0111/options.json | 3 + .../invalid-syntax/migrated_0112/actual.js | 1 + .../invalid-syntax/migrated_0112/options.json | 3 + .../invalid-syntax/migrated_0113/actual.js | 1 + .../invalid-syntax/migrated_0113/options.json | 3 + .../invalid-syntax/migrated_0114/actual.js | 1 + .../invalid-syntax/migrated_0114/options.json | 3 + .../invalid-syntax/migrated_0115/actual.js | 1 + .../invalid-syntax/migrated_0115/options.json | 3 + .../invalid-syntax/migrated_0116/actual.js | 1 + .../invalid-syntax/migrated_0116/options.json | 3 + .../invalid-syntax/migrated_0117/actual.js | 1 + .../invalid-syntax/migrated_0117/options.json | 3 + .../invalid-syntax/migrated_0118/actual.js | 1 + .../invalid-syntax/migrated_0118/options.json | 3 + .../invalid-syntax/migrated_0119/actual.js | 1 + .../invalid-syntax/migrated_0119/options.json | 3 + .../invalid-syntax/migrated_0120/actual.js | 1 + .../invalid-syntax/migrated_0120/options.json | 3 + .../invalid-syntax/migrated_0121/actual.js | 1 + .../invalid-syntax/migrated_0121/options.json | 3 + .../invalid-syntax/migrated_0122/actual.js | 1 + .../invalid-syntax/migrated_0122/options.json | 3 + .../invalid-syntax/migrated_0123/actual.js | 1 + .../invalid-syntax/migrated_0123/options.json | 3 + .../invalid-syntax/migrated_0124/actual.js | 1 + .../invalid-syntax/migrated_0124/options.json | 3 + .../invalid-syntax/migrated_0125/actual.js | 1 + .../invalid-syntax/migrated_0125/options.json | 3 + .../invalid-syntax/migrated_0126/actual.js | 1 + .../invalid-syntax/migrated_0126/options.json | 3 + .../invalid-syntax/migrated_0127/actual.js | 1 + .../invalid-syntax/migrated_0127/options.json | 3 + .../invalid-syntax/migrated_0128/actual.js | 1 + .../invalid-syntax/migrated_0128/options.json | 3 + .../invalid-syntax/migrated_0129/actual.js | 1 + .../invalid-syntax/migrated_0129/options.json | 3 + .../invalid-syntax/migrated_0130/actual.js | 1 + .../invalid-syntax/migrated_0130/options.json | 3 + .../invalid-syntax/migrated_0131/actual.js | 1 + .../invalid-syntax/migrated_0131/options.json | 3 + .../invalid-syntax/migrated_0132/actual.js | 1 + .../invalid-syntax/migrated_0132/options.json | 3 + .../invalid-syntax/migrated_0133/actual.js | 1 + .../invalid-syntax/migrated_0133/options.json | 3 + .../invalid-syntax/migrated_0134/actual.js | 1 + .../invalid-syntax/migrated_0134/options.json | 3 + .../invalid-syntax/migrated_0135/actual.js | 1 + .../invalid-syntax/migrated_0135/options.json | 3 + .../invalid-syntax/migrated_0136/actual.js | 1 + .../invalid-syntax/migrated_0136/options.json | 3 + .../invalid-syntax/migrated_0137/actual.js | 1 + .../migrated_0137/expected.json | 100 +++ .../invalid-syntax/migrated_0137/options.json | 3 + .../invalid-syntax/migrated_0138/actual.js | 1 + .../migrated_0138/expected.json | 132 ++++ .../invalid-syntax/migrated_0138/options.json | 3 + .../invalid-syntax/migrated_0139/actual.js | 1 + .../migrated_0139/expected.json | 132 ++++ .../invalid-syntax/migrated_0139/options.json | 3 + .../invalid-syntax/migrated_0140/actual.js | 1 + .../migrated_0140/expected.json | 83 +++ .../invalid-syntax/migrated_0140/options.json | 3 + .../invalid-syntax/migrated_0141/actual.js | 1 + .../invalid-syntax/migrated_0141/options.json | 3 + .../invalid-syntax/migrated_0142/actual.js | 1 + .../invalid-syntax/migrated_0142/options.json | 3 + .../invalid-syntax/migrated_0143/actual.js | 1 + .../invalid-syntax/migrated_0143/options.json | 3 + .../invalid-syntax/migrated_0144/actual.js | 1 + .../invalid-syntax/migrated_0144/options.json | 3 + .../invalid-syntax/migrated_0145/actual.js | 1 + .../invalid-syntax/migrated_0145/options.json | 3 + .../invalid-syntax/migrated_0146/actual.js | 1 + .../invalid-syntax/migrated_0146/options.json | 3 + .../invalid-syntax/migrated_0147/actual.js | 1 + .../invalid-syntax/migrated_0147/options.json | 3 + .../invalid-syntax/migrated_0148/actual.js | 3 + .../invalid-syntax/migrated_0148/options.json | 3 + .../invalid-syntax/migrated_0149/actual.js | 1 + .../invalid-syntax/migrated_0149/options.json | 3 + .../invalid-syntax/migrated_0150/actual.js | 1 + .../invalid-syntax/migrated_0150/options.json | 3 + .../invalid-syntax/migrated_0151/actual.js | 1 + .../invalid-syntax/migrated_0151/options.json | 3 + .../invalid-syntax/migrated_0152/actual.js | 1 + .../invalid-syntax/migrated_0152/options.json | 3 + .../invalid-syntax/migrated_0153/actual.js | 1 + .../invalid-syntax/migrated_0153/options.json | 3 + .../invalid-syntax/migrated_0154/actual.js | 1 + .../invalid-syntax/migrated_0154/options.json | 3 + .../invalid-syntax/migrated_0155/actual.js | 2 + .../invalid-syntax/migrated_0155/options.json | 3 + .../invalid-syntax/migrated_0156/actual.js | 2 + .../invalid-syntax/migrated_0156/options.json | 3 + .../invalid-syntax/migrated_0157/actual.js | 2 + .../invalid-syntax/migrated_0157/options.json | 3 + .../invalid-syntax/migrated_0158/actual.js | 2 + .../invalid-syntax/migrated_0158/options.json | 3 + .../invalid-syntax/migrated_0159/actual.js | 2 + .../invalid-syntax/migrated_0159/options.json | 3 + .../invalid-syntax/migrated_0160/actual.js | 2 + .../invalid-syntax/migrated_0160/options.json | 3 + .../invalid-syntax/migrated_0161/actual.js | 2 + .../invalid-syntax/migrated_0161/options.json | 3 + .../invalid-syntax/migrated_0162/actual.js | 1 + .../invalid-syntax/migrated_0162/options.json | 3 + .../invalid-syntax/migrated_0163/actual.js | 1 + .../migrated_0163/expected.json | 100 +++ .../invalid-syntax/migrated_0163/options.json | 3 + .../invalid-syntax/migrated_0164/actual.js | 1 + .../invalid-syntax/migrated_0164/options.json | 3 + .../invalid-syntax/migrated_0165/actual.js | 1 + .../migrated_0165/expected.json | 100 +++ .../invalid-syntax/migrated_0165/options.json | 3 + .../invalid-syntax/migrated_0166/actual.js | 1 + .../migrated_0166/expected.json | 100 +++ .../invalid-syntax/migrated_0166/options.json | 3 + .../invalid-syntax/migrated_0167/actual.js | 1 + .../migrated_0167/expected.json | 100 +++ .../invalid-syntax/migrated_0167/options.json | 3 + .../invalid-syntax/migrated_0168/actual.js | 1 + .../invalid-syntax/migrated_0168/options.json | 3 + .../invalid-syntax/migrated_0169/actual.js | 1 + .../migrated_0169/expected.json | 100 +++ .../invalid-syntax/migrated_0169/options.json | 3 + .../invalid-syntax/migrated_0170/actual.js | 1 + .../invalid-syntax/migrated_0170/options.json | 3 + .../invalid-syntax/migrated_0171/actual.js | 1 + .../invalid-syntax/migrated_0171/options.json | 3 + .../invalid-syntax/migrated_0172/actual.js | 1 + .../invalid-syntax/migrated_0172/options.json | 3 + .../invalid-syntax/migrated_0173/actual.js | 1 + .../invalid-syntax/migrated_0173/options.json | 3 + .../invalid-syntax/migrated_0174/actual.js | 1 + .../invalid-syntax/migrated_0174/options.json | 3 + .../invalid-syntax/migrated_0175/actual.js | 1 + .../invalid-syntax/migrated_0175/options.json | 3 + .../invalid-syntax/migrated_0176/actual.js | 1 + .../invalid-syntax/migrated_0176/options.json | 3 + .../invalid-syntax/migrated_0177/actual.js | 1 + .../invalid-syntax/migrated_0177/options.json | 3 + .../invalid-syntax/migrated_0178/actual.js | 1 + .../invalid-syntax/migrated_0178/options.json | 3 + .../invalid-syntax/migrated_0179/actual.js | 1 + .../invalid-syntax/migrated_0179/options.json | 3 + .../invalid-syntax/migrated_0180/actual.js | 1 + .../invalid-syntax/migrated_0180/options.json | 3 + .../invalid-syntax/migrated_0181/actual.js | 1 + .../invalid-syntax/migrated_0181/options.json | 3 + .../invalid-syntax/migrated_0182/actual.js | 1 + .../invalid-syntax/migrated_0182/options.json | 3 + .../invalid-syntax/migrated_0183/actual.js | 1 + .../invalid-syntax/migrated_0183/options.json | 3 + .../invalid-syntax/migrated_0184/actual.js | 1 + .../invalid-syntax/migrated_0184/options.json | 3 + .../invalid-syntax/migrated_0185/actual.js | 1 + .../invalid-syntax/migrated_0185/options.json | 3 + .../invalid-syntax/migrated_0186/actual.js | 1 + .../invalid-syntax/migrated_0186/options.json | 3 + .../invalid-syntax/migrated_0187/actual.js | 1 + .../invalid-syntax/migrated_0187/options.json | 3 + .../invalid-syntax/migrated_0188/actual.js | 1 + .../invalid-syntax/migrated_0188/options.json | 3 + .../invalid-syntax/migrated_0189/actual.js | 1 + .../invalid-syntax/migrated_0189/options.json | 3 + .../invalid-syntax/migrated_0190/actual.js | 1 + .../invalid-syntax/migrated_0190/options.json | 3 + .../invalid-syntax/migrated_0191/actual.js | 1 + .../invalid-syntax/migrated_0191/options.json | 3 + .../invalid-syntax/migrated_0192/actual.js | 1 + .../invalid-syntax/migrated_0192/options.json | 3 + .../invalid-syntax/migrated_0193/actual.js | 1 + .../invalid-syntax/migrated_0193/options.json | 3 + .../invalid-syntax/migrated_0194/actual.js | 1 + .../invalid-syntax/migrated_0194/options.json | 3 + .../invalid-syntax/migrated_0195/actual.js | 1 + .../invalid-syntax/migrated_0195/options.json | 3 + .../invalid-syntax/migrated_0196/actual.js | 1 + .../invalid-syntax/migrated_0196/options.json | 3 + .../invalid-syntax/migrated_0197/actual.js | 1 + .../invalid-syntax/migrated_0197/options.json | 3 + .../invalid-syntax/migrated_0198/actual.js | 1 + .../invalid-syntax/migrated_0198/options.json | 3 + .../invalid-syntax/migrated_0199/actual.js | 1 + .../invalid-syntax/migrated_0199/options.json | 3 + .../invalid-syntax/migrated_0200/actual.js | 1 + .../invalid-syntax/migrated_0200/options.json | 3 + .../invalid-syntax/migrated_0201/actual.js | 1 + .../migrated_0201/expected.json | 117 ++++ .../invalid-syntax/migrated_0201/options.json | 3 + .../invalid-syntax/migrated_0202/actual.js | 1 + .../migrated_0202/expected.json | 117 ++++ .../invalid-syntax/migrated_0202/options.json | 3 + .../invalid-syntax/migrated_0203/actual.js | 1 + .../invalid-syntax/migrated_0203/options.json | 3 + .../invalid-syntax/migrated_0204/actual.js | 1 + .../invalid-syntax/migrated_0204/options.json | 3 + .../invalid-syntax/migrated_0205/actual.js | 1 + .../migrated_0205/expected.json | 149 +++++ .../invalid-syntax/migrated_0205/options.json | 3 + .../invalid-syntax/migrated_0206/actual.js | 1 + .../migrated_0206/expected.json | 149 +++++ .../invalid-syntax/migrated_0206/options.json | 3 + .../invalid-syntax/migrated_0207/actual.js | 1 + .../invalid-syntax/migrated_0207/options.json | 3 + .../invalid-syntax/migrated_0208/actual.js | 1 + .../migrated_0208/expected.json | 149 +++++ .../invalid-syntax/migrated_0208/options.json | 3 + .../invalid-syntax/migrated_0209/actual.js | 1 + .../invalid-syntax/migrated_0209/options.json | 3 + .../invalid-syntax/migrated_0210/actual.js | 1 + .../invalid-syntax/migrated_0210/options.json | 3 + .../invalid-syntax/migrated_0211/actual.js | 1 + .../invalid-syntax/migrated_0211/options.json | 3 + .../invalid-syntax/migrated_0212/actual.js | 1 + .../migrated_0212/expected.json | 134 +++++ .../invalid-syntax/migrated_0212/options.json | 3 + .../invalid-syntax/migrated_0213/actual.js | 1 + .../migrated_0213/expected.json | 134 +++++ .../invalid-syntax/migrated_0213/options.json | 3 + .../invalid-syntax/migrated_0214/actual.js | 1 + .../invalid-syntax/migrated_0214/options.json | 3 + .../invalid-syntax/migrated_0215/actual.js | 1 + .../invalid-syntax/migrated_0215/options.json | 3 + .../invalid-syntax/migrated_0216/actual.js | 1 + .../migrated_0216/expected.json | 99 +++ .../invalid-syntax/migrated_0216/options.json | 3 + .../invalid-syntax/migrated_0217/actual.js | 1 + .../invalid-syntax/migrated_0217/options.json | 3 + .../invalid-syntax/migrated_0218/actual.js | 1 + .../invalid-syntax/migrated_0218/options.json | 3 + .../invalid-syntax/migrated_0219/actual.js | 1 + .../invalid-syntax/migrated_0219/options.json | 3 + .../invalid-syntax/migrated_0220/actual.js | 1 + .../invalid-syntax/migrated_0220/options.json | 3 + .../invalid-syntax/migrated_0221/actual.js | 1 + .../migrated_0221/expected.json | 150 +++++ .../invalid-syntax/migrated_0221/options.json | 3 + .../invalid-syntax/migrated_0222/actual.js | 1 + .../migrated_0222/expected.json | 183 ++++++ .../invalid-syntax/migrated_0222/options.json | 3 + .../invalid-syntax/migrated_0223/actual.js | 1 + .../invalid-syntax/migrated_0223/options.json | 3 + .../invalid-syntax/migrated_0224/actual.js | 1 + .../invalid-syntax/migrated_0224/options.json | 3 + .../invalid-syntax/migrated_0225/actual.js | 1 + .../invalid-syntax/migrated_0225/options.json | 3 + .../invalid-syntax/migrated_0226/actual.js | 1 + .../invalid-syntax/migrated_0226/options.json | 3 + .../invalid-syntax/migrated_0227/actual.js | 1 + .../invalid-syntax/migrated_0227/options.json | 3 + .../invalid-syntax/migrated_0228/actual.js | 1 + .../invalid-syntax/migrated_0228/options.json | 3 + .../invalid-syntax/migrated_0229/actual.js | 1 + .../invalid-syntax/migrated_0229/options.json | 3 + .../invalid-syntax/migrated_0230/actual.js | 1 + .../invalid-syntax/migrated_0230/options.json | 3 + .../invalid-syntax/migrated_0231/actual.js | 1 + .../invalid-syntax/migrated_0231/options.json | 3 + .../invalid-syntax/migrated_0232/actual.js | 1 + .../invalid-syntax/migrated_0232/options.json | 3 + .../invalid-syntax/migrated_0233/actual.js | 1 + .../migrated_0233/expected.json | 134 +++++ .../invalid-syntax/migrated_0233/options.json | 3 + .../invalid-syntax/migrated_0234/actual.js | 1 + .../migrated_0234/expected.json | 117 ++++ .../invalid-syntax/migrated_0234/options.json | 3 + .../invalid-syntax/migrated_0235/actual.js | 1 + .../migrated_0235/expected.json | 134 +++++ .../invalid-syntax/migrated_0235/options.json | 3 + .../invalid-syntax/migrated_0236/actual.js | 1 + .../migrated_0236/expected.json | 134 +++++ .../invalid-syntax/migrated_0236/options.json | 3 + .../invalid-syntax/migrated_0238/actual.js | 1 + .../migrated_0238/expected.json | 83 +++ .../invalid-syntax/migrated_0238/options.json | 3 + .../invalid-syntax/migrated_0239/actual.js | 1 + .../invalid-syntax/migrated_0239/options.json | 3 + .../invalid-syntax/migrated_0240/actual.js | 1 + .../invalid-syntax/migrated_0240/options.json | 3 + .../invalid-syntax/migrated_0241/actual.js | 1 + .../migrated_0241/expected.json | 134 +++++ .../invalid-syntax/migrated_0241/options.json | 3 + .../invalid-syntax/migrated_0242/actual.js | 1 + .../migrated_0242/expected.json | 134 +++++ .../invalid-syntax/migrated_0242/options.json | 3 + .../invalid-syntax/migrated_0243/actual.js | 1 + .../invalid-syntax/migrated_0243/options.json | 3 + .../invalid-syntax/migrated_0244/actual.js | 1 + .../invalid-syntax/migrated_0244/options.json | 3 + .../invalid-syntax/migrated_0245/actual.js | 1 + .../invalid-syntax/migrated_0245/options.json | 3 + .../invalid-syntax/migrated_0246/actual.js | 1 + .../migrated_0246/expected.json | 150 +++++ .../invalid-syntax/migrated_0246/options.json | 3 + .../invalid-syntax/migrated_0247/actual.js | 1 + .../migrated_0247/expected.json | 150 +++++ .../invalid-syntax/migrated_0247/options.json | 3 + .../invalid-syntax/migrated_0248/actual.js | 1 + .../invalid-syntax/migrated_0248/options.json | 3 + .../invalid-syntax/migrated_0249/actual.js | 1 + .../invalid-syntax/migrated_0249/options.json | 3 + .../invalid-syntax/migrated_0250/actual.js | 1 + .../invalid-syntax/migrated_0250/options.json | 3 + .../invalid-syntax/migrated_0252/actual.js | 1 + .../invalid-syntax/migrated_0252/options.json | 3 + .../invalid-syntax/migrated_0253/actual.js | 1 + .../migrated_0253/expected.json | 64 ++ .../invalid-syntax/migrated_0253/options.json | 3 + .../invalid-syntax/migrated_0254/actual.js | 1 + .../invalid-syntax/migrated_0254/options.json | 3 + .../invalid-syntax/migrated_0255/actual.js | 1 + .../invalid-syntax/migrated_0255/options.json | 3 + .../invalid-syntax/migrated_0256/actual.js | 1 + .../invalid-syntax/migrated_0256/options.json | 3 + .../invalid-syntax/migrated_0257/actual.js | 1 + .../invalid-syntax/migrated_0257/options.json | 3 + .../invalid-syntax/migrated_0258/actual.js | 1 + .../invalid-syntax/migrated_0258/options.json | 3 + .../invalid-syntax/migrated_0259/actual.js | 1 + .../invalid-syntax/migrated_0259/options.json | 3 + .../invalid-syntax/migrated_0260/actual.js | 1 + .../invalid-syntax/migrated_0260/options.json | 3 + .../invalid-syntax/migrated_0261/actual.js | 1 + .../invalid-syntax/migrated_0261/options.json | 3 + .../invalid-syntax/migrated_0262/actual.js | 1 + .../invalid-syntax/migrated_0262/options.json | 3 + .../invalid-syntax/migrated_0263/actual.js | 1 + .../invalid-syntax/migrated_0263/options.json | 3 + .../invalid-syntax/migrated_0264/actual.js | 1 + .../invalid-syntax/migrated_0264/options.json | 3 + .../invalid-syntax/migrated_0265/actual.js | 1 + .../invalid-syntax/migrated_0265/options.json | 3 + .../invalid-syntax/migrated_0266/actual.js | 1 + .../invalid-syntax/migrated_0266/options.json | 3 + .../invalid-syntax/migrated_0267/actual.js | 1 + .../invalid-syntax/migrated_0267/options.json | 3 + .../invalid-syntax/migrated_0268/actual.js | 1 + .../invalid-syntax/migrated_0268/options.json | 3 + .../invalid-syntax/migrated_0269/actual.js | 1 + .../invalid-syntax/migrated_0269/options.json | 3 + .../invalid-syntax/migrated_0270/actual.js | 1 + .../migrated_0270/expected.json | 151 +++++ .../invalid-syntax/migrated_0270/options.json | 3 + .../invalid-syntax/migrated_0271/actual.js | 1 + .../migrated_0271/expected.json | 153 +++++ .../invalid-syntax/migrated_0271/options.json | 3 + .../invalid-syntax/migrated_0272/actual.js | 1 + .../invalid-syntax/migrated_0272/options.json | 3 + .../invalid-syntax/migrated_0273/actual.js | 1 + .../invalid-syntax/migrated_0273/options.json | 3 + .../invalid-syntax/migrated_0274/actual.js | 1 + .../invalid-syntax/migrated_0274/options.json | 3 + .../invalid-syntax/migrated_0275/actual.js | 1 + .../invalid-syntax/migrated_0275/options.json | 3 + .../invalid-syntax/migrated_0276/actual.js | 1 + .../invalid-syntax/migrated_0276/options.json | 3 + .../invalid-syntax/migrated_0277/actual.js | 1 + .../migrated_0277/expected.json | 168 ++++++ .../invalid-syntax/migrated_0277/options.json | 3 + .../invalid-syntax/migrated_0278/actual.js | 1 + .../migrated_0278/expected.json | 151 +++++ .../invalid-syntax/migrated_0278/options.json | 3 + .../statement-block/migrated_0000/actual.js | 1 + .../migrated_0000/expected.json | 81 +++ .../statement-block/migrated_0001/actual.js | 1 + .../migrated_0001/expected.json | 144 +++++ .../statement-block/migrated_0002/actual.js | 1 + .../migrated_0002/expected.json | 49 ++ .../statement-break/migrated_0000/actual.js | 1 + .../migrated_0000/expected.json | 99 +++ .../statement-break/migrated_0001/actual.js | 1 + .../migrated_0001/expected.json | 145 +++++ .../statement-break/migrated_0002/actual.js | 1 + .../migrated_0002/expected.json | 145 +++++ .../statement-break/migrated_0003/actual.js | 1 + .../migrated_0003/expected.json | 145 +++++ .../migrated_0000/actual.js | 1 + .../migrated_0000/expected.json | 99 +++ .../migrated_0001/actual.js | 1 + .../migrated_0001/expected.json | 99 +++ .../migrated_0002/actual.js | 1 + .../migrated_0002/expected.json | 145 +++++ .../migrated_0003/actual.js | 1 + .../migrated_0003/expected.json | 145 +++++ .../migrated_0004/actual.js | 1 + .../migrated_0004/expected.json | 145 +++++ .../migrated_0000/actual.js | 1 + .../migrated_0000/expected.json | 48 ++ .../statement-empty/migrated_0000/actual.js | 1 + .../migrated_0000/expected.json | 48 ++ .../migrated_0000/actual.js | 1 + .../migrated_0000/expected.json | 64 ++ .../migrated_0001/actual.js | 1 + .../migrated_0001/expected.json | 97 +++ .../migrated_0002/actual.js | 1 + .../migrated_0002/expected.json | 100 +++ .../migrated_0003/actual.js | 1 + .../migrated_0003/expected.json | 100 +++ .../migrated_0004/actual.js | 1 + .../migrated_0004/expected.json | 100 +++ .../migrated_0005/actual.js | 1 + .../migrated_0005/expected.json | 100 +++ .../statement-if/migrated_0000/actual.js | 1 + .../statement-if/migrated_0000/expected.json | 112 ++++ .../statement-if/migrated_0001/actual.js | 1 + .../statement-if/migrated_0001/expected.json | 116 ++++ .../statement-if/migrated_0002/actual.js | 1 + .../statement-if/migrated_0002/expected.json | 132 ++++ .../statement-if/migrated_0003/actual.js | 1 + .../statement-if/migrated_0004/actual.js | 1 + .../statement-if/migrated_0004/expected.json | 158 +++++ .../statement-if/migrated_0005/actual.js | 2 + .../statement-if/migrated_0005/expected.json | 128 ++++ .../statement-if/migrated_0006/actual.js | 1 + .../statement-if/migrated_0006/expected.json | 128 ++++ .../statement-iteration/const_forin/actual.js | 1 + .../const_forin/expected.json | 178 ++++++ .../for-statement-with-seq/actual.js | 1 + .../for-statement-with-seq/expected.json | 130 ++++ .../migrated_0000/actual.js | 1 + .../migrated_0000/expected.json | 113 ++++ .../migrated_0001/actual.js | 1 + .../migrated_0001/expected.json | 113 ++++ .../migrated_0002/actual.js | 1 + .../migrated_0002/expected.json | 211 +++++++ .../migrated_0003/actual.js | 1 + .../migrated_0003/expected.json | 132 ++++ .../migrated_0004/actual.js | 1 + .../migrated_0004/expected.json | 113 ++++ .../migrated_0005/actual.js | 2 + .../migrated_0005/expected.json | 113 ++++ .../migrated_0006/actual.js | 1 + .../migrated_0006/expected.json | 113 ++++ .../migrated_0007/actual.js | 1 + .../migrated_0007/expected.json | 211 +++++++ .../migrated_0008/actual.js | 1 + .../migrated_0008/expected.json | 66 ++ .../migrated_0009/actual.js | 1 + .../migrated_0009/expected.json | 67 +++ .../migrated_0010/actual.js | 1 + .../migrated_0010/expected.json | 115 ++++ .../migrated_0011/actual.js | 1 + .../migrated_0011/expected.json | 132 ++++ .../migrated_0012/actual.js | 1 + .../migrated_0012/expected.json | 132 ++++ .../migrated_0013/actual.js | 1 + .../migrated_0013/expected.json | 181 ++++++ .../migrated_0014/actual.js | 1 + .../migrated_0014/expected.json | 164 +++++ .../migrated_0015/actual.js | 1 + .../migrated_0015/expected.json | 196 ++++++ .../migrated_0016/actual.js | 1 + .../migrated_0016/expected.json | 245 ++++++++ .../migrated_0017/actual.js | 1 + .../migrated_0017/expected.json | 144 +++++ .../migrated_0018/actual.js | 1 + .../migrated_0018/expected.json | 178 ++++++ .../migrated_0019/actual.js | 1 + .../migrated_0019/expected.json | 195 ++++++ .../migrated_0020/actual.js | 1 + .../migrated_0020/expected.json | 178 ++++++ .../migrated_0021/actual.js | 1 + .../migrated_0021/expected.json | 176 ++++++ .../migrated_0022/actual.js | 1 + .../migrated_0022/expected.json | 241 ++++++++ .../migrated_0023/actual.js | 1 + .../migrated_0023/expected.json | 278 +++++++++ .../migrated_0024/actual.js | 1 + .../migrated_0024/expected.json | 159 +++++ .../migrated_0025/actual.js | 1 + .../migrated_0025/expected.json | 194 ++++++ .../migrated_0026/actual.js | 1 + .../migrated_0026/expected.json | 127 ++++ .../pattern-in-for-in/actual.js | 1 + .../migrated_0000/actual.js | 1 + .../migrated_0000/expected.json | 113 ++++ .../migrated_0001/actual.js | 1 + .../migrated_0001/expected.json | 128 ++++ .../migrated_0002/actual.js | 1 + .../migrated_0002/expected.json | 95 +++ .../statement-return/migrated_0000/actual.js | 1 + .../migrated_0000/expected.json | 101 ++++ .../statement-return/migrated_0001/actual.js | 1 + .../migrated_0001/expected.json | 101 ++++ .../statement-return/migrated_0002/actual.js | 1 + .../migrated_0002/expected.json | 116 ++++ .../statement-return/migrated_0003/actual.js | 1 + .../migrated_0003/expected.json | 148 +++++ .../statement-switch/migrated_0000/actual.js | 1 + .../migrated_0000/expected.json | 65 ++ .../statement-switch/migrated_0001/actual.js | 1 + .../migrated_0001/expected.json | 164 +++++ .../statement-switch/migrated_0002/actual.js | 1 + .../migrated_0002/expected.json | 198 ++++++ .../statement-throw/migrated_0000/actual.js | 1 + .../migrated_0000/expected.json | 64 ++ .../statement-throw/migrated_0001/actual.js | 1 + .../migrated_0001/expected.json | 96 +++ .../statement-throw/migrated_0002/actual.js | 1 + .../migrated_0002/expected.json | 118 ++++ .../statement-try/migrated_0000/actual.js | 1 + .../statement-try/migrated_0000/expected.json | 113 ++++ .../statement-try/migrated_0001/actual.js | 1 + .../statement-try/migrated_0001/expected.json | 113 ++++ .../statement-try/migrated_0002/actual.js | 1 + .../statement-try/migrated_0002/expected.json | 113 ++++ .../statement-try/migrated_0003/actual.js | 1 + .../statement-try/migrated_0003/expected.json | 178 ++++++ .../statement-try/migrated_0004/actual.js | 1 + .../statement-try/migrated_0004/expected.json | 147 +++++ .../statement-try/migrated_0005/actual.js | 1 + .../statement-try/migrated_0005/expected.json | 226 +++++++ .../statement-try/migrated_0006/actual.js | 1 + .../statement-try/migrated_0006/expected.json | 306 ++++++++++ .../complex-pattern-requires-init/actual.js | 1 + .../options.json | 3 + .../migrated_0000/actual.js | 1 + .../migrated_0000/expected.json | 83 +++ .../migrated_0001/actual.js | 1 + .../migrated_0001/expected.json | 115 ++++ .../migrated_0002/actual.js | 1 + .../migrated_0002/expected.json | 100 +++ .../migrated_0003/actual.js | 1 + .../migrated_0003/expected.json | 149 +++++ .../migrated_0004/actual.js | 1 + .../migrated_0004/expected.json | 198 ++++++ .../migrated_0005/actual.js | 1 + .../migrated_0005/expected.json | 147 +++++ .../migrated_0006/actual.js | 1 + .../migrated_0006/expected.json | 179 ++++++ .../statement-with/migrated_0000/actual.js | 1 + .../migrated_0000/expected.json | 127 ++++ .../statement-with/migrated_0001/actual.js | 1 + .../migrated_0001/expected.json | 127 ++++ .../statement-with/migrated_0002/actual.js | 1 + .../migrated_0002/expected.json | 144 +++++ .../async-functions/illegal-parens/actual.js | 1 + .../illegal-parens/options.json | 3 + .../actual.js | 1 + .../expected.json | 166 +++++ .../options.json | 3 + .../arrow-functions/inner-parens/actual.js | 1 + .../arrow-functions/inner-parens/options.json | 3 + .../harmony/uncategorised/289/expected.json | 187 ++++++ .../harmony/uncategorised/297/expected.json | 167 +++++ 2091 files changed, 82939 insertions(+), 111 deletions(-) create mode 100644 test/fixtures/core/uncategorised/484/expected.json create mode 100644 test/fixtures/core/uncategorised/485/expected.json create mode 100644 test/fixtures/core/uncategorised/488/expected.json create mode 100644 test/fixtures/core/uncategorised/489/expected.json create mode 100644 test/fixtures/core/uncategorised/491/expected.json create mode 100644 test/fixtures/core/uncategorised/495/expected.json create mode 100644 test/fixtures/core/uncategorised/496/expected.json create mode 100644 test/fixtures/core/uncategorised/511/expected.json create mode 100644 test/fixtures/core/uncategorised/512/expected.json create mode 100644 test/fixtures/core/uncategorised/515/expected.json create mode 100644 test/fixtures/core/uncategorised/516/expected.json create mode 100644 test/fixtures/core/uncategorised/520/expected.json create mode 100644 test/fixtures/core/uncategorised/521/expected.json create mode 100644 test/fixtures/core/uncategorised/536/expected.json create mode 100644 test/fixtures/esprima/LICENSE create mode 100644 test/fixtures/esprima/automatic-semicolon-insertion/migrated_0000/actual.js create mode 100644 test/fixtures/esprima/automatic-semicolon-insertion/migrated_0000/expected.json create mode 100644 test/fixtures/esprima/automatic-semicolon-insertion/migrated_0001/actual.js create mode 100644 test/fixtures/esprima/automatic-semicolon-insertion/migrated_0001/expected.json create mode 100644 test/fixtures/esprima/automatic-semicolon-insertion/migrated_0002/actual.js create mode 100644 test/fixtures/esprima/automatic-semicolon-insertion/migrated_0002/expected.json create mode 100644 test/fixtures/esprima/automatic-semicolon-insertion/migrated_0003/actual.js create mode 100644 test/fixtures/esprima/automatic-semicolon-insertion/migrated_0003/expected.json create mode 100644 test/fixtures/esprima/automatic-semicolon-insertion/migrated_0004/actual.js create mode 100644 test/fixtures/esprima/automatic-semicolon-insertion/migrated_0004/expected.json create mode 100644 test/fixtures/esprima/automatic-semicolon-insertion/migrated_0005/actual.js create mode 100644 test/fixtures/esprima/automatic-semicolon-insertion/migrated_0005/expected.json create mode 100644 test/fixtures/esprima/automatic-semicolon-insertion/migrated_0006/actual.js create mode 100644 test/fixtures/esprima/automatic-semicolon-insertion/migrated_0006/expected.json create mode 100644 test/fixtures/esprima/automatic-semicolon-insertion/migrated_0007/actual.js create mode 100644 test/fixtures/esprima/automatic-semicolon-insertion/migrated_0007/expected.json create mode 100644 test/fixtures/esprima/automatic-semicolon-insertion/migrated_0008/actual.js create mode 100644 test/fixtures/esprima/automatic-semicolon-insertion/migrated_0008/expected.json create mode 100644 test/fixtures/esprima/automatic-semicolon-insertion/migrated_0009/actual.js create mode 100644 test/fixtures/esprima/automatic-semicolon-insertion/migrated_0009/expected.json create mode 100644 test/fixtures/esprima/automatic-semicolon-insertion/migrated_0010/actual.js create mode 100644 test/fixtures/esprima/automatic-semicolon-insertion/migrated_0010/expected.json create mode 100644 test/fixtures/esprima/automatic-semicolon-insertion/migrated_0011/actual.js create mode 100644 test/fixtures/esprima/automatic-semicolon-insertion/migrated_0011/expected.json create mode 100644 test/fixtures/esprima/automatic-semicolon-insertion/migrated_0012/actual.js create mode 100644 test/fixtures/esprima/automatic-semicolon-insertion/migrated_0012/expected.json create mode 100644 test/fixtures/esprima/automatic-semicolon-insertion/migrated_0013/actual.js create mode 100644 test/fixtures/esprima/automatic-semicolon-insertion/migrated_0013/expected.json create mode 100644 test/fixtures/esprima/automatic-semicolon-insertion/migrated_0014/actual.js create mode 100644 test/fixtures/esprima/automatic-semicolon-insertion/migrated_0014/expected.json create mode 100644 test/fixtures/esprima/automatic-semicolon-insertion/migrated_0015/actual.js create mode 100644 test/fixtures/esprima/automatic-semicolon-insertion/migrated_0015/expected.json create mode 100644 test/fixtures/esprima/declaration-const/migrated_0000/actual.js create mode 100644 test/fixtures/esprima/declaration-const/migrated_0000/expected.json create mode 100644 test/fixtures/esprima/declaration-const/migrated_0001/actual.js create mode 100644 test/fixtures/esprima/declaration-const/migrated_0001/expected.json create mode 100644 test/fixtures/esprima/declaration-const/migrated_0002/actual.js create mode 100644 test/fixtures/esprima/declaration-const/migrated_0002/expected.json create mode 100644 test/fixtures/esprima/declaration-function/dupe-param/actual.js create mode 100644 test/fixtures/esprima/declaration-function/empty-param/actual.js create mode 100644 test/fixtures/esprima/declaration-function/empty-param/expected.json create mode 100644 test/fixtures/esprima/declaration-function/migrated_0000/actual.js create mode 100644 test/fixtures/esprima/declaration-function/migrated_0000/expected.json create mode 100644 test/fixtures/esprima/declaration-function/migrated_0001/actual.js create mode 100644 test/fixtures/esprima/declaration-function/migrated_0001/expected.json create mode 100644 test/fixtures/esprima/declaration-function/migrated_0002/actual.js create mode 100644 test/fixtures/esprima/declaration-function/migrated_0002/expected.json create mode 100644 test/fixtures/esprima/declaration-function/migrated_0003/actual.js create mode 100644 test/fixtures/esprima/declaration-function/migrated_0003/expected.json create mode 100644 test/fixtures/esprima/declaration-function/migrated_0004/actual.js create mode 100644 test/fixtures/esprima/declaration-function/migrated_0004/expected.json create mode 100644 test/fixtures/esprima/declaration-function/migrated_0005/actual.js create mode 100644 test/fixtures/esprima/declaration-function/migrated_0005/expected.json create mode 100644 test/fixtures/esprima/declaration-function/migrated_0006/actual.js create mode 100644 test/fixtures/esprima/declaration-function/migrated_0006/expected.json create mode 100644 test/fixtures/esprima/declaration-function/migrated_0007/actual.js create mode 100644 test/fixtures/esprima/declaration-function/migrated_0007/expected.json create mode 100644 test/fixtures/esprima/declaration-function/migrated_0008/actual.js create mode 100644 test/fixtures/esprima/declaration-function/migrated_0008/expected.json create mode 100644 test/fixtures/esprima/declaration-function/migrated_0009/actual.js create mode 100644 test/fixtures/esprima/declaration-function/migrated_0009/expected.json create mode 100644 test/fixtures/esprima/declaration-function/migrated_0010/actual.js create mode 100644 test/fixtures/esprima/declaration-function/migrated_0010/expected.json create mode 100644 test/fixtures/esprima/declaration-function/migrated_0011/actual.js create mode 100644 test/fixtures/esprima/declaration-function/migrated_0011/expected.json create mode 100644 test/fixtures/esprima/declaration-function/migrated_0012/actual.js create mode 100644 test/fixtures/esprima/declaration-function/migrated_0012/expected.json create mode 100644 test/fixtures/esprima/declaration-function/migrated_0013/actual.js create mode 100644 test/fixtures/esprima/declaration-function/migrated_0013/expected.json create mode 100644 test/fixtures/esprima/declaration-function/migrated_0014/actual.js create mode 100644 test/fixtures/esprima/declaration-function/migrated_0014/expected.json create mode 100644 test/fixtures/esprima/declaration-let/migrated_0000/actual.js create mode 100644 test/fixtures/esprima/declaration-let/migrated_0000/expected.json create mode 100644 test/fixtures/esprima/declaration-let/migrated_0001/actual.js create mode 100644 test/fixtures/esprima/declaration-let/migrated_0001/expected.json create mode 100644 test/fixtures/esprima/declaration-let/migrated_0002/actual.js create mode 100644 test/fixtures/esprima/declaration-let/migrated_0002/expected.json create mode 100644 test/fixtures/esprima/declaration-let/migrated_0003/actual.js create mode 100644 test/fixtures/esprima/declaration-let/migrated_0003/expected.json create mode 100644 test/fixtures/esprima/directive-prolog/migrated_0000/actual.js create mode 100644 test/fixtures/esprima/directive-prolog/migrated_0000/expected.json create mode 100644 test/fixtures/esprima/directive-prolog/migrated_0001/actual.js create mode 100644 test/fixtures/esprima/directive-prolog/migrated_0001/expected.json create mode 100644 test/fixtures/esprima/es2015-array-binding-pattern/array-binding-pattern-01/actual.js create mode 100644 test/fixtures/esprima/es2015-array-binding-pattern/array-binding-pattern-01/expected.json create mode 100644 test/fixtures/esprima/es2015-array-binding-pattern/array-binding-pattern-02/actual.js create mode 100644 test/fixtures/esprima/es2015-array-binding-pattern/array-binding-pattern-02/expected.json create mode 100644 test/fixtures/esprima/es2015-array-binding-pattern/array-binding-pattern-03/actual.js create mode 100644 test/fixtures/esprima/es2015-array-binding-pattern/array-binding-pattern-03/expected.json create mode 100644 test/fixtures/esprima/es2015-array-binding-pattern/array-binding-pattern-empty/actual.js create mode 100644 test/fixtures/esprima/es2015-array-binding-pattern/array-binding-pattern-empty/expected.json create mode 100644 test/fixtures/esprima/es2015-array-binding-pattern/elision/actual.js create mode 100644 test/fixtures/esprima/es2015-array-binding-pattern/elision/expected.json create mode 100644 test/fixtures/esprima/es2015-array-binding-pattern/invalid-dup-param/actual.js create mode 100644 test/fixtures/esprima/es2015-array-binding-pattern/invalid-dup-param/expected.json create mode 100644 test/fixtures/esprima/es2015-array-binding-pattern/invalid-dup-param/options.json create mode 100644 test/fixtures/esprima/es2015-array-binding-pattern/invalid-elision-after-rest/actual.js create mode 100644 test/fixtures/esprima/es2015-array-binding-pattern/invalid-elision-after-rest/expected.json create mode 100644 test/fixtures/esprima/es2015-array-binding-pattern/invalid-elision-after-rest/options.json create mode 100644 test/fixtures/esprima/es2015-array-pattern/dupe-param-1/actual.js create mode 100644 test/fixtures/esprima/es2015-array-pattern/dupe-param-2/actual.js create mode 100644 test/fixtures/esprima/es2015-array-pattern/dupe-param-3/actual.js create mode 100644 test/fixtures/esprima/es2015-array-pattern/elision/actual.js create mode 100644 test/fixtures/esprima/es2015-array-pattern/elision/expected.json create mode 100644 test/fixtures/esprima/es2015-array-pattern/empty-pattern-catch-param/actual.js create mode 100644 test/fixtures/esprima/es2015-array-pattern/empty-pattern-catch-param/expected.json create mode 100644 test/fixtures/esprima/es2015-array-pattern/empty-pattern-fn/actual.js create mode 100644 test/fixtures/esprima/es2015-array-pattern/empty-pattern-fn/expected.json create mode 100644 test/fixtures/esprima/es2015-array-pattern/empty-pattern-lexical/actual.js create mode 100644 test/fixtures/esprima/es2015-array-pattern/empty-pattern-lexical/expected.json create mode 100644 test/fixtures/esprima/es2015-array-pattern/empty-pattern-var/actual.js create mode 100644 test/fixtures/esprima/es2015-array-pattern/empty-pattern-var/expected.json create mode 100644 test/fixtures/esprima/es2015-array-pattern/hole/actual.js create mode 100644 test/fixtures/esprima/es2015-array-pattern/hole/expected.json create mode 100644 test/fixtures/esprima/es2015-array-pattern/nested-pattern/actual.js create mode 100644 test/fixtures/esprima/es2015-array-pattern/nested-pattern/expected.json create mode 100644 test/fixtures/esprima/es2015-array-pattern/patterned-catch-dupe/actual.js create mode 100644 test/fixtures/esprima/es2015-array-pattern/patterned-catch-dupe/expected.json create mode 100644 test/fixtures/esprima/es2015-array-pattern/patterned-catch-dupe/options.json create mode 100644 test/fixtures/esprima/es2015-array-pattern/patterned-catch/actual.js create mode 100644 test/fixtures/esprima/es2015-array-pattern/patterned-catch/expected.json create mode 100644 test/fixtures/esprima/es2015-array-pattern/rest/actual.js create mode 100644 test/fixtures/esprima/es2015-array-pattern/rest/expected.json create mode 100644 test/fixtures/esprima/es2015-array-pattern/rest/options.json create mode 100644 test/fixtures/esprima/es2015-array-pattern/tailing-hold/actual.js create mode 100644 test/fixtures/esprima/es2015-array-pattern/tailing-hold/expected.json create mode 100644 test/fixtures/esprima/es2015-array-pattern/with-default-catch-param-fail/actual.js create mode 100644 test/fixtures/esprima/es2015-array-pattern/with-default-catch-param-fail/options.json create mode 100644 test/fixtures/esprima/es2015-array-pattern/with-default-catch-param/actual.js create mode 100644 test/fixtures/esprima/es2015-array-pattern/with-default-catch-param/expected.json create mode 100644 test/fixtures/esprima/es2015-array-pattern/with-default-fn/actual.js create mode 100644 test/fixtures/esprima/es2015-array-pattern/with-default-fn/expected.json create mode 100644 test/fixtures/esprima/es2015-array-pattern/with-object-pattern/actual.js create mode 100644 test/fixtures/esprima/es2015-array-pattern/with-object-pattern/expected.json create mode 100644 test/fixtures/esprima/es2015-arrow-function/arrow-rest-forgetting-comma/actual.js create mode 100644 test/fixtures/esprima/es2015-arrow-function/arrow-rest-forgetting-comma/options.json create mode 100644 test/fixtures/esprima/es2015-arrow-function/arrow-with-multiple-arg-and-rest/actual.js create mode 100644 test/fixtures/esprima/es2015-arrow-function/arrow-with-multiple-arg-and-rest/expected.json create mode 100644 test/fixtures/esprima/es2015-arrow-function/arrow-with-multiple-rest/actual.js create mode 100644 test/fixtures/esprima/es2015-arrow-function/arrow-with-multiple-rest/options.json create mode 100644 test/fixtures/esprima/es2015-arrow-function/arrow-with-only-rest/actual.js create mode 100644 test/fixtures/esprima/es2015-arrow-function/arrow-with-only-rest/expected.json create mode 100644 test/fixtures/esprima/es2015-arrow-function/complex-rest-in-arrow-not-allowed/actual.js create mode 100644 test/fixtures/esprima/es2015-arrow-function/complex-rest-in-arrow-not-allowed/options.json create mode 100644 test/fixtures/esprima/es2015-arrow-function/invalid-duplicated-params/actual.js create mode 100644 test/fixtures/esprima/es2015-arrow-function/invalid-duplicated-params/options.json create mode 100644 test/fixtures/esprima/es2015-arrow-function/invalid-line-terminator-arrow/actual.js create mode 100644 test/fixtures/esprima/es2015-arrow-function/invalid-line-terminator-arrow/options.json create mode 100644 test/fixtures/esprima/es2015-arrow-function/invalid-param-strict-mode/actual.js create mode 100644 test/fixtures/esprima/es2015-arrow-function/invalid-param-strict-mode/expected.json create mode 100644 test/fixtures/esprima/es2015-arrow-function/invalid-param-strict-mode/options.json create mode 100644 test/fixtures/esprima/es2015-arrow-function/migrated_0000/actual.js create mode 100644 test/fixtures/esprima/es2015-arrow-function/migrated_0000/expected.json create mode 100644 test/fixtures/esprima/es2015-arrow-function/migrated_0001/actual.js create mode 100644 test/fixtures/esprima/es2015-arrow-function/migrated_0001/expected.json create mode 100644 test/fixtures/esprima/es2015-arrow-function/migrated_0002/actual.js create mode 100644 test/fixtures/esprima/es2015-arrow-function/migrated_0002/expected.json create mode 100644 test/fixtures/esprima/es2015-arrow-function/migrated_0003/actual.js create mode 100644 test/fixtures/esprima/es2015-arrow-function/migrated_0003/expected.json create mode 100644 test/fixtures/esprima/es2015-arrow-function/migrated_0004/actual.js create mode 100644 test/fixtures/esprima/es2015-arrow-function/migrated_0004/expected.json create mode 100644 test/fixtures/esprima/es2015-arrow-function/migrated_0005/actual.js create mode 100644 test/fixtures/esprima/es2015-arrow-function/migrated_0005/expected.json create mode 100644 test/fixtures/esprima/es2015-arrow-function/migrated_0006/actual.js create mode 100644 test/fixtures/esprima/es2015-arrow-function/migrated_0006/expected.json create mode 100644 test/fixtures/esprima/es2015-arrow-function/migrated_0007/actual.js create mode 100644 test/fixtures/esprima/es2015-arrow-function/migrated_0007/expected.json create mode 100644 test/fixtures/esprima/es2015-arrow-function/migrated_0008/actual.js create mode 100644 test/fixtures/esprima/es2015-arrow-function/migrated_0008/expected.json create mode 100644 test/fixtures/esprima/es2015-arrow-function/migrated_0009/actual.js create mode 100644 test/fixtures/esprima/es2015-arrow-function/migrated_0009/expected.json create mode 100644 test/fixtures/esprima/es2015-arrow-function/migrated_0010/actual.js create mode 100644 test/fixtures/esprima/es2015-arrow-function/migrated_0010/expected.json create mode 100644 test/fixtures/esprima/es2015-arrow-function/migrated_0011/actual.js create mode 100644 test/fixtures/esprima/es2015-arrow-function/migrated_0011/expected.json create mode 100644 test/fixtures/esprima/es2015-arrow-function/migrated_0012/actual.js create mode 100644 test/fixtures/esprima/es2015-arrow-function/migrated_0012/expected.json create mode 100644 test/fixtures/esprima/es2015-arrow-function/migrated_0013/actual.js create mode 100644 test/fixtures/esprima/es2015-arrow-function/migrated_0013/expected.json create mode 100644 test/fixtures/esprima/es2015-arrow-function/migrated_0014/actual.js create mode 100644 test/fixtures/esprima/es2015-arrow-function/migrated_0014/expected.json create mode 100644 test/fixtures/esprima/es2015-arrow-function/migrated_0015/actual.js create mode 100644 test/fixtures/esprima/es2015-arrow-function/migrated_0015/expected.json create mode 100644 test/fixtures/esprima/es2015-arrow-function/migrated_0016/actual.js create mode 100644 test/fixtures/esprima/es2015-arrow-function/migrated_0016/expected.json create mode 100644 test/fixtures/esprima/es2015-arrow-function/migrated_0017/actual.js create mode 100644 test/fixtures/esprima/es2015-arrow-function/migrated_0017/expected.json create mode 100644 test/fixtures/esprima/es2015-arrow-function/migrated_0018/actual.js create mode 100644 test/fixtures/esprima/es2015-arrow-function/migrated_0018/expected.json create mode 100644 test/fixtures/esprima/es2015-arrow-function/migrated_0019/actual.js create mode 100644 test/fixtures/esprima/es2015-arrow-function/migrated_0019/expected.json create mode 100644 test/fixtures/esprima/es2015-arrow-function/migrated_0020/actual.js create mode 100644 test/fixtures/esprima/es2015-arrow-function/migrated_0020/expected.json create mode 100644 test/fixtures/esprima/es2015-arrow-function/non-arrow-param-followed-by-arrow/actual.js create mode 100644 test/fixtures/esprima/es2015-arrow-function/non-arrow-param-followed-by-arrow/options.json create mode 100644 test/fixtures/esprima/es2015-arrow-function/non-arrow-param-followed-by-rest/actual.js create mode 100644 test/fixtures/esprima/es2015-arrow-function/non-arrow-param-followed-by-rest/options.json create mode 100644 test/fixtures/esprima/es2015-arrow-function/object-binding-pattern/expected.json create mode 100755 test/fixtures/esprima/es2015-arrow-function/object-binding-pattern/invalid-member-expr.failure.json create mode 100755 test/fixtures/esprima/es2015-arrow-function/object-binding-pattern/invalid-member-expr.js create mode 100755 test/fixtures/esprima/es2015-arrow-function/object-binding-pattern/invalid-method-in-pattern.failure.json create mode 100755 test/fixtures/esprima/es2015-arrow-function/object-binding-pattern/invalid-method-in-pattern.js create mode 100755 test/fixtures/esprima/es2015-arrow-function/object-binding-pattern/invalid-nested-param.failure.json create mode 100755 test/fixtures/esprima/es2015-arrow-function/object-binding-pattern/invalid-nested-param.js create mode 100755 test/fixtures/esprima/es2015-arrow-function/object-binding-pattern/invalid-pattern-without-parenthesis.failure.json create mode 100755 test/fixtures/esprima/es2015-arrow-function/object-binding-pattern/invalid-pattern-without-parenthesis.js create mode 100755 test/fixtures/esprima/es2015-arrow-function/object-binding-pattern/invalid-rest-in-object-pattern.failure.json create mode 100755 test/fixtures/esprima/es2015-arrow-function/object-binding-pattern/invalid-rest-in-object-pattern.js create mode 100755 test/fixtures/esprima/es2015-arrow-function/object-binding-pattern/nested-cover-grammar.js create mode 100755 test/fixtures/esprima/es2015-arrow-function/object-binding-pattern/object-binding-pattern-01.js create mode 100755 test/fixtures/esprima/es2015-arrow-function/object-binding-pattern/object-binding-pattern-empty.js create mode 100644 test/fixtures/esprima/es2015-arrow-function/param-with-rest-without-arrow/actual.js create mode 100644 test/fixtures/esprima/es2015-arrow-function/param-with-rest-without-arrow/options.json create mode 100644 test/fixtures/esprima/es2015-arrow-function/rest-without-arrow/actual.js create mode 100644 test/fixtures/esprima/es2015-arrow-function/rest-without-arrow/options.json create mode 100644 test/fixtures/esprima/es2015-binary-integer-literal/migrated_0000/actual.js create mode 100644 test/fixtures/esprima/es2015-binary-integer-literal/migrated_0000/expected.json create mode 100644 test/fixtures/esprima/es2015-binary-integer-literal/migrated_0001/actual.js create mode 100644 test/fixtures/esprima/es2015-binary-integer-literal/migrated_0001/expected.json create mode 100644 test/fixtures/esprima/es2015-binary-integer-literal/migrated_0002/actual.js create mode 100644 test/fixtures/esprima/es2015-binary-integer-literal/migrated_0002/expected.json create mode 100644 test/fixtures/esprima/es2015-binary-integer-literal/migrated_0003/actual.js create mode 100644 test/fixtures/esprima/es2015-binary-integer-literal/migrated_0003/expected.json create mode 100644 test/fixtures/esprima/es2015-binary-integer-literal/migrated_0004/actual.js create mode 100644 test/fixtures/esprima/es2015-binary-integer-literal/migrated_0004/expected.json create mode 100644 test/fixtures/esprima/es2015-binary-integer-literal/migrated_0005/actual.js create mode 100644 test/fixtures/esprima/es2015-binary-integer-literal/migrated_0005/expected.json create mode 100644 test/fixtures/esprima/es2015-class/migrated_0000/actual.js create mode 100644 test/fixtures/esprima/es2015-class/migrated_0000/expected.json create mode 100644 test/fixtures/esprima/es2015-class/migrated_0001/actual.js create mode 100644 test/fixtures/esprima/es2015-class/migrated_0001/expected.json create mode 100644 test/fixtures/esprima/es2015-class/migrated_0002/actual.js create mode 100644 test/fixtures/esprima/es2015-class/migrated_0002/expected.json create mode 100644 test/fixtures/esprima/es2015-class/migrated_0003/actual.js create mode 100644 test/fixtures/esprima/es2015-class/migrated_0003/expected.json create mode 100644 test/fixtures/esprima/es2015-class/migrated_0004/actual.js create mode 100644 test/fixtures/esprima/es2015-class/migrated_0004/expected.json create mode 100644 test/fixtures/esprima/es2015-class/migrated_0005/actual.js create mode 100644 test/fixtures/esprima/es2015-class/migrated_0005/expected.json create mode 100644 test/fixtures/esprima/es2015-class/migrated_0006/actual.js create mode 100644 test/fixtures/esprima/es2015-class/migrated_0006/expected.json create mode 100644 test/fixtures/esprima/es2015-class/migrated_0007/actual.js create mode 100644 test/fixtures/esprima/es2015-class/migrated_0007/expected.json create mode 100644 test/fixtures/esprima/es2015-class/migrated_0008/actual.js create mode 100644 test/fixtures/esprima/es2015-class/migrated_0008/expected.json create mode 100644 test/fixtures/esprima/es2015-class/migrated_0009/actual.js create mode 100644 test/fixtures/esprima/es2015-class/migrated_0009/expected.json create mode 100644 test/fixtures/esprima/es2015-class/migrated_0010/actual.js create mode 100644 test/fixtures/esprima/es2015-class/migrated_0010/expected.json create mode 100644 test/fixtures/esprima/es2015-class/migrated_0011/actual.js create mode 100644 test/fixtures/esprima/es2015-class/migrated_0011/expected.json create mode 100644 test/fixtures/esprima/es2015-class/migrated_0012/actual.js create mode 100644 test/fixtures/esprima/es2015-class/migrated_0012/expected.json create mode 100644 test/fixtures/esprima/es2015-class/migrated_0013/actual.js create mode 100644 test/fixtures/esprima/es2015-class/migrated_0013/expected.json create mode 100644 test/fixtures/esprima/es2015-class/migrated_0014/actual.js create mode 100644 test/fixtures/esprima/es2015-class/migrated_0014/expected.json create mode 100644 test/fixtures/esprima/es2015-class/migrated_0015/actual.js create mode 100644 test/fixtures/esprima/es2015-class/migrated_0015/expected.json create mode 100644 test/fixtures/esprima/es2015-class/migrated_0016/actual.js create mode 100644 test/fixtures/esprima/es2015-class/migrated_0016/expected.json create mode 100644 test/fixtures/esprima/es2015-class/migrated_0017/actual.js create mode 100644 test/fixtures/esprima/es2015-class/migrated_0017/expected.json create mode 100644 test/fixtures/esprima/es2015-class/migrated_0018/actual.js create mode 100644 test/fixtures/esprima/es2015-class/migrated_0018/expected.json create mode 100644 test/fixtures/esprima/es2015-class/migrated_0019/actual.js create mode 100644 test/fixtures/esprima/es2015-class/migrated_0019/expected.json create mode 100644 test/fixtures/esprima/es2015-class/migrated_0020/actual.js create mode 100644 test/fixtures/esprima/es2015-class/migrated_0020/expected.json create mode 100644 test/fixtures/esprima/es2015-class/migrated_0021/actual.js create mode 100644 test/fixtures/esprima/es2015-class/migrated_0021/expected.json create mode 100644 test/fixtures/esprima/es2015-class/migrated_0022/actual.js create mode 100644 test/fixtures/esprima/es2015-class/migrated_0022/expected.json create mode 100644 test/fixtures/esprima/es2015-class/migrated_0023/actual.js create mode 100644 test/fixtures/esprima/es2015-class/migrated_0023/expected.json create mode 100644 test/fixtures/esprima/es2015-class/migrated_0024/actual.js create mode 100644 test/fixtures/esprima/es2015-class/migrated_0024/expected.json create mode 100644 test/fixtures/esprima/es2015-class/migrated_0025/actual.js create mode 100644 test/fixtures/esprima/es2015-class/migrated_0025/expected.json create mode 100644 test/fixtures/esprima/es2015-class/migrated_0026/actual.js create mode 100644 test/fixtures/esprima/es2015-class/migrated_0026/expected.json create mode 100644 test/fixtures/esprima/es2015-default-parameter-value/migrated_0000/actual.js create mode 100644 test/fixtures/esprima/es2015-default-parameter-value/migrated_0000/expected.json create mode 100644 test/fixtures/esprima/es2015-default-parameter-value/migrated_0001/actual.js create mode 100644 test/fixtures/esprima/es2015-default-parameter-value/migrated_0001/expected.json create mode 100644 test/fixtures/esprima/es2015-default-parameter-value/migrated_0002/actual.js create mode 100644 test/fixtures/esprima/es2015-default-parameter-value/migrated_0002/expected.json create mode 100644 test/fixtures/esprima/es2015-destructuring-assignment-array-pattern/dup-assignment/actual.js create mode 100644 test/fixtures/esprima/es2015-destructuring-assignment-array-pattern/dup-assignment/expected.json create mode 100644 test/fixtures/esprima/es2015-destructuring-assignment-array-pattern/elision/actual.js create mode 100644 test/fixtures/esprima/es2015-destructuring-assignment-array-pattern/elision/expected.json create mode 100644 test/fixtures/esprima/es2015-destructuring-assignment-array-pattern/member-expr-in-rest/actual.js create mode 100644 test/fixtures/esprima/es2015-destructuring-assignment-array-pattern/member-expr-in-rest/expected.json create mode 100644 test/fixtures/esprima/es2015-destructuring-assignment-array-pattern/nested-assignment/actual.js create mode 100644 test/fixtures/esprima/es2015-destructuring-assignment-array-pattern/nested-assignment/expected.json create mode 100644 test/fixtures/esprima/es2015-destructuring-assignment-array-pattern/nested-cover-grammar/actual.js create mode 100644 test/fixtures/esprima/es2015-destructuring-assignment-array-pattern/nested-cover-grammar/expected.json create mode 100644 test/fixtures/esprima/es2015-destructuring-assignment-array-pattern/simple-assignment/actual.js create mode 100644 test/fixtures/esprima/es2015-destructuring-assignment-array-pattern/simple-assignment/expected.json create mode 100644 test/fixtures/esprima/es2015-destructuring-assignment-object-pattern/empty-object-pattern-assignment/actual.js create mode 100644 test/fixtures/esprima/es2015-destructuring-assignment-object-pattern/empty-object-pattern-assignment/expected.json create mode 100644 test/fixtures/esprima/es2015-destructuring-assignment-object-pattern/invalid-lhs-01/actual.js create mode 100644 test/fixtures/esprima/es2015-destructuring-assignment-object-pattern/invalid-lhs-01/options.json create mode 100644 test/fixtures/esprima/es2015-destructuring-assignment-object-pattern/invalid-lhs-02/actual.js create mode 100644 test/fixtures/esprima/es2015-destructuring-assignment-object-pattern/invalid-lhs-02/options.json create mode 100644 test/fixtures/esprima/es2015-destructuring-assignment-object-pattern/invalid-pattern-with-method/actual.js create mode 100644 test/fixtures/esprima/es2015-destructuring-assignment-object-pattern/invalid-pattern-with-method/options.json create mode 100644 test/fixtures/esprima/es2015-destructuring-assignment-object-pattern/nested-cover-grammar/actual.js create mode 100644 test/fixtures/esprima/es2015-destructuring-assignment-object-pattern/nested-cover-grammar/expected.json create mode 100644 test/fixtures/esprima/es2015-destructuring-assignment-object-pattern/object-pattern-assignment/actual.js create mode 100644 test/fixtures/esprima/es2015-destructuring-assignment-object-pattern/object-pattern-assignment/expected.json create mode 100644 test/fixtures/esprima/es2015-destructuring-assignment/invalid-cover-grammar/actual.js create mode 100644 test/fixtures/esprima/es2015-destructuring-assignment/invalid-cover-grammar/options.json create mode 100644 test/fixtures/esprima/es2015-destructuring-assignment/invalid-group-assignment/actual.js create mode 100644 test/fixtures/esprima/es2015-destructuring-assignment/invalid-group-assignment/options.json create mode 100644 test/fixtures/esprima/es2015-export-declaration/export-const-number/actual.js create mode 100644 test/fixtures/esprima/es2015-export-declaration/export-const-number/expected.json create mode 100644 test/fixtures/esprima/es2015-export-declaration/export-default-array/actual.js create mode 100644 test/fixtures/esprima/es2015-export-declaration/export-default-array/expected.json create mode 100644 test/fixtures/esprima/es2015-export-declaration/export-default-class/actual.js create mode 100644 test/fixtures/esprima/es2015-export-declaration/export-default-class/expected.json create mode 100644 test/fixtures/esprima/es2015-export-declaration/export-default-expression/actual.js create mode 100644 test/fixtures/esprima/es2015-export-declaration/export-default-expression/expected.json create mode 100644 test/fixtures/esprima/es2015-export-declaration/export-default-function/actual.js create mode 100644 test/fixtures/esprima/es2015-export-declaration/export-default-function/expected.json create mode 100644 test/fixtures/esprima/es2015-export-declaration/export-default-named-function/actual.js create mode 100644 test/fixtures/esprima/es2015-export-declaration/export-default-named-function/expected.json create mode 100644 test/fixtures/esprima/es2015-export-declaration/export-default-number/actual.js create mode 100644 test/fixtures/esprima/es2015-export-declaration/export-default-number/expected.json create mode 100644 test/fixtures/esprima/es2015-export-declaration/export-default-object/actual.js create mode 100644 test/fixtures/esprima/es2015-export-declaration/export-default-object/expected.json create mode 100644 test/fixtures/esprima/es2015-export-declaration/export-default-value/actual.js create mode 100644 test/fixtures/esprima/es2015-export-declaration/export-default-value/expected.json create mode 100644 test/fixtures/esprima/es2015-export-declaration/export-from-batch/actual.js create mode 100644 test/fixtures/esprima/es2015-export-declaration/export-from-batch/expected.json create mode 100644 test/fixtures/esprima/es2015-export-declaration/export-from-default/actual.js create mode 100644 test/fixtures/esprima/es2015-export-declaration/export-from-default/expected.json create mode 100644 test/fixtures/esprima/es2015-export-declaration/export-from-named-as-default/actual.js create mode 100644 test/fixtures/esprima/es2015-export-declaration/export-from-named-as-default/expected.json create mode 100644 test/fixtures/esprima/es2015-export-declaration/export-from-named-as-specifier/actual.js create mode 100644 test/fixtures/esprima/es2015-export-declaration/export-from-named-as-specifier/expected.json create mode 100644 test/fixtures/esprima/es2015-export-declaration/export-from-named-as-specifiers/actual.js create mode 100644 test/fixtures/esprima/es2015-export-declaration/export-from-named-as-specifiers/expected.json create mode 100644 test/fixtures/esprima/es2015-export-declaration/export-from-specifier/actual.js create mode 100644 test/fixtures/esprima/es2015-export-declaration/export-from-specifier/expected.json create mode 100644 test/fixtures/esprima/es2015-export-declaration/export-from-specifiers/actual.js create mode 100644 test/fixtures/esprima/es2015-export-declaration/export-from-specifiers/expected.json create mode 100644 test/fixtures/esprima/es2015-export-declaration/export-function-declaration/actual.js create mode 100644 test/fixtures/esprima/es2015-export-declaration/export-function-declaration/expected.json create mode 100644 test/fixtures/esprima/es2015-export-declaration/export-function/actual.js create mode 100644 test/fixtures/esprima/es2015-export-declaration/export-function/expected.json create mode 100644 test/fixtures/esprima/es2015-export-declaration/export-let-number/actual.js create mode 100644 test/fixtures/esprima/es2015-export-declaration/export-let-number/expected.json create mode 100644 test/fixtures/esprima/es2015-export-declaration/export-named-as-default/actual.js create mode 100644 test/fixtures/esprima/es2015-export-declaration/export-named-as-default/expected.json create mode 100644 test/fixtures/esprima/es2015-export-declaration/export-named-as-specifier/actual.js create mode 100644 test/fixtures/esprima/es2015-export-declaration/export-named-as-specifier/expected.json create mode 100644 test/fixtures/esprima/es2015-export-declaration/export-named-as-specifiers/actual.js create mode 100644 test/fixtures/esprima/es2015-export-declaration/export-named-as-specifiers/expected.json create mode 100644 test/fixtures/esprima/es2015-export-declaration/export-named-empty/actual.js create mode 100644 test/fixtures/esprima/es2015-export-declaration/export-named-empty/expected.json create mode 100644 test/fixtures/esprima/es2015-export-declaration/export-named-specifier/actual.js create mode 100644 test/fixtures/esprima/es2015-export-declaration/export-named-specifier/expected.json create mode 100644 test/fixtures/esprima/es2015-export-declaration/export-named-specifiers-comma/actual.js create mode 100644 test/fixtures/esprima/es2015-export-declaration/export-named-specifiers-comma/expected.json create mode 100644 test/fixtures/esprima/es2015-export-declaration/export-named-specifiers/actual.js create mode 100644 test/fixtures/esprima/es2015-export-declaration/export-named-specifiers/expected.json create mode 100644 test/fixtures/esprima/es2015-export-declaration/export-var-anonymous-function/actual.js create mode 100644 test/fixtures/esprima/es2015-export-declaration/export-var-anonymous-function/expected.json create mode 100644 test/fixtures/esprima/es2015-export-declaration/export-var-number/actual.js create mode 100644 test/fixtures/esprima/es2015-export-declaration/export-var-number/expected.json create mode 100644 test/fixtures/esprima/es2015-export-declaration/export-var/actual.js create mode 100644 test/fixtures/esprima/es2015-export-declaration/export-var/expected.json create mode 100644 test/fixtures/esprima/es2015-export-declaration/invalid-export-batch-missing-from-clause/actual.js create mode 100644 test/fixtures/esprima/es2015-export-declaration/invalid-export-batch-missing-from-clause/options.json create mode 100644 test/fixtures/esprima/es2015-export-declaration/invalid-export-batch-token/actual.js create mode 100644 test/fixtures/esprima/es2015-export-declaration/invalid-export-batch-token/options.json create mode 100644 test/fixtures/esprima/es2015-export-declaration/invalid-export-default-equal/actual.js create mode 100644 test/fixtures/esprima/es2015-export-declaration/invalid-export-default-equal/options.json create mode 100644 test/fixtures/esprima/es2015-export-declaration/invalid-export-default-token/actual.js create mode 100644 test/fixtures/esprima/es2015-export-declaration/invalid-export-default-token/options.json create mode 100644 test/fixtures/esprima/es2015-export-declaration/invalid-export-default/actual.js create mode 100644 test/fixtures/esprima/es2015-export-declaration/invalid-export-default/options.json create mode 100644 test/fixtures/esprima/es2015-export-declaration/invalid-export-named-default/actual.js create mode 100644 test/fixtures/esprima/es2015-export-declaration/invalid-export-named-default/options.json create mode 100644 test/fixtures/esprima/es2015-export-declaration/options.json create mode 100644 test/fixtures/esprima/es2015-for-of/for-of-array-pattern-let/actual.js create mode 100644 test/fixtures/esprima/es2015-for-of/for-of-array-pattern-let/expected.json create mode 100644 test/fixtures/esprima/es2015-for-of/for-of-array-pattern/actual.js create mode 100644 test/fixtures/esprima/es2015-for-of/for-of-array-pattern/expected.json create mode 100644 test/fixtures/esprima/es2015-for-of/for-of-object-pattern-const/actual.js create mode 100644 test/fixtures/esprima/es2015-for-of/for-of-object-pattern-const/expected.json create mode 100644 test/fixtures/esprima/es2015-for-of/for-of-object-pattern/actual.js create mode 100644 test/fixtures/esprima/es2015-for-of/for-of-object-pattern/expected.json create mode 100644 test/fixtures/esprima/es2015-for-of/for-of-with-const/actual.js create mode 100644 test/fixtures/esprima/es2015-for-of/for-of-with-const/expected.json create mode 100644 test/fixtures/esprima/es2015-for-of/for-of-with-let/actual.js create mode 100644 test/fixtures/esprima/es2015-for-of/for-of-with-let/expected.json create mode 100644 test/fixtures/esprima/es2015-for-of/for-of-with-var/actual.js create mode 100644 test/fixtures/esprima/es2015-for-of/for-of-with-var/expected.json create mode 100644 test/fixtures/esprima/es2015-for-of/for-of/actual.js create mode 100644 test/fixtures/esprima/es2015-for-of/for-of/expected.json create mode 100644 test/fixtures/esprima/es2015-for-of/invalid-const-init/actual.js create mode 100644 test/fixtures/esprima/es2015-for-of/invalid-const-init/options.json create mode 100644 test/fixtures/esprima/es2015-for-of/invalid-let-init/actual.js create mode 100644 test/fixtures/esprima/es2015-for-of/invalid-let-init/options.json create mode 100644 test/fixtures/esprima/es2015-for-of/invalid-lhs-init/actual.js create mode 100644 test/fixtures/esprima/es2015-for-of/invalid-lhs-init/options.json create mode 100644 test/fixtures/esprima/es2015-for-of/invalid-var-init/actual.js create mode 100644 test/fixtures/esprima/es2015-for-of/invalid-var-init/expected.json create mode 100644 test/fixtures/esprima/es2015-for-of/invalid-var-init/options.json create mode 100644 test/fixtures/esprima/es2015-for-of/let-of-of/actual.js create mode 100644 test/fixtures/esprima/es2015-for-of/let-of-of/expected.json create mode 100644 test/fixtures/esprima/es2015-for-of/unexpected-number/actual.js create mode 100644 test/fixtures/esprima/es2015-for-of/unexpected-number/options.json create mode 100644 test/fixtures/esprima/es2015-generator/generator-declaration-with-params/actual.js create mode 100644 test/fixtures/esprima/es2015-generator/generator-declaration-with-params/expected.json create mode 100644 test/fixtures/esprima/es2015-generator/generator-declaration-with-yield-delegate/actual.js create mode 100644 test/fixtures/esprima/es2015-generator/generator-declaration-with-yield-delegate/expected.json create mode 100644 test/fixtures/esprima/es2015-generator/generator-declaration-with-yield/actual.js create mode 100644 test/fixtures/esprima/es2015-generator/generator-declaration-with-yield/expected.json create mode 100644 test/fixtures/esprima/es2015-generator/generator-declaration/actual.js create mode 100644 test/fixtures/esprima/es2015-generator/generator-declaration/expected.json create mode 100644 test/fixtures/esprima/es2015-generator/generator-expression-rest-param/actual.js create mode 100644 test/fixtures/esprima/es2015-generator/generator-expression-rest-param/expected.json create mode 100644 test/fixtures/esprima/es2015-generator/generator-expression-with-params/actual.js create mode 100644 test/fixtures/esprima/es2015-generator/generator-expression-with-params/expected.json create mode 100644 test/fixtures/esprima/es2015-generator/generator-expression-with-yield-delegate/actual.js create mode 100644 test/fixtures/esprima/es2015-generator/generator-expression-with-yield-delegate/expected.json create mode 100644 test/fixtures/esprima/es2015-generator/generator-expression-with-yield/actual.js create mode 100644 test/fixtures/esprima/es2015-generator/generator-expression-with-yield/expected.json create mode 100644 test/fixtures/esprima/es2015-generator/generator-expression/actual.js create mode 100644 test/fixtures/esprima/es2015-generator/generator-expression/expected.json create mode 100644 test/fixtures/esprima/es2015-generator/generator-method-with-computed-name/actual.js create mode 100644 test/fixtures/esprima/es2015-generator/generator-method-with-computed-name/options.json create mode 100644 test/fixtures/esprima/es2015-generator/generator-method-with-invalid-computed-name/actual.js create mode 100644 test/fixtures/esprima/es2015-generator/generator-method-with-invalid-computed-name/options.json create mode 100644 test/fixtures/esprima/es2015-generator/generator-method-with-params/actual.js create mode 100644 test/fixtures/esprima/es2015-generator/generator-method-with-params/expected.json create mode 100644 test/fixtures/esprima/es2015-generator/generator-method-with-yield-delegate/actual.js create mode 100644 test/fixtures/esprima/es2015-generator/generator-method-with-yield-delegate/expected.json create mode 100644 test/fixtures/esprima/es2015-generator/generator-method-with-yield-expression/actual.js create mode 100644 test/fixtures/esprima/es2015-generator/generator-method-with-yield-expression/expected.json create mode 100644 test/fixtures/esprima/es2015-generator/generator-method-with-yield-line-terminator/actual.js create mode 100644 test/fixtures/esprima/es2015-generator/generator-method-with-yield-line-terminator/expected.json create mode 100644 test/fixtures/esprima/es2015-generator/generator-method-with-yield/actual.js create mode 100644 test/fixtures/esprima/es2015-generator/generator-method-with-yield/expected.json create mode 100644 test/fixtures/esprima/es2015-generator/generator-method/actual.js create mode 100644 test/fixtures/esprima/es2015-generator/generator-method/expected.json create mode 100644 test/fixtures/esprima/es2015-generator/generator-parameter-binding-element/actual.js create mode 100644 test/fixtures/esprima/es2015-generator/generator-parameter-binding-element/options.json create mode 100644 test/fixtures/esprima/es2015-generator/generator-parameter-binding-property-reserved/actual.js create mode 100644 test/fixtures/esprima/es2015-generator/generator-parameter-binding-property-reserved/options.json create mode 100644 test/fixtures/esprima/es2015-generator/generator-parameter-binding-property/actual.js create mode 100644 test/fixtures/esprima/es2015-generator/generator-parameter-binding-property/options.json create mode 100644 test/fixtures/esprima/es2015-generator/generator-parameter-computed-property-name/actual.js create mode 100644 test/fixtures/esprima/es2015-generator/generator-parameter-computed-property-name/options.json create mode 100644 test/fixtures/esprima/es2015-generator/generator-parameter-invalid-binding-element/actual.js create mode 100644 test/fixtures/esprima/es2015-generator/generator-parameter-invalid-binding-element/options.json create mode 100644 test/fixtures/esprima/es2015-generator/generator-parameter-invalid-binding-property/actual.js create mode 100644 test/fixtures/esprima/es2015-generator/generator-parameter-invalid-binding-property/options.json create mode 100644 test/fixtures/esprima/es2015-generator/generator-parameter-invalid-computed-property-name/actual.js create mode 100644 test/fixtures/esprima/es2015-generator/generator-parameter-invalid-computed-property-name/options.json create mode 100644 test/fixtures/esprima/es2015-generator/incomplete-yield-delegate/actual.js create mode 100644 test/fixtures/esprima/es2015-generator/incomplete-yield-delegate/options.json create mode 100644 test/fixtures/esprima/es2015-generator/malformed-generator-method-2/actual.js create mode 100644 test/fixtures/esprima/es2015-generator/malformed-generator-method-2/options.json create mode 100644 test/fixtures/esprima/es2015-generator/malformed-generator-method/actual.js create mode 100644 test/fixtures/esprima/es2015-generator/malformed-generator-method/options.json create mode 100644 test/fixtures/esprima/es2015-generator/static-generator-method-with-computed-name/actual.js create mode 100644 test/fixtures/esprima/es2015-generator/static-generator-method-with-computed-name/expected.json create mode 100644 test/fixtures/esprima/es2015-generator/static-generator-method/actual.js create mode 100644 test/fixtures/esprima/es2015-generator/static-generator-method/expected.json create mode 100644 test/fixtures/esprima/es2015-identifier/dakuten_handakuten/actual.js create mode 100644 test/fixtures/esprima/es2015-identifier/dakuten_handakuten/expected.json create mode 100644 test/fixtures/esprima/es2015-identifier/escaped_all/actual.js create mode 100644 test/fixtures/esprima/es2015-identifier/escaped_all/expected.json create mode 100644 test/fixtures/esprima/es2015-identifier/escaped_math_alef/actual.js create mode 100644 test/fixtures/esprima/es2015-identifier/escaped_math_alef/expected.json create mode 100644 test/fixtures/esprima/es2015-identifier/escaped_math_dal_part/actual.js create mode 100644 test/fixtures/esprima/es2015-identifier/escaped_math_dal_part/expected.json create mode 100644 test/fixtures/esprima/es2015-identifier/escaped_math_kaf_lam/actual.js create mode 100644 test/fixtures/esprima/es2015-identifier/escaped_math_kaf_lam/expected.json create mode 100644 test/fixtures/esprima/es2015-identifier/escaped_math_zain_start/actual.js create mode 100644 test/fixtures/esprima/es2015-identifier/escaped_math_zain_start/expected.json create mode 100644 test/fixtures/esprima/es2015-identifier/escaped_part/actual.js create mode 100644 test/fixtures/esprima/es2015-identifier/escaped_part/expected.json create mode 100644 test/fixtures/esprima/es2015-identifier/escaped_start/actual.js create mode 100644 test/fixtures/esprima/es2015-identifier/escaped_start/expected.json create mode 100644 test/fixtures/esprima/es2015-identifier/estimated/actual.js create mode 100644 test/fixtures/esprima/es2015-identifier/estimated/expected.json create mode 100644 test/fixtures/esprima/es2015-identifier/ethiopic_digits/actual.js create mode 100644 test/fixtures/esprima/es2015-identifier/ethiopic_digits/expected.json create mode 100644 test/fixtures/esprima/es2015-identifier/invalid_escaped_surrogate_pairs/actual.js create mode 100644 test/fixtures/esprima/es2015-identifier/invalid_escaped_surrogate_pairs/options.json create mode 100644 test/fixtures/esprima/es2015-identifier/invalid_expression_await/actual.js create mode 100644 test/fixtures/esprima/es2015-identifier/invalid_expression_await/options.json create mode 100644 test/fixtures/esprima/es2015-identifier/invalid_function_wait/actual.js create mode 100644 test/fixtures/esprima/es2015-identifier/invalid_function_wait/expected.json create mode 100644 test/fixtures/esprima/es2015-identifier/invalid_function_wait/options.json create mode 100644 test/fixtures/esprima/es2015-identifier/invalid_id_smp/actual.js create mode 100644 test/fixtures/esprima/es2015-identifier/invalid_id_smp/options.json create mode 100644 test/fixtures/esprima/es2015-identifier/invalid_lone_surrogate/actual.js create mode 100644 test/fixtures/esprima/es2015-identifier/invalid_lone_surrogate/expected.json create mode 100644 test/fixtures/esprima/es2015-identifier/invalid_lone_surrogate/options.json create mode 100644 test/fixtures/esprima/es2015-identifier/invalid_var_await/actual.js create mode 100644 test/fixtures/esprima/es2015-identifier/invalid_var_await/options.json create mode 100644 test/fixtures/esprima/es2015-identifier/math_alef/actual.js create mode 100644 test/fixtures/esprima/es2015-identifier/math_alef/expected.json create mode 100644 test/fixtures/esprima/es2015-identifier/math_dal_part/actual.js create mode 100644 test/fixtures/esprima/es2015-identifier/math_dal_part/expected.json create mode 100644 test/fixtures/esprima/es2015-identifier/math_kaf_lam/actual.js create mode 100644 test/fixtures/esprima/es2015-identifier/math_kaf_lam/expected.json create mode 100644 test/fixtures/esprima/es2015-identifier/math_zain_start/actual.js create mode 100644 test/fixtures/esprima/es2015-identifier/math_zain_start/expected.json create mode 100644 test/fixtures/esprima/es2015-identifier/module_await/actual.js create mode 100644 test/fixtures/esprima/es2015-identifier/module_await/expected.json create mode 100644 test/fixtures/esprima/es2015-identifier/valid_await/actual.js create mode 100644 test/fixtures/esprima/es2015-identifier/valid_await/expected.json create mode 100644 test/fixtures/esprima/es2015-identifier/weierstrass/actual.js create mode 100644 test/fixtures/esprima/es2015-identifier/weierstrass/expected.json create mode 100644 test/fixtures/esprima/es2015-identifier/weierstrass_weierstrass/actual.js create mode 100644 test/fixtures/esprima/es2015-identifier/weierstrass_weierstrass/expected.json create mode 100644 test/fixtures/esprima/es2015-import-declaration/import-default-and-named-specifiers/actual.js create mode 100644 test/fixtures/esprima/es2015-import-declaration/import-default-and-named-specifiers/expected.json create mode 100644 test/fixtures/esprima/es2015-import-declaration/import-default-and-namespace-specifiers/actual.js create mode 100644 test/fixtures/esprima/es2015-import-declaration/import-default-and-namespace-specifiers/expected.json create mode 100644 test/fixtures/esprima/es2015-import-declaration/import-default-as/actual.js create mode 100644 test/fixtures/esprima/es2015-import-declaration/import-default-as/expected.json create mode 100644 test/fixtures/esprima/es2015-import-declaration/import-default/actual.js create mode 100644 test/fixtures/esprima/es2015-import-declaration/import-default/expected.json create mode 100644 test/fixtures/esprima/es2015-import-declaration/import-jquery/actual.js create mode 100644 test/fixtures/esprima/es2015-import-declaration/import-jquery/expected.json create mode 100644 test/fixtures/esprima/es2015-import-declaration/import-module/actual.js create mode 100644 test/fixtures/esprima/es2015-import-declaration/import-module/expected.json create mode 100644 test/fixtures/esprima/es2015-import-declaration/import-named-as-specifier/actual.js create mode 100644 test/fixtures/esprima/es2015-import-declaration/import-named-as-specifier/expected.json create mode 100644 test/fixtures/esprima/es2015-import-declaration/import-named-as-specifiers/actual.js create mode 100644 test/fixtures/esprima/es2015-import-declaration/import-named-as-specifiers/expected.json create mode 100644 test/fixtures/esprima/es2015-import-declaration/import-named-empty/actual.js create mode 100644 test/fixtures/esprima/es2015-import-declaration/import-named-empty/expected.json create mode 100644 test/fixtures/esprima/es2015-import-declaration/import-named-specifier/actual.js create mode 100644 test/fixtures/esprima/es2015-import-declaration/import-named-specifier/expected.json create mode 100644 test/fixtures/esprima/es2015-import-declaration/import-named-specifiers-comma/actual.js create mode 100644 test/fixtures/esprima/es2015-import-declaration/import-named-specifiers-comma/expected.json create mode 100644 test/fixtures/esprima/es2015-import-declaration/import-named-specifiers/actual.js create mode 100644 test/fixtures/esprima/es2015-import-declaration/import-named-specifiers/expected.json create mode 100644 test/fixtures/esprima/es2015-import-declaration/import-namespace-specifier/actual.js create mode 100644 test/fixtures/esprima/es2015-import-declaration/import-namespace-specifier/expected.json create mode 100644 test/fixtures/esprima/es2015-import-declaration/import-null-as-nil/actual.js create mode 100644 test/fixtures/esprima/es2015-import-declaration/import-null-as-nil/expected.json create mode 100644 test/fixtures/esprima/es2015-import-declaration/invalid-import-default-after-named-after-default/actual.js create mode 100644 test/fixtures/esprima/es2015-import-declaration/invalid-import-default-after-named-after-default/options.json create mode 100644 test/fixtures/esprima/es2015-import-declaration/invalid-import-default-after-named/actual.js create mode 100644 test/fixtures/esprima/es2015-import-declaration/invalid-import-default-after-named/options.json create mode 100644 test/fixtures/esprima/es2015-import-declaration/invalid-import-default-missing-module-specifier/actual.js create mode 100644 test/fixtures/esprima/es2015-import-declaration/invalid-import-default-missing-module-specifier/options.json create mode 100644 test/fixtures/esprima/es2015-import-declaration/invalid-import-default-module-specifier/actual.js create mode 100644 test/fixtures/esprima/es2015-import-declaration/invalid-import-default-module-specifier/options.json create mode 100644 test/fixtures/esprima/es2015-import-declaration/invalid-import-default/actual.js create mode 100644 test/fixtures/esprima/es2015-import-declaration/invalid-import-default/options.json create mode 100644 test/fixtures/esprima/es2015-import-declaration/invalid-import-missing-comma/actual.js create mode 100644 test/fixtures/esprima/es2015-import-declaration/invalid-import-missing-comma/options.json create mode 100644 test/fixtures/esprima/es2015-import-declaration/invalid-import-missing-module-specifier/actual.js create mode 100644 test/fixtures/esprima/es2015-import-declaration/invalid-import-missing-module-specifier/options.json create mode 100644 test/fixtures/esprima/es2015-import-declaration/invalid-import-module-specifier/actual.js create mode 100644 test/fixtures/esprima/es2015-import-declaration/invalid-import-module-specifier/options.json create mode 100644 test/fixtures/esprima/es2015-import-declaration/invalid-import-named-after-named/actual.js create mode 100644 test/fixtures/esprima/es2015-import-declaration/invalid-import-named-after-named/options.json create mode 100644 test/fixtures/esprima/es2015-import-declaration/invalid-import-named-after-namespace/actual.js create mode 100644 test/fixtures/esprima/es2015-import-declaration/invalid-import-named-after-namespace/options.json create mode 100644 test/fixtures/esprima/es2015-import-declaration/invalid-import-named-as-missing-from/actual.js create mode 100644 test/fixtures/esprima/es2015-import-declaration/invalid-import-named-as-missing-from/options.json create mode 100644 test/fixtures/esprima/es2015-import-declaration/invalid-import-namespace-after-named/actual.js create mode 100644 test/fixtures/esprima/es2015-import-declaration/invalid-import-namespace-after-named/options.json create mode 100644 test/fixtures/esprima/es2015-import-declaration/invalid-import-namespace-missing-as/actual.js create mode 100644 test/fixtures/esprima/es2015-import-declaration/invalid-import-namespace-missing-as/options.json create mode 100644 test/fixtures/esprima/es2015-import-declaration/invalid-import-specifiers/actual.js create mode 100644 test/fixtures/esprima/es2015-import-declaration/invalid-import-specifiers/options.json create mode 100644 test/fixtures/esprima/es2015-import-declaration/options.json create mode 100644 test/fixtures/esprima/es2015-lexical-declaration/invalid_complex_binding_without_init/actual.js create mode 100644 test/fixtures/esprima/es2015-lexical-declaration/invalid_complex_binding_without_init/options.json create mode 100644 test/fixtures/esprima/es2015-lexical-declaration/invalid_const_forin/actual.js create mode 100644 test/fixtures/esprima/es2015-lexical-declaration/invalid_const_forin/options.json create mode 100644 test/fixtures/esprima/es2015-lexical-declaration/invalid_let_forin/actual.js create mode 100644 test/fixtures/esprima/es2015-lexical-declaration/invalid_let_forin/options.json create mode 100644 test/fixtures/esprima/es2015-lexical-declaration/migrated_0000/actual.js create mode 100644 test/fixtures/esprima/es2015-lexical-declaration/migrated_0000/expected.json create mode 100644 test/fixtures/esprima/es2015-meta-property/assign-new-target/actual.js create mode 100644 test/fixtures/esprima/es2015-meta-property/assign-new-target/expected.json create mode 100644 test/fixtures/esprima/es2015-meta-property/invalid-dots/actual.js create mode 100644 test/fixtures/esprima/es2015-meta-property/invalid-dots/options.json create mode 100644 test/fixtures/esprima/es2015-meta-property/invalid-new-target/actual.js create mode 100644 test/fixtures/esprima/es2015-meta-property/invalid-new-target/expected.json create mode 100644 test/fixtures/esprima/es2015-meta-property/invalid-new-target/options.json create mode 100644 test/fixtures/esprima/es2015-meta-property/new-new-target/actual.js create mode 100644 test/fixtures/esprima/es2015-meta-property/new-new-target/expected.json create mode 100644 test/fixtures/esprima/es2015-meta-property/new-target-declaration/actual.js create mode 100644 test/fixtures/esprima/es2015-meta-property/new-target-declaration/expected.json create mode 100644 test/fixtures/esprima/es2015-meta-property/new-target-expression/actual.js create mode 100644 test/fixtures/esprima/es2015-meta-property/new-target-expression/expected.json create mode 100644 test/fixtures/esprima/es2015-meta-property/new-target-invoke/actual.js create mode 100644 test/fixtures/esprima/es2015-meta-property/new-target-invoke/expected.json create mode 100644 test/fixtures/esprima/es2015-meta-property/new-target-precedence/actual.js create mode 100644 test/fixtures/esprima/es2015-meta-property/new-target-precedence/expected.json create mode 100644 test/fixtures/esprima/es2015-meta-property/unknown-property/actual.js create mode 100644 test/fixtures/esprima/es2015-meta-property/unknown-property/options.json create mode 100644 test/fixtures/esprima/es2015-method-definition/migrated_0000/actual.js create mode 100644 test/fixtures/esprima/es2015-method-definition/migrated_0000/expected.json create mode 100644 test/fixtures/esprima/es2015-method-definition/migrated_0001/actual.js create mode 100644 test/fixtures/esprima/es2015-method-definition/migrated_0001/expected.json create mode 100644 test/fixtures/esprima/es2015-method-definition/migrated_0002/actual.js create mode 100644 test/fixtures/esprima/es2015-method-definition/migrated_0002/expected.json create mode 100644 test/fixtures/esprima/es2015-method-definition/migrated_0003/actual.js create mode 100644 test/fixtures/esprima/es2015-method-definition/migrated_0003/expected.json create mode 100644 test/fixtures/esprima/es2015-method-definition/migrated_0004/actual.js create mode 100644 test/fixtures/esprima/es2015-method-definition/migrated_0004/expected.json create mode 100644 test/fixtures/esprima/es2015-object-initialiser/invalid-proto-getter-literal-identifier/actual.js create mode 100644 test/fixtures/esprima/es2015-object-initialiser/invalid-proto-getter-literal-identifier/options.json create mode 100644 test/fixtures/esprima/es2015-object-initialiser/invalid-proto-identifier-literal/actual.js create mode 100644 test/fixtures/esprima/es2015-object-initialiser/invalid-proto-identifier-literal/options.json create mode 100644 test/fixtures/esprima/es2015-object-initialiser/invalid-proto-identifier-shorthand/actual.js create mode 100644 test/fixtures/esprima/es2015-object-initialiser/invalid-proto-identifier-shorthand/expected.json create mode 100644 test/fixtures/esprima/es2015-object-initialiser/invalid-proto-identifier-shorthand/options.json create mode 100644 test/fixtures/esprima/es2015-object-initialiser/invalid-proto-identifiers/actual.js create mode 100644 test/fixtures/esprima/es2015-object-initialiser/invalid-proto-identifiers/options.json create mode 100644 test/fixtures/esprima/es2015-object-initialiser/invalid-proto-literal-identifier/actual.js create mode 100644 test/fixtures/esprima/es2015-object-initialiser/invalid-proto-literal-identifier/options.json create mode 100644 test/fixtures/esprima/es2015-object-initialiser/invalid-proto-literal-shorthand/actual.js create mode 100644 test/fixtures/esprima/es2015-object-initialiser/invalid-proto-literal-shorthand/expected.json create mode 100644 test/fixtures/esprima/es2015-object-initialiser/invalid-proto-literal-shorthand/options.json create mode 100644 test/fixtures/esprima/es2015-object-initialiser/invalid-proto-literals/actual.js create mode 100644 test/fixtures/esprima/es2015-object-initialiser/invalid-proto-literals/options.json create mode 100644 test/fixtures/esprima/es2015-object-initialiser/invalid-proto-setter-literal-identifier/actual.js create mode 100644 test/fixtures/esprima/es2015-object-initialiser/invalid-proto-setter-literal-identifier/options.json create mode 100644 test/fixtures/esprima/es2015-object-initialiser/invalid-proto-shorthand-identifier/actual.js create mode 100644 test/fixtures/esprima/es2015-object-initialiser/invalid-proto-shorthand-identifier/expected.json create mode 100644 test/fixtures/esprima/es2015-object-initialiser/invalid-proto-shorthand-identifier/options.json create mode 100644 test/fixtures/esprima/es2015-object-initialiser/invalid-proto-shorthand-literal/actual.js create mode 100644 test/fixtures/esprima/es2015-object-initialiser/invalid-proto-shorthand-literal/expected.json create mode 100644 test/fixtures/esprima/es2015-object-initialiser/invalid-proto-shorthand-literal/options.json create mode 100644 test/fixtures/esprima/es2015-object-initialiser/invalid-proto-shorthands/actual.js create mode 100644 test/fixtures/esprima/es2015-object-initialiser/invalid-proto-shorthands/expected.json create mode 100644 test/fixtures/esprima/es2015-object-initialiser/invalid-proto-shorthands/options.json create mode 100644 test/fixtures/esprima/es2015-object-initialiser/proto-identifier-getter-setter/actual.js create mode 100644 test/fixtures/esprima/es2015-object-initialiser/proto-identifier-getter-setter/expected.json create mode 100644 test/fixtures/esprima/es2015-object-initialiser/proto-identifier-getter/actual.js create mode 100644 test/fixtures/esprima/es2015-object-initialiser/proto-identifier-getter/expected.json create mode 100644 test/fixtures/esprima/es2015-object-initialiser/proto-identifier-method/actual.js create mode 100644 test/fixtures/esprima/es2015-object-initialiser/proto-identifier-method/expected.json create mode 100644 test/fixtures/esprima/es2015-object-initialiser/proto-identifier-setter/actual.js create mode 100644 test/fixtures/esprima/es2015-object-initialiser/proto-identifier-setter/expected.json create mode 100644 test/fixtures/esprima/es2015-object-initialiser/proto-literal-getter-setter/actual.js create mode 100644 test/fixtures/esprima/es2015-object-initialiser/proto-literal-getter-setter/expected.json create mode 100644 test/fixtures/esprima/es2015-object-initialiser/proto-literal-getter/actual.js create mode 100644 test/fixtures/esprima/es2015-object-initialiser/proto-literal-getter/expected.json create mode 100644 test/fixtures/esprima/es2015-object-initialiser/proto-literal-method/actual.js create mode 100644 test/fixtures/esprima/es2015-object-initialiser/proto-literal-method/expected.json create mode 100644 test/fixtures/esprima/es2015-object-initialiser/proto-literal-setter/actual.js create mode 100644 test/fixtures/esprima/es2015-object-initialiser/proto-literal-setter/expected.json create mode 100644 test/fixtures/esprima/es2015-object-literal-property-value-shorthand/migrated_0000/actual.js create mode 100644 test/fixtures/esprima/es2015-object-literal-property-value-shorthand/migrated_0000/expected.json create mode 100644 test/fixtures/esprima/es2015-object-pattern/elision/actual.js create mode 100644 test/fixtures/esprima/es2015-object-pattern/elision/expected.json create mode 100644 test/fixtures/esprima/es2015-object-pattern/empty-catch-param/actual.js create mode 100644 test/fixtures/esprima/es2015-object-pattern/empty-catch-param/expected.json create mode 100644 test/fixtures/esprima/es2015-object-pattern/empty-fn/actual.js create mode 100644 test/fixtures/esprima/es2015-object-pattern/empty-fn/expected.json create mode 100644 test/fixtures/esprima/es2015-object-pattern/empty-for-lex/actual.js create mode 100644 test/fixtures/esprima/es2015-object-pattern/empty-for-lex/expected.json create mode 100644 test/fixtures/esprima/es2015-object-pattern/empty-lexical/actual.js create mode 100644 test/fixtures/esprima/es2015-object-pattern/empty-lexical/expected.json create mode 100644 test/fixtures/esprima/es2015-object-pattern/empty-var/actual.js create mode 100644 test/fixtures/esprima/es2015-object-pattern/empty-var/expected.json create mode 100644 test/fixtures/esprima/es2015-object-pattern/nested/actual.js create mode 100644 test/fixtures/esprima/es2015-object-pattern/nested/expected.json create mode 100644 test/fixtures/esprima/es2015-object-pattern/properties/actual.js create mode 100644 test/fixtures/esprima/es2015-object-pattern/properties/expected.json create mode 100644 test/fixtures/esprima/es2015-octal-integer-literal/migrated_0000/actual.js create mode 100644 test/fixtures/esprima/es2015-octal-integer-literal/migrated_0000/expected.json create mode 100644 test/fixtures/esprima/es2015-octal-integer-literal/migrated_0001/actual.js create mode 100644 test/fixtures/esprima/es2015-octal-integer-literal/migrated_0001/expected.json create mode 100644 test/fixtures/esprima/es2015-octal-integer-literal/migrated_0002/actual.js create mode 100644 test/fixtures/esprima/es2015-octal-integer-literal/migrated_0002/expected.json create mode 100644 test/fixtures/esprima/es2015-octal-integer-literal/migrated_0003/actual.js create mode 100644 test/fixtures/esprima/es2015-octal-integer-literal/migrated_0003/expected.json create mode 100644 test/fixtures/esprima/es2015-octal-integer-literal/migrated_0004/actual.js create mode 100644 test/fixtures/esprima/es2015-octal-integer-literal/migrated_0004/expected.json create mode 100644 test/fixtures/esprima/es2015-octal-integer-literal/migrated_0005/actual.js create mode 100644 test/fixtures/esprima/es2015-octal-integer-literal/migrated_0005/expected.json create mode 100644 test/fixtures/esprima/es2015-octal-integer-literal/migrated_0006/actual.js create mode 100644 test/fixtures/esprima/es2015-octal-integer-literal/migrated_0006/expected.json create mode 100644 test/fixtures/esprima/es2015-rest-parameter/function-declaration/actual.js create mode 100644 test/fixtures/esprima/es2015-rest-parameter/function-declaration/expected.json create mode 100644 test/fixtures/esprima/es2015-rest-parameter/function-expression/actual.js create mode 100644 test/fixtures/esprima/es2015-rest-parameter/function-expression/expected.json create mode 100644 test/fixtures/esprima/es2015-rest-parameter/object-method/actual.js create mode 100644 test/fixtures/esprima/es2015-rest-parameter/object-method/expected.json create mode 100644 test/fixtures/esprima/es2015-rest-parameter/object-shorthand-method/actual.js create mode 100644 test/fixtures/esprima/es2015-rest-parameter/object-shorthand-method/expected.json create mode 100644 test/fixtures/esprima/es2015-spread-element/call-multi-spread/actual.js create mode 100644 test/fixtures/esprima/es2015-spread-element/call-multi-spread/expected.json create mode 100644 test/fixtures/esprima/es2015-spread-element/call-spread-default/actual.js create mode 100644 test/fixtures/esprima/es2015-spread-element/call-spread-default/expected.json create mode 100644 test/fixtures/esprima/es2015-spread-element/call-spread-first/actual.js create mode 100644 test/fixtures/esprima/es2015-spread-element/call-spread-first/expected.json create mode 100644 test/fixtures/esprima/es2015-spread-element/call-spread-number/actual.js create mode 100644 test/fixtures/esprima/es2015-spread-element/call-spread-number/expected.json create mode 100644 test/fixtures/esprima/es2015-spread-element/call-spread/actual.js create mode 100644 test/fixtures/esprima/es2015-spread-element/call-spread/expected.json create mode 100644 test/fixtures/esprima/es2015-spread-element/invalid-call-dot-dot/actual.js create mode 100644 test/fixtures/esprima/es2015-spread-element/invalid-call-dot-dot/options.json create mode 100644 test/fixtures/esprima/es2015-spread-element/invalid-call-dots/actual.js create mode 100644 test/fixtures/esprima/es2015-spread-element/invalid-call-dots/options.json create mode 100644 test/fixtures/esprima/es2015-spread-element/invalid-call-spreads/actual.js create mode 100644 test/fixtures/esprima/es2015-spread-element/invalid-call-spreads/options.json create mode 100644 test/fixtures/esprima/es2015-spread-element/invalid-new-dot-dot/actual.js create mode 100644 test/fixtures/esprima/es2015-spread-element/invalid-new-dot-dot/options.json create mode 100644 test/fixtures/esprima/es2015-spread-element/invalid-new-dots/actual.js create mode 100644 test/fixtures/esprima/es2015-spread-element/invalid-new-dots/options.json create mode 100644 test/fixtures/esprima/es2015-spread-element/invalid-new-spreads/actual.js create mode 100644 test/fixtures/esprima/es2015-spread-element/invalid-new-spreads/options.json create mode 100644 test/fixtures/esprima/es2015-spread-element/new-multi-spread/actual.js create mode 100644 test/fixtures/esprima/es2015-spread-element/new-multi-spread/expected.json create mode 100644 test/fixtures/esprima/es2015-spread-element/new-spread-default/actual.js create mode 100644 test/fixtures/esprima/es2015-spread-element/new-spread-default/expected.json create mode 100644 test/fixtures/esprima/es2015-spread-element/new-spread-first/actual.js create mode 100644 test/fixtures/esprima/es2015-spread-element/new-spread-first/expected.json create mode 100644 test/fixtures/esprima/es2015-spread-element/new-spread-number/actual.js create mode 100644 test/fixtures/esprima/es2015-spread-element/new-spread-number/expected.json create mode 100644 test/fixtures/esprima/es2015-spread-element/new-spread/actual.js create mode 100644 test/fixtures/esprima/es2015-spread-element/new-spread/expected.json create mode 100644 test/fixtures/esprima/es2015-super-property/arrow_super/actual.js create mode 100644 test/fixtures/esprima/es2015-super-property/arrow_super/expected.json create mode 100644 test/fixtures/esprima/es2015-super-property/constructor_super/actual.js create mode 100644 test/fixtures/esprima/es2015-super-property/constructor_super/expected.json create mode 100644 test/fixtures/esprima/es2015-super-property/invalid_super_access/actual.js create mode 100644 test/fixtures/esprima/es2015-super-property/invalid_super_access/options.json create mode 100644 test/fixtures/esprima/es2015-super-property/invalid_super_id/actual.js create mode 100644 test/fixtures/esprima/es2015-super-property/invalid_super_id/expected.json create mode 100644 test/fixtures/esprima/es2015-super-property/invalid_super_id/options.json create mode 100644 test/fixtures/esprima/es2015-super-property/invalid_super_not_inside_function/actual.js create mode 100644 test/fixtures/esprima/es2015-super-property/invalid_super_not_inside_function/options.json create mode 100644 test/fixtures/esprima/es2015-super-property/new_super/actual.js create mode 100644 test/fixtures/esprima/es2015-super-property/new_super/expected.json create mode 100644 test/fixtures/esprima/es2015-super-property/super_computed/actual.js create mode 100644 test/fixtures/esprima/es2015-super-property/super_computed/expected.json create mode 100644 test/fixtures/esprima/es2015-super-property/super_member/actual.js create mode 100644 test/fixtures/esprima/es2015-super-property/super_member/expected.json create mode 100644 test/fixtures/esprima/es2015-template-literals/after-switch/actual.js create mode 100644 test/fixtures/esprima/es2015-template-literals/after-switch/options.json create mode 100644 test/fixtures/esprima/es2015-template-literals/dollar-sign/actual.js create mode 100644 test/fixtures/esprima/es2015-template-literals/dollar-sign/expected.json create mode 100644 test/fixtures/esprima/es2015-template-literals/escape-sequences/actual.js create mode 100644 test/fixtures/esprima/es2015-template-literals/escape-sequences/expected.json create mode 100644 test/fixtures/esprima/es2015-template-literals/invalid-escape/actual.js create mode 100644 test/fixtures/esprima/es2015-template-literals/invalid-escape/options.json create mode 100644 test/fixtures/esprima/es2015-template-literals/line-terminators/actual.js create mode 100644 test/fixtures/esprima/es2015-template-literals/line-terminators/expected.json create mode 100644 test/fixtures/esprima/es2015-template-literals/literal-escape-sequences/actual.js create mode 100644 test/fixtures/esprima/es2015-template-literals/literal-escape-sequences/expected.json create mode 100644 test/fixtures/esprima/es2015-template-literals/new-expression/actual.js create mode 100644 test/fixtures/esprima/es2015-template-literals/new-expression/expected.json create mode 100644 test/fixtures/esprima/es2015-template-literals/octal-literal/actual.js create mode 100644 test/fixtures/esprima/es2015-template-literals/octal-literal/expected.json create mode 100644 test/fixtures/esprima/es2015-template-literals/octal-literal/options.json create mode 100644 test/fixtures/esprima/es2015-template-literals/strict-octal-literal/actual.js create mode 100644 test/fixtures/esprima/es2015-template-literals/strict-octal-literal/expected.json create mode 100644 test/fixtures/esprima/es2015-template-literals/strict-octal-literal/options.json create mode 100644 test/fixtures/esprima/es2015-template-literals/tagged-interpolation/actual.js create mode 100644 test/fixtures/esprima/es2015-template-literals/tagged-interpolation/expected.json create mode 100644 test/fixtures/esprima/es2015-template-literals/tagged-nested-with-object-literal/actual.js create mode 100644 test/fixtures/esprima/es2015-template-literals/tagged-nested-with-object-literal/expected.json create mode 100644 test/fixtures/esprima/es2015-template-literals/tagged/actual.js create mode 100644 test/fixtures/esprima/es2015-template-literals/tagged/expected.json create mode 100644 test/fixtures/esprima/es2015-template-literals/unclosed-interpolation/actual.js create mode 100644 test/fixtures/esprima/es2015-template-literals/unclosed-interpolation/options.json create mode 100644 test/fixtures/esprima/es2015-template-literals/unclosed-nested/actual.js create mode 100644 test/fixtures/esprima/es2015-template-literals/unclosed-nested/options.json create mode 100644 test/fixtures/esprima/es2015-template-literals/unclosed/actual.js create mode 100644 test/fixtures/esprima/es2015-template-literals/unclosed/options.json create mode 100644 test/fixtures/esprima/es2015-template-literals/untagged/actual.js create mode 100644 test/fixtures/esprima/es2015-template-literals/untagged/expected.json create mode 100644 test/fixtures/esprima/es2015-unicode-code-point-escape-sequence/migrated_0000/actual.js create mode 100644 test/fixtures/esprima/es2015-unicode-code-point-escape-sequence/migrated_0000/expected.json create mode 100644 test/fixtures/esprima/es2015-unicode-code-point-escape-sequence/migrated_0001/actual.js create mode 100644 test/fixtures/esprima/es2015-unicode-code-point-escape-sequence/migrated_0001/expected.json create mode 100644 test/fixtures/esprima/es2015-unicode-code-point-escape-sequence/migrated_0002/actual.js create mode 100644 test/fixtures/esprima/es2015-unicode-code-point-escape-sequence/migrated_0002/expected.json create mode 100644 test/fixtures/esprima/es2015-yield/invalid-yield-binding-property/actual.js create mode 100644 test/fixtures/esprima/es2015-yield/invalid-yield-binding-property/options.json create mode 100644 test/fixtures/esprima/es2015-yield/invalid-yield-expression/actual.js create mode 100644 test/fixtures/esprima/es2015-yield/invalid-yield-expression/options.json create mode 100644 test/fixtures/esprima/es2015-yield/invalid-yield-generator-arrow-default/actual.js create mode 100644 test/fixtures/esprima/es2015-yield/invalid-yield-generator-arrow-default/expected.json create mode 100644 test/fixtures/esprima/es2015-yield/invalid-yield-generator-arrow-default/options.json create mode 100644 test/fixtures/esprima/es2015-yield/invalid-yield-generator-arrow-parameter/actual.js create mode 100644 test/fixtures/esprima/es2015-yield/invalid-yield-generator-arrow-parameter/options.json create mode 100644 test/fixtures/esprima/es2015-yield/invalid-yield-generator-arrow-parameters/actual.js create mode 100644 test/fixtures/esprima/es2015-yield/invalid-yield-generator-arrow-parameters/options.json create mode 100644 test/fixtures/esprima/es2015-yield/invalid-yield-generator-catch/actual.js create mode 100644 test/fixtures/esprima/es2015-yield/invalid-yield-generator-catch/expected.json create mode 100644 test/fixtures/esprima/es2015-yield/invalid-yield-generator-catch/options.json create mode 100644 test/fixtures/esprima/es2015-yield/invalid-yield-generator-declaration/actual.js create mode 100644 test/fixtures/esprima/es2015-yield/invalid-yield-generator-declaration/options.json create mode 100644 test/fixtures/esprima/es2015-yield/invalid-yield-generator-export-default/actual.js create mode 100644 test/fixtures/esprima/es2015-yield/invalid-yield-generator-export-default/options.json create mode 100644 test/fixtures/esprima/es2015-yield/invalid-yield-generator-expression-name/actual.js create mode 100644 test/fixtures/esprima/es2015-yield/invalid-yield-generator-expression-name/expected.json create mode 100644 test/fixtures/esprima/es2015-yield/invalid-yield-generator-expression-name/options.json create mode 100644 test/fixtures/esprima/es2015-yield/invalid-yield-generator-expression-parameter/actual.js create mode 100644 test/fixtures/esprima/es2015-yield/invalid-yield-generator-expression-parameter/expected.json create mode 100644 test/fixtures/esprima/es2015-yield/invalid-yield-generator-expression-parameter/options.json create mode 100644 test/fixtures/esprima/es2015-yield/invalid-yield-generator-expression-rest/actual.js create mode 100644 test/fixtures/esprima/es2015-yield/invalid-yield-generator-expression-rest/expected.json create mode 100644 test/fixtures/esprima/es2015-yield/invalid-yield-generator-expression-rest/options.json create mode 100644 test/fixtures/esprima/es2015-yield/invalid-yield-generator-function-declaration/actual.js create mode 100644 test/fixtures/esprima/es2015-yield/invalid-yield-generator-function-declaration/options.json create mode 100644 test/fixtures/esprima/es2015-yield/invalid-yield-generator-lexical-declaration/actual.js create mode 100644 test/fixtures/esprima/es2015-yield/invalid-yield-generator-lexical-declaration/options.json create mode 100644 test/fixtures/esprima/es2015-yield/invalid-yield-generator-member-expression/actual.js create mode 100644 test/fixtures/esprima/es2015-yield/invalid-yield-generator-member-expression/options.json create mode 100644 test/fixtures/esprima/es2015-yield/invalid-yield-generator-parameter/actual.js create mode 100644 test/fixtures/esprima/es2015-yield/invalid-yield-generator-parameter/expected.json create mode 100644 test/fixtures/esprima/es2015-yield/invalid-yield-generator-parameter/options.json create mode 100644 test/fixtures/esprima/es2015-yield/invalid-yield-generator-rest/actual.js create mode 100644 test/fixtures/esprima/es2015-yield/invalid-yield-generator-rest/expected.json create mode 100644 test/fixtures/esprima/es2015-yield/invalid-yield-generator-rest/options.json create mode 100644 test/fixtures/esprima/es2015-yield/invalid-yield-generator-strict-function-expression/actual.js create mode 100644 test/fixtures/esprima/es2015-yield/invalid-yield-generator-strict-function-expression/options.json create mode 100644 test/fixtures/esprima/es2015-yield/invalid-yield-generator-strict-function-parameter/actual.js create mode 100644 test/fixtures/esprima/es2015-yield/invalid-yield-generator-strict-function-parameter/options.json create mode 100644 test/fixtures/esprima/es2015-yield/invalid-yield-generator-variable-declaration/actual.js create mode 100644 test/fixtures/esprima/es2015-yield/invalid-yield-generator-variable-declaration/expected.json create mode 100644 test/fixtures/esprima/es2015-yield/invalid-yield-generator-variable-declaration/options.json create mode 100644 test/fixtures/esprima/es2015-yield/invalid-yield-strict-array-pattern/actual.js create mode 100644 test/fixtures/esprima/es2015-yield/invalid-yield-strict-array-pattern/options.json create mode 100644 test/fixtures/esprima/es2015-yield/invalid-yield-strict-arrow-parameter-default/actual.js create mode 100644 test/fixtures/esprima/es2015-yield/invalid-yield-strict-arrow-parameter-default/expected.json create mode 100644 test/fixtures/esprima/es2015-yield/invalid-yield-strict-arrow-parameter-default/options.json create mode 100644 test/fixtures/esprima/es2015-yield/invalid-yield-strict-arrow-parameter-name/actual.js create mode 100644 test/fixtures/esprima/es2015-yield/invalid-yield-strict-arrow-parameter-name/options.json create mode 100644 test/fixtures/esprima/es2015-yield/invalid-yield-strict-binding-element/actual.js create mode 100644 test/fixtures/esprima/es2015-yield/invalid-yield-strict-binding-element/options.json create mode 100644 test/fixtures/esprima/es2015-yield/invalid-yield-strict-catch-parameter/actual.js create mode 100644 test/fixtures/esprima/es2015-yield/invalid-yield-strict-catch-parameter/options.json create mode 100644 test/fixtures/esprima/es2015-yield/invalid-yield-strict-formal-parameter/actual.js create mode 100644 test/fixtures/esprima/es2015-yield/invalid-yield-strict-formal-parameter/options.json create mode 100644 test/fixtures/esprima/es2015-yield/invalid-yield-strict-function-declaration/actual.js create mode 100644 test/fixtures/esprima/es2015-yield/invalid-yield-strict-function-declaration/expected.json create mode 100644 test/fixtures/esprima/es2015-yield/invalid-yield-strict-function-declaration/options.json create mode 100644 test/fixtures/esprima/es2015-yield/invalid-yield-strict-function-expression/actual.js create mode 100644 test/fixtures/esprima/es2015-yield/invalid-yield-strict-function-expression/expected.json create mode 100644 test/fixtures/esprima/es2015-yield/invalid-yield-strict-function-expression/options.json create mode 100644 test/fixtures/esprima/es2015-yield/invalid-yield-strict-identifier/actual.js create mode 100644 test/fixtures/esprima/es2015-yield/invalid-yield-strict-identifier/options.json create mode 100644 test/fixtures/esprima/es2015-yield/invalid-yield-strict-lexical-declaration/actual.js create mode 100644 test/fixtures/esprima/es2015-yield/invalid-yield-strict-lexical-declaration/options.json create mode 100644 test/fixtures/esprima/es2015-yield/invalid-yield-strict-rest-parameter/actual.js create mode 100644 test/fixtures/esprima/es2015-yield/invalid-yield-strict-rest-parameter/options.json create mode 100644 test/fixtures/esprima/es2015-yield/invalid-yield-strict-variable-declaration/actual.js create mode 100644 test/fixtures/esprima/es2015-yield/invalid-yield-strict-variable-declaration/options.json create mode 100644 test/fixtures/esprima/es2015-yield/yield-array-pattern/actual.js create mode 100644 test/fixtures/esprima/es2015-yield/yield-array-pattern/expected.json create mode 100644 test/fixtures/esprima/es2015-yield/yield-arrow-concise-body/actual.js create mode 100644 test/fixtures/esprima/es2015-yield/yield-arrow-concise-body/expected.json create mode 100644 test/fixtures/esprima/es2015-yield/yield-arrow-function-body/actual.js create mode 100644 test/fixtures/esprima/es2015-yield/yield-arrow-function-body/expected.json create mode 100644 test/fixtures/esprima/es2015-yield/yield-arrow-parameter-default/actual.js create mode 100644 test/fixtures/esprima/es2015-yield/yield-arrow-parameter-default/expected.json create mode 100644 test/fixtures/esprima/es2015-yield/yield-arrow-parameter-name/actual.js create mode 100644 test/fixtures/esprima/es2015-yield/yield-arrow-parameter-name/expected.json create mode 100644 test/fixtures/esprima/es2015-yield/yield-binding-element/actual.js create mode 100644 test/fixtures/esprima/es2015-yield/yield-binding-element/expected.json create mode 100644 test/fixtures/esprima/es2015-yield/yield-binding-property/actual.js create mode 100644 test/fixtures/esprima/es2015-yield/yield-binding-property/expected.json create mode 100644 test/fixtures/esprima/es2015-yield/yield-call-expression-property/actual.js create mode 100644 test/fixtures/esprima/es2015-yield/yield-call-expression-property/expected.json create mode 100644 test/fixtures/esprima/es2015-yield/yield-catch-parameter/actual.js create mode 100644 test/fixtures/esprima/es2015-yield/yield-catch-parameter/expected.json create mode 100644 test/fixtures/esprima/es2015-yield/yield-expression-precedence/actual.js create mode 100644 test/fixtures/esprima/es2015-yield/yield-expression-precedence/expected.json create mode 100644 test/fixtures/esprima/es2015-yield/yield-function-declaration-formal-parameter/actual.js create mode 100644 test/fixtures/esprima/es2015-yield/yield-function-declaration-formal-parameter/expected.json create mode 100644 test/fixtures/esprima/es2015-yield/yield-function-declaration/actual.js create mode 100644 test/fixtures/esprima/es2015-yield/yield-function-declaration/expected.json create mode 100644 test/fixtures/esprima/es2015-yield/yield-function-expression-parameter/actual.js create mode 100644 test/fixtures/esprima/es2015-yield/yield-function-expression-parameter/expected.json create mode 100644 test/fixtures/esprima/es2015-yield/yield-function-expression/actual.js create mode 100644 test/fixtures/esprima/es2015-yield/yield-function-expression/expected.json create mode 100644 test/fixtures/esprima/es2015-yield/yield-generator-arrow-concise-body/actual.js create mode 100644 test/fixtures/esprima/es2015-yield/yield-generator-arrow-concise-body/expected.json create mode 100644 test/fixtures/esprima/es2015-yield/yield-generator-arrow-default/actual.js create mode 100644 test/fixtures/esprima/es2015-yield/yield-generator-arrow-default/expected.json create mode 100644 test/fixtures/esprima/es2015-yield/yield-generator-arrow-function-body/actual.js create mode 100644 test/fixtures/esprima/es2015-yield/yield-generator-arrow-function-body/expected.json create mode 100644 test/fixtures/esprima/es2015-yield/yield-generator-declaration/actual.js create mode 100644 test/fixtures/esprima/es2015-yield/yield-generator-declaration/expected.json create mode 100644 test/fixtures/esprima/es2015-yield/yield-generator-default-parameter/actual.js create mode 100644 test/fixtures/esprima/es2015-yield/yield-generator-default-parameter/expected.json create mode 100644 test/fixtures/esprima/es2015-yield/yield-generator-function-expression/actual.js create mode 100644 test/fixtures/esprima/es2015-yield/yield-generator-function-parameter/actual.js create mode 100644 test/fixtures/esprima/es2015-yield/yield-generator-function-parameter/expected.json create mode 100644 test/fixtures/esprima/es2015-yield/yield-generator-method/actual.js create mode 100644 test/fixtures/esprima/es2015-yield/yield-generator-method/expected.json create mode 100644 test/fixtures/esprima/es2015-yield/yield-generator-parameter-object-pattern/actual.js create mode 100644 test/fixtures/esprima/es2015-yield/yield-generator-parameter-object-pattern/expected.json create mode 100644 test/fixtures/esprima/es2015-yield/yield-lexical-declaration/actual.js create mode 100644 test/fixtures/esprima/es2015-yield/yield-lexical-declaration/expected.json create mode 100644 test/fixtures/esprima/es2015-yield/yield-member-expression-property/actual.js create mode 100644 test/fixtures/esprima/es2015-yield/yield-member-expression-property/expected.json create mode 100644 test/fixtures/esprima/es2015-yield/yield-method/actual.js create mode 100644 test/fixtures/esprima/es2015-yield/yield-method/expected.json create mode 100644 test/fixtures/esprima/es2015-yield/yield-parameter-object-pattern/actual.js create mode 100644 test/fixtures/esprima/es2015-yield/yield-parameter-object-pattern/expected.json create mode 100644 test/fixtures/esprima/es2015-yield/yield-rest-parameter/actual.js create mode 100644 test/fixtures/esprima/es2015-yield/yield-rest-parameter/expected.json create mode 100644 test/fixtures/esprima/es2015-yield/yield-strict-binding-property/actual.js create mode 100644 test/fixtures/esprima/es2015-yield/yield-strict-binding-property/expected.json create mode 100644 test/fixtures/esprima/es2015-yield/yield-strict-method/actual.js create mode 100644 test/fixtures/esprima/es2015-yield/yield-strict-method/expected.json create mode 100644 test/fixtures/esprima/es2015-yield/yield-super-property/actual.js create mode 100644 test/fixtures/esprima/es2015-yield/yield-super-property/expected.json create mode 100644 test/fixtures/esprima/es2015-yield/yield-variable-declaration/actual.js create mode 100644 test/fixtures/esprima/es2015-yield/yield-variable-declaration/expected.json create mode 100644 test/fixtures/esprima/es2015-yield/yield-yield-expression-delegate/actual.js create mode 100644 test/fixtures/esprima/es2015-yield/yield-yield-expression-delegate/expected.json create mode 100644 test/fixtures/esprima/es2015-yield/yield-yield-expression/actual.js create mode 100644 test/fixtures/esprima/es2015-yield/yield-yield-expression/expected.json create mode 100644 test/fixtures/esprima/expression-additive/migrated_0000/actual.js create mode 100644 test/fixtures/esprima/expression-additive/migrated_0000/expected.json create mode 100644 test/fixtures/esprima/expression-additive/migrated_0001/actual.js create mode 100644 test/fixtures/esprima/expression-additive/migrated_0001/expected.json create mode 100644 test/fixtures/esprima/expression-additive/migrated_0002/actual.js create mode 100644 test/fixtures/esprima/expression-additive/migrated_0002/expected.json create mode 100644 test/fixtures/esprima/expression-assignment/migrated_0000/actual.js create mode 100644 test/fixtures/esprima/expression-assignment/migrated_0000/expected.json create mode 100644 test/fixtures/esprima/expression-assignment/migrated_0001/actual.js create mode 100644 test/fixtures/esprima/expression-assignment/migrated_0001/expected.json create mode 100644 test/fixtures/esprima/expression-assignment/migrated_0002/actual.js create mode 100644 test/fixtures/esprima/expression-assignment/migrated_0002/expected.json create mode 100644 test/fixtures/esprima/expression-assignment/migrated_0003/actual.js create mode 100644 test/fixtures/esprima/expression-assignment/migrated_0003/expected.json create mode 100644 test/fixtures/esprima/expression-assignment/migrated_0004/actual.js create mode 100644 test/fixtures/esprima/expression-assignment/migrated_0004/expected.json create mode 100644 test/fixtures/esprima/expression-assignment/migrated_0005/actual.js create mode 100644 test/fixtures/esprima/expression-assignment/migrated_0005/expected.json create mode 100644 test/fixtures/esprima/expression-assignment/migrated_0006/actual.js create mode 100644 test/fixtures/esprima/expression-assignment/migrated_0006/expected.json create mode 100644 test/fixtures/esprima/expression-assignment/migrated_0007/actual.js create mode 100644 test/fixtures/esprima/expression-assignment/migrated_0007/expected.json create mode 100644 test/fixtures/esprima/expression-assignment/migrated_0008/actual.js create mode 100644 test/fixtures/esprima/expression-assignment/migrated_0008/expected.json create mode 100644 test/fixtures/esprima/expression-assignment/migrated_0009/actual.js create mode 100644 test/fixtures/esprima/expression-assignment/migrated_0009/expected.json create mode 100644 test/fixtures/esprima/expression-assignment/migrated_0010/actual.js create mode 100644 test/fixtures/esprima/expression-assignment/migrated_0010/expected.json create mode 100644 test/fixtures/esprima/expression-assignment/migrated_0011/actual.js create mode 100644 test/fixtures/esprima/expression-assignment/migrated_0011/expected.json create mode 100644 test/fixtures/esprima/expression-assignment/migrated_0012/actual.js create mode 100644 test/fixtures/esprima/expression-assignment/migrated_0012/expected.json create mode 100644 test/fixtures/esprima/expression-assignment/migrated_0013/actual.js create mode 100644 test/fixtures/esprima/expression-assignment/migrated_0013/expected.json create mode 100644 test/fixtures/esprima/expression-binary-bitwise/migrated_0000/actual.js create mode 100644 test/fixtures/esprima/expression-binary-bitwise/migrated_0000/expected.json create mode 100644 test/fixtures/esprima/expression-binary-bitwise/migrated_0001/actual.js create mode 100644 test/fixtures/esprima/expression-binary-bitwise/migrated_0001/expected.json create mode 100644 test/fixtures/esprima/expression-binary-bitwise/migrated_0002/actual.js create mode 100644 test/fixtures/esprima/expression-binary-bitwise/migrated_0002/expected.json create mode 100644 test/fixtures/esprima/expression-binary-logical/migrated_0000/actual.js create mode 100644 test/fixtures/esprima/expression-binary-logical/migrated_0000/expected.json create mode 100644 test/fixtures/esprima/expression-binary-logical/migrated_0001/actual.js create mode 100644 test/fixtures/esprima/expression-binary-logical/migrated_0001/expected.json create mode 100644 test/fixtures/esprima/expression-binary-logical/migrated_0002/actual.js create mode 100644 test/fixtures/esprima/expression-binary-logical/migrated_0002/expected.json create mode 100644 test/fixtures/esprima/expression-binary-logical/migrated_0003/actual.js create mode 100644 test/fixtures/esprima/expression-binary-logical/migrated_0003/expected.json create mode 100644 test/fixtures/esprima/expression-binary-logical/migrated_0004/actual.js create mode 100644 test/fixtures/esprima/expression-binary-logical/migrated_0004/expected.json create mode 100644 test/fixtures/esprima/expression-binary-logical/migrated_0005/actual.js create mode 100644 test/fixtures/esprima/expression-binary-logical/migrated_0005/expected.json create mode 100644 test/fixtures/esprima/expression-binary/migrated_0000/actual.js create mode 100644 test/fixtures/esprima/expression-binary/migrated_0000/expected.json create mode 100644 test/fixtures/esprima/expression-binary/migrated_0001/actual.js create mode 100644 test/fixtures/esprima/expression-binary/migrated_0001/expected.json create mode 100644 test/fixtures/esprima/expression-binary/migrated_0002/actual.js create mode 100644 test/fixtures/esprima/expression-binary/migrated_0002/expected.json create mode 100644 test/fixtures/esprima/expression-binary/migrated_0003/actual.js create mode 100644 test/fixtures/esprima/expression-binary/migrated_0003/expected.json create mode 100644 test/fixtures/esprima/expression-binary/migrated_0004/actual.js create mode 100644 test/fixtures/esprima/expression-binary/migrated_0004/expected.json create mode 100644 test/fixtures/esprima/expression-binary/migrated_0005/actual.js create mode 100644 test/fixtures/esprima/expression-binary/migrated_0005/expected.json create mode 100644 test/fixtures/esprima/expression-binary/migrated_0006/actual.js create mode 100644 test/fixtures/esprima/expression-binary/migrated_0006/expected.json create mode 100644 test/fixtures/esprima/expression-binary/migrated_0007/actual.js create mode 100644 test/fixtures/esprima/expression-binary/migrated_0007/expected.json create mode 100644 test/fixtures/esprima/expression-binary/migrated_0008/actual.js create mode 100644 test/fixtures/esprima/expression-binary/migrated_0008/expected.json create mode 100644 test/fixtures/esprima/expression-binary/migrated_0009/actual.js create mode 100644 test/fixtures/esprima/expression-binary/migrated_0009/expected.json create mode 100644 test/fixtures/esprima/expression-binary/migrated_0010/actual.js create mode 100644 test/fixtures/esprima/expression-binary/migrated_0010/expected.json create mode 100644 test/fixtures/esprima/expression-binary/migrated_0011/actual.js create mode 100644 test/fixtures/esprima/expression-binary/migrated_0011/expected.json create mode 100644 test/fixtures/esprima/expression-binary/migrated_0012/actual.js create mode 100644 test/fixtures/esprima/expression-binary/migrated_0012/expected.json create mode 100644 test/fixtures/esprima/expression-binary/migrated_0013/actual.js create mode 100644 test/fixtures/esprima/expression-binary/migrated_0013/expected.json create mode 100644 test/fixtures/esprima/expression-binary/migrated_0014/actual.js create mode 100644 test/fixtures/esprima/expression-binary/migrated_0014/expected.json create mode 100644 test/fixtures/esprima/expression-binary/migrated_0015/actual.js create mode 100644 test/fixtures/esprima/expression-binary/migrated_0015/expected.json create mode 100644 test/fixtures/esprima/expression-binary/migrated_0016/actual.js create mode 100644 test/fixtures/esprima/expression-binary/migrated_0016/expected.json create mode 100644 test/fixtures/esprima/expression-binary/migrated_0017/actual.js create mode 100644 test/fixtures/esprima/expression-binary/migrated_0017/expected.json create mode 100644 test/fixtures/esprima/expression-bitwise-shift/migrated_0000/actual.js create mode 100644 test/fixtures/esprima/expression-bitwise-shift/migrated_0000/expected.json create mode 100644 test/fixtures/esprima/expression-bitwise-shift/migrated_0001/actual.js create mode 100644 test/fixtures/esprima/expression-bitwise-shift/migrated_0001/expected.json create mode 100644 test/fixtures/esprima/expression-bitwise-shift/migrated_0002/actual.js create mode 100644 test/fixtures/esprima/expression-bitwise-shift/migrated_0002/expected.json create mode 100644 test/fixtures/esprima/expression-complex/migrated_0000/actual.js create mode 100644 test/fixtures/esprima/expression-complex/migrated_0000/expected.json create mode 100644 test/fixtures/esprima/expression-conditional/migrated_0000/actual.js create mode 100644 test/fixtures/esprima/expression-conditional/migrated_0000/expected.json create mode 100644 test/fixtures/esprima/expression-conditional/migrated_0001/actual.js create mode 100644 test/fixtures/esprima/expression-conditional/migrated_0001/expected.json create mode 100644 test/fixtures/esprima/expression-conditional/migrated_0002/actual.js create mode 100644 test/fixtures/esprima/expression-conditional/migrated_0002/expected.json create mode 100644 test/fixtures/esprima/expression-equality/migrated_0000/actual.js create mode 100644 test/fixtures/esprima/expression-equality/migrated_0000/expected.json create mode 100644 test/fixtures/esprima/expression-equality/migrated_0001/actual.js create mode 100644 test/fixtures/esprima/expression-equality/migrated_0001/expected.json create mode 100644 test/fixtures/esprima/expression-equality/migrated_0002/actual.js create mode 100644 test/fixtures/esprima/expression-equality/migrated_0002/expected.json create mode 100644 test/fixtures/esprima/expression-equality/migrated_0003/actual.js create mode 100644 test/fixtures/esprima/expression-equality/migrated_0003/expected.json create mode 100644 test/fixtures/esprima/expression-grouping/migrated_0000/actual.js create mode 100644 test/fixtures/esprima/expression-grouping/migrated_0000/expected.json create mode 100644 test/fixtures/esprima/expression-grouping/migrated_0001/actual.js create mode 100644 test/fixtures/esprima/expression-grouping/migrated_0001/expected.json create mode 100644 test/fixtures/esprima/expression-left-hand-side/migrated_0000/actual.js create mode 100644 test/fixtures/esprima/expression-left-hand-side/migrated_0000/expected.json create mode 100644 test/fixtures/esprima/expression-left-hand-side/migrated_0001/actual.js create mode 100644 test/fixtures/esprima/expression-left-hand-side/migrated_0001/expected.json create mode 100644 test/fixtures/esprima/expression-left-hand-side/migrated_0002/actual.js create mode 100644 test/fixtures/esprima/expression-left-hand-side/migrated_0002/expected.json create mode 100644 test/fixtures/esprima/expression-left-hand-side/migrated_0003/actual.js create mode 100644 test/fixtures/esprima/expression-left-hand-side/migrated_0003/expected.json create mode 100644 test/fixtures/esprima/expression-left-hand-side/migrated_0004/actual.js create mode 100644 test/fixtures/esprima/expression-left-hand-side/migrated_0004/expected.json create mode 100644 test/fixtures/esprima/expression-left-hand-side/migrated_0005/actual.js create mode 100644 test/fixtures/esprima/expression-left-hand-side/migrated_0005/expected.json create mode 100644 test/fixtures/esprima/expression-left-hand-side/migrated_0006/actual.js create mode 100644 test/fixtures/esprima/expression-left-hand-side/migrated_0006/expected.json create mode 100644 test/fixtures/esprima/expression-left-hand-side/migrated_0007/actual.js create mode 100644 test/fixtures/esprima/expression-left-hand-side/migrated_0007/expected.json create mode 100644 test/fixtures/esprima/expression-left-hand-side/migrated_0008/actual.js create mode 100644 test/fixtures/esprima/expression-left-hand-side/migrated_0008/expected.json create mode 100644 test/fixtures/esprima/expression-left-hand-side/migrated_0009/actual.js create mode 100644 test/fixtures/esprima/expression-left-hand-side/migrated_0009/expected.json create mode 100644 test/fixtures/esprima/expression-left-hand-side/migrated_0010/actual.js create mode 100644 test/fixtures/esprima/expression-left-hand-side/migrated_0010/expected.json create mode 100644 test/fixtures/esprima/expression-left-hand-side/migrated_0011/actual.js create mode 100644 test/fixtures/esprima/expression-left-hand-side/migrated_0011/expected.json create mode 100644 test/fixtures/esprima/expression-left-hand-side/migrated_0012/actual.js create mode 100644 test/fixtures/esprima/expression-left-hand-side/migrated_0012/expected.json create mode 100644 test/fixtures/esprima/expression-left-hand-side/migrated_0013/actual.js create mode 100644 test/fixtures/esprima/expression-left-hand-side/migrated_0013/expected.json create mode 100644 test/fixtures/esprima/expression-left-hand-side/migrated_0014/actual.js create mode 100644 test/fixtures/esprima/expression-left-hand-side/migrated_0014/expected.json create mode 100644 test/fixtures/esprima/expression-left-hand-side/migrated_0015/actual.js create mode 100644 test/fixtures/esprima/expression-left-hand-side/migrated_0015/expected.json create mode 100644 test/fixtures/esprima/expression-left-hand-side/migrated_0016/actual.js create mode 100644 test/fixtures/esprima/expression-left-hand-side/migrated_0016/expected.json create mode 100644 test/fixtures/esprima/expression-left-hand-side/migrated_0017/actual.js create mode 100644 test/fixtures/esprima/expression-left-hand-side/migrated_0017/expected.json create mode 100644 test/fixtures/esprima/expression-left-hand-side/migrated_0018/actual.js create mode 100644 test/fixtures/esprima/expression-left-hand-side/migrated_0018/expected.json create mode 100644 test/fixtures/esprima/expression-left-hand-side/migrated_0019/actual.js create mode 100644 test/fixtures/esprima/expression-left-hand-side/migrated_0019/expected.json create mode 100644 test/fixtures/esprima/expression-left-hand-side/migrated_0020/actual.js create mode 100644 test/fixtures/esprima/expression-left-hand-side/migrated_0020/expected.json create mode 100644 test/fixtures/esprima/expression-left-hand-side/migrated_0021/actual.js create mode 100644 test/fixtures/esprima/expression-left-hand-side/migrated_0021/expected.json create mode 100644 test/fixtures/esprima/expression-left-hand-side/migrated_0022/actual.js create mode 100644 test/fixtures/esprima/expression-left-hand-side/migrated_0022/expected.json create mode 100644 test/fixtures/esprima/expression-multiplicative/migrated_0000/actual.js create mode 100644 test/fixtures/esprima/expression-multiplicative/migrated_0000/expected.json create mode 100644 test/fixtures/esprima/expression-multiplicative/migrated_0001/actual.js create mode 100644 test/fixtures/esprima/expression-multiplicative/migrated_0001/expected.json create mode 100644 test/fixtures/esprima/expression-multiplicative/migrated_0002/actual.js create mode 100644 test/fixtures/esprima/expression-multiplicative/migrated_0002/expected.json create mode 100644 test/fixtures/esprima/expression-postfix/migrated_0000/actual.js create mode 100644 test/fixtures/esprima/expression-postfix/migrated_0000/expected.json create mode 100644 test/fixtures/esprima/expression-postfix/migrated_0001/actual.js create mode 100644 test/fixtures/esprima/expression-postfix/migrated_0001/expected.json create mode 100644 test/fixtures/esprima/expression-postfix/migrated_0002/actual.js create mode 100644 test/fixtures/esprima/expression-postfix/migrated_0002/expected.json create mode 100644 test/fixtures/esprima/expression-postfix/migrated_0003/actual.js create mode 100644 test/fixtures/esprima/expression-postfix/migrated_0003/expected.json create mode 100644 test/fixtures/esprima/expression-postfix/migrated_0004/actual.js create mode 100644 test/fixtures/esprima/expression-postfix/migrated_0004/expected.json create mode 100644 test/fixtures/esprima/expression-postfix/migrated_0005/actual.js create mode 100644 test/fixtures/esprima/expression-postfix/migrated_0005/expected.json create mode 100644 test/fixtures/esprima/expression-primary/array/expected.json create mode 100755 test/fixtures/esprima/expression-primary/array/migrated_0000.js create mode 100755 test/fixtures/esprima/expression-primary/array/migrated_0001.js create mode 100755 test/fixtures/esprima/expression-primary/array/migrated_0002.js create mode 100755 test/fixtures/esprima/expression-primary/array/migrated_0003.js create mode 100755 test/fixtures/esprima/expression-primary/array/migrated_0004.js create mode 100755 test/fixtures/esprima/expression-primary/array/migrated_0005.js create mode 100755 test/fixtures/esprima/expression-primary/array/migrated_0006.js create mode 100755 test/fixtures/esprima/expression-primary/array/migrated_0007.js create mode 100755 test/fixtures/esprima/expression-primary/array/migrated_0008.source.js create mode 100755 test/fixtures/esprima/expression-primary/array/migrated_0009.source.js create mode 100755 test/fixtures/esprima/expression-primary/array/migrated_0010.source.js create mode 100755 test/fixtures/esprima/expression-primary/array/migrated_0011.source.js create mode 100755 test/fixtures/esprima/expression-primary/array/migrated_0012.source.js create mode 100644 test/fixtures/esprima/expression-primary/literal/expected.json create mode 100755 test/fixtures/esprima/expression-primary/literal/numeric/migrated_0000.js create mode 100755 test/fixtures/esprima/expression-primary/literal/numeric/migrated_0001.js create mode 100755 test/fixtures/esprima/expression-primary/literal/numeric/migrated_0002.js create mode 100755 test/fixtures/esprima/expression-primary/literal/numeric/migrated_0003.js create mode 100755 test/fixtures/esprima/expression-primary/literal/numeric/migrated_0004.js create mode 100755 test/fixtures/esprima/expression-primary/literal/numeric/migrated_0005.js create mode 100755 test/fixtures/esprima/expression-primary/literal/numeric/migrated_0006.js create mode 100755 test/fixtures/esprima/expression-primary/literal/numeric/migrated_0007.js create mode 100755 test/fixtures/esprima/expression-primary/literal/numeric/migrated_0008.js create mode 100755 test/fixtures/esprima/expression-primary/literal/numeric/migrated_0009.js create mode 100755 test/fixtures/esprima/expression-primary/literal/numeric/migrated_0010.js create mode 100755 test/fixtures/esprima/expression-primary/literal/numeric/migrated_0011.js create mode 100755 test/fixtures/esprima/expression-primary/literal/numeric/migrated_0012.js create mode 100755 test/fixtures/esprima/expression-primary/literal/numeric/migrated_0013.js create mode 100755 test/fixtures/esprima/expression-primary/literal/numeric/migrated_0014.js create mode 100755 test/fixtures/esprima/expression-primary/literal/numeric/migrated_0015.js create mode 100755 test/fixtures/esprima/expression-primary/literal/numeric/migrated_0016.js create mode 100755 test/fixtures/esprima/expression-primary/literal/numeric/migrated_0017.js create mode 100755 test/fixtures/esprima/expression-primary/literal/numeric/migrated_0018.js create mode 100755 test/fixtures/esprima/expression-primary/literal/numeric/migrated_0019.js create mode 100755 test/fixtures/esprima/expression-primary/literal/numeric/migrated_0020.js create mode 100755 test/fixtures/esprima/expression-primary/literal/numeric/migrated_0021.js create mode 100755 test/fixtures/esprima/expression-primary/literal/numeric/migrated_0022.js create mode 100755 test/fixtures/esprima/expression-primary/literal/numeric/migrated_0023.js create mode 100755 test/fixtures/esprima/expression-primary/literal/numeric/migrated_0024.js create mode 100755 test/fixtures/esprima/expression-primary/literal/regular-expression/migrated_0000.js create mode 100755 test/fixtures/esprima/expression-primary/literal/regular-expression/migrated_0001.js create mode 100755 test/fixtures/esprima/expression-primary/literal/regular-expression/migrated_0002.js create mode 100755 test/fixtures/esprima/expression-primary/literal/regular-expression/migrated_0003.js create mode 100755 test/fixtures/esprima/expression-primary/literal/regular-expression/migrated_0004.js create mode 100755 test/fixtures/esprima/expression-primary/literal/regular-expression/migrated_0005.source.js create mode 100755 test/fixtures/esprima/expression-primary/literal/regular-expression/migrated_0006.failure.json create mode 100755 test/fixtures/esprima/expression-primary/literal/regular-expression/migrated_0006.source.js create mode 100755 test/fixtures/esprima/expression-primary/literal/regular-expression/migrated_0007.js create mode 100755 test/fixtures/esprima/expression-primary/literal/regular-expression/migrated_0008.js create mode 100755 test/fixtures/esprima/expression-primary/literal/regular-expression/migrated_0009.js create mode 100755 test/fixtures/esprima/expression-primary/literal/regular-expression/migrated_0010.js create mode 100755 test/fixtures/esprima/expression-primary/literal/regular-expression/migrated_0011.js create mode 100755 test/fixtures/esprima/expression-primary/literal/regular-expression/migrated_0012.js create mode 100755 test/fixtures/esprima/expression-primary/literal/regular-expression/migrated_0013.js create mode 100755 test/fixtures/esprima/expression-primary/literal/regular-expression/u-flag-invalid-range-4-hex.failure.json create mode 100755 test/fixtures/esprima/expression-primary/literal/regular-expression/u-flag-invalid-range-4-hex.js create mode 100755 test/fixtures/esprima/expression-primary/literal/regular-expression/u-flag-invalid-range-var-hex.failure.json create mode 100755 test/fixtures/esprima/expression-primary/literal/regular-expression/u-flag-invalid-range-var-hex.js create mode 100755 test/fixtures/esprima/expression-primary/literal/regular-expression/u-flag-surrogate-pair.js create mode 100755 test/fixtures/esprima/expression-primary/literal/regular-expression/u-flag-valid-range.js create mode 100755 test/fixtures/esprima/expression-primary/literal/string/migrated_0000.js create mode 100755 test/fixtures/esprima/expression-primary/literal/string/migrated_0001.js create mode 100755 test/fixtures/esprima/expression-primary/literal/string/migrated_0002.source.js create mode 100755 test/fixtures/esprima/expression-primary/literal/string/migrated_0003.js create mode 100755 test/fixtures/esprima/expression-primary/literal/string/migrated_0006.js create mode 100755 test/fixtures/esprima/expression-primary/literal/string/migrated_0007.js create mode 100755 test/fixtures/esprima/expression-primary/literal/string/migrated_0008.js create mode 100755 test/fixtures/esprima/expression-primary/literal/string/migrated_0009.js create mode 100755 test/fixtures/esprima/expression-primary/literal/string/migrated_0010.js create mode 100755 test/fixtures/esprima/expression-primary/literal/string/migrated_0011.js create mode 100755 test/fixtures/esprima/expression-primary/literal/string/migrated_0012.js create mode 100755 test/fixtures/esprima/expression-primary/literal/string/migrated_0013.js create mode 100755 test/fixtures/esprima/expression-primary/literal/string/migrated_0015.js create mode 100755 test/fixtures/esprima/expression-primary/literal/string/migrated_0016.js create mode 100755 test/fixtures/esprima/expression-primary/literal/string/migrated_0017.js create mode 100755 test/fixtures/esprima/expression-primary/literal/string/migrated_0018.js create mode 100644 test/fixtures/esprima/expression-primary/object/expected.json create mode 100755 test/fixtures/esprima/expression-primary/object/migrated_0000.js create mode 100755 test/fixtures/esprima/expression-primary/object/migrated_0001.js create mode 100755 test/fixtures/esprima/expression-primary/object/migrated_0002.js create mode 100755 test/fixtures/esprima/expression-primary/object/migrated_0003.js create mode 100755 test/fixtures/esprima/expression-primary/object/migrated_0004.js create mode 100755 test/fixtures/esprima/expression-primary/object/migrated_0005.js create mode 100755 test/fixtures/esprima/expression-primary/object/migrated_0006.js create mode 100755 test/fixtures/esprima/expression-primary/object/migrated_0007.js create mode 100755 test/fixtures/esprima/expression-primary/object/migrated_0008.js create mode 100755 test/fixtures/esprima/expression-primary/object/migrated_0009.js create mode 100755 test/fixtures/esprima/expression-primary/object/migrated_0010.js create mode 100755 test/fixtures/esprima/expression-primary/object/migrated_0011.js create mode 100755 test/fixtures/esprima/expression-primary/object/migrated_0012.js create mode 100755 test/fixtures/esprima/expression-primary/object/migrated_0013.js create mode 100755 test/fixtures/esprima/expression-primary/object/migrated_0014.js create mode 100755 test/fixtures/esprima/expression-primary/object/migrated_0015.js create mode 100755 test/fixtures/esprima/expression-primary/object/migrated_0016.js create mode 100755 test/fixtures/esprima/expression-primary/object/migrated_0017.js create mode 100755 test/fixtures/esprima/expression-primary/object/migrated_0018.js create mode 100755 test/fixtures/esprima/expression-primary/object/migrated_0019.js create mode 100755 test/fixtures/esprima/expression-primary/object/migrated_0020.js create mode 100755 test/fixtures/esprima/expression-primary/object/migrated_0021.js create mode 100755 test/fixtures/esprima/expression-primary/object/migrated_0022.js create mode 100755 test/fixtures/esprima/expression-primary/object/migrated_0023.js create mode 100755 test/fixtures/esprima/expression-primary/object/migrated_0024.js create mode 100755 test/fixtures/esprima/expression-primary/object/migrated_0025.js create mode 100755 test/fixtures/esprima/expression-primary/object/migrated_0026.js create mode 100755 test/fixtures/esprima/expression-primary/object/migrated_0027.js create mode 100755 test/fixtures/esprima/expression-primary/object/migrated_0028.js create mode 100755 test/fixtures/esprima/expression-primary/object/migrated_0029.js create mode 100755 test/fixtures/esprima/expression-primary/object/migrated_0030.js create mode 100755 test/fixtures/esprima/expression-primary/object/migrated_0031.js create mode 100755 test/fixtures/esprima/expression-primary/object/migrated_0032.js create mode 100755 test/fixtures/esprima/expression-primary/object/migrated_0033.js create mode 100755 test/fixtures/esprima/expression-primary/object/migrated_0034.js create mode 100755 test/fixtures/esprima/expression-primary/object/migrated_0035.js create mode 100755 test/fixtures/esprima/expression-primary/object/migrated_0036.js create mode 100755 test/fixtures/esprima/expression-primary/object/migrated_0037.js create mode 100755 test/fixtures/esprima/expression-primary/object/migrated_0038.js create mode 100644 test/fixtures/esprima/expression-primary/other/expected.json create mode 100755 test/fixtures/esprima/expression-primary/other/migrated_0000.js create mode 100755 test/fixtures/esprima/expression-primary/other/migrated_0001.js create mode 100755 test/fixtures/esprima/expression-primary/other/migrated_0002.js create mode 100755 test/fixtures/esprima/expression-primary/other/migrated_0003.js create mode 100644 test/fixtures/esprima/expression-relational/migrated_0000/actual.js create mode 100644 test/fixtures/esprima/expression-relational/migrated_0000/expected.json create mode 100644 test/fixtures/esprima/expression-relational/migrated_0001/actual.js create mode 100644 test/fixtures/esprima/expression-relational/migrated_0001/expected.json create mode 100644 test/fixtures/esprima/expression-relational/migrated_0002/actual.js create mode 100644 test/fixtures/esprima/expression-relational/migrated_0002/expected.json create mode 100644 test/fixtures/esprima/expression-relational/migrated_0003/actual.js create mode 100644 test/fixtures/esprima/expression-relational/migrated_0003/expected.json create mode 100644 test/fixtures/esprima/expression-relational/migrated_0004/actual.js create mode 100644 test/fixtures/esprima/expression-relational/migrated_0004/expected.json create mode 100644 test/fixtures/esprima/expression-relational/migrated_0005/actual.js create mode 100644 test/fixtures/esprima/expression-relational/migrated_0005/expected.json create mode 100644 test/fixtures/esprima/expression-relational/migrated_0006/actual.js create mode 100644 test/fixtures/esprima/expression-relational/migrated_0006/expected.json create mode 100644 test/fixtures/esprima/expression-unary/migrated_0000/actual.js create mode 100644 test/fixtures/esprima/expression-unary/migrated_0000/expected.json create mode 100644 test/fixtures/esprima/expression-unary/migrated_0001/actual.js create mode 100644 test/fixtures/esprima/expression-unary/migrated_0001/expected.json create mode 100644 test/fixtures/esprima/expression-unary/migrated_0002/actual.js create mode 100644 test/fixtures/esprima/expression-unary/migrated_0002/expected.json create mode 100644 test/fixtures/esprima/expression-unary/migrated_0003/actual.js create mode 100644 test/fixtures/esprima/expression-unary/migrated_0003/expected.json create mode 100644 test/fixtures/esprima/expression-unary/migrated_0004/actual.js create mode 100644 test/fixtures/esprima/expression-unary/migrated_0004/expected.json create mode 100644 test/fixtures/esprima/expression-unary/migrated_0005/actual.js create mode 100644 test/fixtures/esprima/expression-unary/migrated_0005/expected.json create mode 100644 test/fixtures/esprima/expression-unary/migrated_0006/actual.js create mode 100644 test/fixtures/esprima/expression-unary/migrated_0006/expected.json create mode 100644 test/fixtures/esprima/expression-unary/migrated_0007/actual.js create mode 100644 test/fixtures/esprima/expression-unary/migrated_0007/expected.json create mode 100644 test/fixtures/esprima/expression-unary/migrated_0008/actual.js create mode 100644 test/fixtures/esprima/expression-unary/migrated_0008/expected.json create mode 100644 test/fixtures/esprima/expression-unary/migrated_0009/actual.js create mode 100644 test/fixtures/esprima/expression-unary/migrated_0009/expected.json create mode 100644 test/fixtures/esprima/expression-unary/migrated_0010/actual.js create mode 100644 test/fixtures/esprima/expression-unary/migrated_0010/expected.json create mode 100644 test/fixtures/esprima/expression-unary/migrated_0011/actual.js create mode 100644 test/fixtures/esprima/expression-unary/migrated_0011/expected.json create mode 100644 test/fixtures/esprima/expression-unary/migrated_0012/actual.js create mode 100644 test/fixtures/esprima/expression-unary/migrated_0012/expected.json create mode 100644 test/fixtures/esprima/invalid-syntax/GH-1106-00/actual.js create mode 100644 test/fixtures/esprima/invalid-syntax/GH-1106-00/options.json create mode 100644 test/fixtures/esprima/invalid-syntax/GH-1106-01/actual.js create mode 100644 test/fixtures/esprima/invalid-syntax/GH-1106-01/options.json create mode 100644 test/fixtures/esprima/invalid-syntax/GH-1106-02/actual.js create mode 100644 test/fixtures/esprima/invalid-syntax/GH-1106-02/options.json create mode 100644 test/fixtures/esprima/invalid-syntax/GH-1106-03/actual.js create mode 100644 test/fixtures/esprima/invalid-syntax/GH-1106-03/options.json create mode 100644 test/fixtures/esprima/invalid-syntax/GH-1106-04/actual.js create mode 100644 test/fixtures/esprima/invalid-syntax/GH-1106-04/options.json create mode 100644 test/fixtures/esprima/invalid-syntax/GH-1106-05/actual.js create mode 100644 test/fixtures/esprima/invalid-syntax/GH-1106-05/options.json create mode 100644 test/fixtures/esprima/invalid-syntax/GH-1106-06/actual.js create mode 100644 test/fixtures/esprima/invalid-syntax/GH-1106-06/options.json create mode 100644 test/fixtures/esprima/invalid-syntax/GH-1106-07/actual.js create mode 100644 test/fixtures/esprima/invalid-syntax/GH-1106-07/options.json create mode 100644 test/fixtures/esprima/invalid-syntax/GH-1106-09/actual.js create mode 100644 test/fixtures/esprima/invalid-syntax/GH-1106-09/expected.json create mode 100644 test/fixtures/esprima/invalid-syntax/GH-1106-09/options.json create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0000/actual.js create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0000/options.json create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0001/actual.js create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0001/options.json create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0002/actual.js create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0002/options.json create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0003/actual.js create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0003/options.json create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0004/actual.js create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0004/options.json create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0005/actual.js create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0005/options.json create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0006/actual.js create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0006/options.json create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0007/actual.js create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0007/options.json create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0008/actual.js create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0008/options.json create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0009/actual.js create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0009/options.json create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0010/actual.js create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0010/options.json create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0011/actual.js create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0011/options.json create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0012/actual.js create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0012/options.json create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0013/actual.js create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0013/options.json create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0014/actual.js create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0014/options.json create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0015/actual.js create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0015/options.json create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0016/actual.js create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0016/options.json create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0017/actual.js create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0017/options.json create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0018/actual.js create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0018/options.json create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0019/actual.js create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0019/options.json create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0020/actual.js create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0020/options.json create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0021/actual.js create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0021/options.json create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0022/actual.js create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0022/options.json create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0023/actual.js create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0023/options.json create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0024/actual.js create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0024/options.json create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0025/actual.js create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0025/options.json create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0026/actual.js create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0026/options.json create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0027/actual.js create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0027/options.json create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0028/actual.js create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0028/options.json create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0029/actual.js create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0029/options.json create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0030/actual.js create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0030/options.json create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0031/actual.js create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0031/options.json create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0032/actual.js create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0032/options.json create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0033/actual.js create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0033/expected.json create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0033/options.json create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0034/actual.js create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0034/expected.json create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0034/options.json create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0035/actual.js create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0035/options.json create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0036/actual.js create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0036/expected.json create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0036/options.json create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0037/actual.js create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0037/expected.json create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0037/options.json create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0038/actual.js create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0038/options.json create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0039/actual.js create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0039/options.json create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0040/actual.js create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0040/options.json create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0041/actual.js create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0041/expected.json create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0041/options.json create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0042/actual.js create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0042/expected.json create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0042/options.json create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0043/actual.js create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0043/expected.json create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0043/options.json create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0044/actual.js create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0044/expected.json create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0044/options.json create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0045/actual.js create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0045/options.json create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0046/actual.js create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0046/options.json create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0047/actual.js create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0047/options.json create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0048/actual.js create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0048/expected.json create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0048/options.json create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0049/actual.js create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0049/expected.json create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0049/options.json create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0050/actual.js create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0050/expected.json create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0050/options.json create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0051/actual.js create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0051/expected.json create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0051/options.json create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0052/actual.js create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0052/options.json create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0053/actual.js create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0053/options.json create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0054/actual.js create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0054/options.json create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0055/actual.js create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0055/options.json create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0056/actual.js create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0056/options.json create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0057/actual.js create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0057/options.json create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0058/actual.js create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0058/options.json create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0059/actual.js create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0059/options.json create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0060/actual.js create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0060/options.json create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0061/actual.js create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0061/options.json create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0062/actual.js create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0062/options.json create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0063/actual.js create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0063/options.json create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0064/actual.js create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0064/options.json create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0065/actual.js create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0065/options.json create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0066/actual.js create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0066/options.json create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0067/actual.js create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0067/options.json create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0068/actual.js create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0068/options.json create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0069/actual.js create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0069/options.json create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0070/actual.js create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0070/options.json create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0071/actual.js create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0071/options.json create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0072/actual.js create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0072/options.json create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0073/actual.js create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0073/options.json create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0074/actual.js create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0074/options.json create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0075/actual.js create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0075/options.json create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0076/actual.js create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0076/options.json create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0077/actual.js create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0077/options.json create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0078/actual.js create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0078/options.json create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0080/actual.js create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0080/options.json create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0081/actual.js create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0081/options.json create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0082/actual.js create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0082/options.json create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0083/actual.js create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0083/options.json create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0084/actual.js create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0084/options.json create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0085/actual.js create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0085/options.json create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0086/actual.js create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0086/options.json create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0087/actual.js create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0087/options.json create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0088/actual.js create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0088/options.json create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0089/actual.js create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0089/options.json create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0090/actual.js create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0090/options.json create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0091/actual.js create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0091/options.json create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0092/actual.js create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0092/expected.json create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0092/options.json create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0093/actual.js create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0093/options.json create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0094/actual.js create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0094/options.json create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0095/actual.js create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0095/options.json create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0096/actual.js create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0096/options.json create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0097/actual.js create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0097/options.json create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0098/actual.js create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0098/options.json create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0099/actual.js create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0099/options.json create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0100/actual.js create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0100/options.json create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0101/actual.js create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0101/expected.json create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0101/options.json create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0102/actual.js create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0102/options.json create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0103/actual.js create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0103/options.json create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0104/actual.js create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0104/options.json create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0105/actual.js create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0105/options.json create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0106/actual.js create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0106/options.json create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0107/actual.js create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0107/options.json create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0108/actual.js create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0108/options.json create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0109/actual.js create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0109/options.json create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0110/actual.js create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0110/options.json create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0111/actual.js create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0111/options.json create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0112/actual.js create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0112/options.json create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0113/actual.js create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0113/options.json create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0114/actual.js create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0114/options.json create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0115/actual.js create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0115/options.json create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0116/actual.js create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0116/options.json create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0117/actual.js create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0117/options.json create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0118/actual.js create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0118/options.json create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0119/actual.js create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0119/options.json create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0120/actual.js create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0120/options.json create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0121/actual.js create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0121/options.json create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0122/actual.js create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0122/options.json create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0123/actual.js create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0123/options.json create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0124/actual.js create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0124/options.json create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0125/actual.js create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0125/options.json create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0126/actual.js create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0126/options.json create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0127/actual.js create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0127/options.json create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0128/actual.js create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0128/options.json create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0129/actual.js create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0129/options.json create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0130/actual.js create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0130/options.json create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0131/actual.js create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0131/options.json create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0132/actual.js create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0132/options.json create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0133/actual.js create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0133/options.json create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0134/actual.js create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0134/options.json create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0135/actual.js create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0135/options.json create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0136/actual.js create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0136/options.json create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0137/actual.js create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0137/expected.json create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0137/options.json create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0138/actual.js create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0138/expected.json create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0138/options.json create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0139/actual.js create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0139/expected.json create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0139/options.json create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0140/actual.js create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0140/expected.json create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0140/options.json create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0141/actual.js create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0141/options.json create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0142/actual.js create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0142/options.json create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0143/actual.js create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0143/options.json create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0144/actual.js create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0144/options.json create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0145/actual.js create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0145/options.json create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0146/actual.js create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0146/options.json create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0147/actual.js create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0147/options.json create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0148/actual.js create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0148/options.json create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0149/actual.js create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0149/options.json create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0150/actual.js create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0150/options.json create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0151/actual.js create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0151/options.json create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0152/actual.js create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0152/options.json create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0153/actual.js create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0153/options.json create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0154/actual.js create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0154/options.json create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0155/actual.js create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0155/options.json create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0156/actual.js create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0156/options.json create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0157/actual.js create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0157/options.json create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0158/actual.js create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0158/options.json create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0159/actual.js create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0159/options.json create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0160/actual.js create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0160/options.json create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0161/actual.js create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0161/options.json create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0162/actual.js create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0162/options.json create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0163/actual.js create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0163/expected.json create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0163/options.json create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0164/actual.js create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0164/options.json create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0165/actual.js create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0165/expected.json create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0165/options.json create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0166/actual.js create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0166/expected.json create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0166/options.json create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0167/actual.js create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0167/expected.json create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0167/options.json create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0168/actual.js create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0168/options.json create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0169/actual.js create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0169/expected.json create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0169/options.json create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0170/actual.js create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0170/options.json create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0171/actual.js create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0171/options.json create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0172/actual.js create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0172/options.json create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0173/actual.js create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0173/options.json create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0174/actual.js create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0174/options.json create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0175/actual.js create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0175/options.json create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0176/actual.js create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0176/options.json create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0177/actual.js create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0177/options.json create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0178/actual.js create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0178/options.json create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0179/actual.js create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0179/options.json create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0180/actual.js create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0180/options.json create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0181/actual.js create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0181/options.json create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0182/actual.js create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0182/options.json create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0183/actual.js create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0183/options.json create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0184/actual.js create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0184/options.json create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0185/actual.js create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0185/options.json create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0186/actual.js create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0186/options.json create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0187/actual.js create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0187/options.json create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0188/actual.js create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0188/options.json create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0189/actual.js create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0189/options.json create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0190/actual.js create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0190/options.json create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0191/actual.js create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0191/options.json create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0192/actual.js create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0192/options.json create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0193/actual.js create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0193/options.json create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0194/actual.js create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0194/options.json create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0195/actual.js create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0195/options.json create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0196/actual.js create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0196/options.json create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0197/actual.js create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0197/options.json create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0198/actual.js create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0198/options.json create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0199/actual.js create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0199/options.json create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0200/actual.js create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0200/options.json create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0201/actual.js create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0201/expected.json create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0201/options.json create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0202/actual.js create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0202/expected.json create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0202/options.json create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0203/actual.js create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0203/options.json create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0204/actual.js create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0204/options.json create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0205/actual.js create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0205/expected.json create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0205/options.json create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0206/actual.js create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0206/expected.json create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0206/options.json create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0207/actual.js create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0207/options.json create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0208/actual.js create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0208/expected.json create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0208/options.json create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0209/actual.js create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0209/options.json create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0210/actual.js create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0210/options.json create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0211/actual.js create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0211/options.json create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0212/actual.js create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0212/expected.json create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0212/options.json create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0213/actual.js create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0213/expected.json create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0213/options.json create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0214/actual.js create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0214/options.json create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0215/actual.js create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0215/options.json create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0216/actual.js create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0216/expected.json create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0216/options.json create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0217/actual.js create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0217/options.json create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0218/actual.js create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0218/options.json create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0219/actual.js create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0219/options.json create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0220/actual.js create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0220/options.json create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0221/actual.js create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0221/expected.json create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0221/options.json create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0222/actual.js create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0222/expected.json create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0222/options.json create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0223/actual.js create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0223/options.json create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0224/actual.js create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0224/options.json create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0225/actual.js create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0225/options.json create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0226/actual.js create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0226/options.json create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0227/actual.js create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0227/options.json create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0228/actual.js create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0228/options.json create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0229/actual.js create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0229/options.json create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0230/actual.js create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0230/options.json create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0231/actual.js create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0231/options.json create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0232/actual.js create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0232/options.json create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0233/actual.js create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0233/expected.json create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0233/options.json create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0234/actual.js create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0234/expected.json create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0234/options.json create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0235/actual.js create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0235/expected.json create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0235/options.json create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0236/actual.js create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0236/expected.json create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0236/options.json create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0238/actual.js create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0238/expected.json create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0238/options.json create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0239/actual.js create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0239/options.json create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0240/actual.js create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0240/options.json create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0241/actual.js create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0241/expected.json create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0241/options.json create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0242/actual.js create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0242/expected.json create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0242/options.json create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0243/actual.js create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0243/options.json create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0244/actual.js create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0244/options.json create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0245/actual.js create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0245/options.json create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0246/actual.js create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0246/expected.json create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0246/options.json create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0247/actual.js create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0247/expected.json create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0247/options.json create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0248/actual.js create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0248/options.json create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0249/actual.js create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0249/options.json create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0250/actual.js create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0250/options.json create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0252/actual.js create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0252/options.json create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0253/actual.js create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0253/expected.json create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0253/options.json create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0254/actual.js create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0254/options.json create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0255/actual.js create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0255/options.json create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0256/actual.js create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0256/options.json create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0257/actual.js create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0257/options.json create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0258/actual.js create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0258/options.json create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0259/actual.js create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0259/options.json create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0260/actual.js create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0260/options.json create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0261/actual.js create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0261/options.json create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0262/actual.js create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0262/options.json create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0263/actual.js create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0263/options.json create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0264/actual.js create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0264/options.json create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0265/actual.js create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0265/options.json create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0266/actual.js create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0266/options.json create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0267/actual.js create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0267/options.json create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0268/actual.js create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0268/options.json create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0269/actual.js create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0269/options.json create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0270/actual.js create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0270/expected.json create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0270/options.json create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0271/actual.js create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0271/expected.json create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0271/options.json create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0272/actual.js create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0272/options.json create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0273/actual.js create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0273/options.json create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0274/actual.js create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0274/options.json create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0275/actual.js create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0275/options.json create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0276/actual.js create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0276/options.json create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0277/actual.js create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0277/expected.json create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0277/options.json create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0278/actual.js create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0278/expected.json create mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0278/options.json create mode 100644 test/fixtures/esprima/statement-block/migrated_0000/actual.js create mode 100644 test/fixtures/esprima/statement-block/migrated_0000/expected.json create mode 100644 test/fixtures/esprima/statement-block/migrated_0001/actual.js create mode 100644 test/fixtures/esprima/statement-block/migrated_0001/expected.json create mode 100644 test/fixtures/esprima/statement-block/migrated_0002/actual.js create mode 100644 test/fixtures/esprima/statement-block/migrated_0002/expected.json create mode 100644 test/fixtures/esprima/statement-break/migrated_0000/actual.js create mode 100644 test/fixtures/esprima/statement-break/migrated_0000/expected.json create mode 100644 test/fixtures/esprima/statement-break/migrated_0001/actual.js create mode 100644 test/fixtures/esprima/statement-break/migrated_0001/expected.json create mode 100644 test/fixtures/esprima/statement-break/migrated_0002/actual.js create mode 100644 test/fixtures/esprima/statement-break/migrated_0002/expected.json create mode 100644 test/fixtures/esprima/statement-break/migrated_0003/actual.js create mode 100644 test/fixtures/esprima/statement-break/migrated_0003/expected.json create mode 100644 test/fixtures/esprima/statement-continue/migrated_0000/actual.js create mode 100644 test/fixtures/esprima/statement-continue/migrated_0000/expected.json create mode 100644 test/fixtures/esprima/statement-continue/migrated_0001/actual.js create mode 100644 test/fixtures/esprima/statement-continue/migrated_0001/expected.json create mode 100644 test/fixtures/esprima/statement-continue/migrated_0002/actual.js create mode 100644 test/fixtures/esprima/statement-continue/migrated_0002/expected.json create mode 100644 test/fixtures/esprima/statement-continue/migrated_0003/actual.js create mode 100644 test/fixtures/esprima/statement-continue/migrated_0003/expected.json create mode 100644 test/fixtures/esprima/statement-continue/migrated_0004/actual.js create mode 100644 test/fixtures/esprima/statement-continue/migrated_0004/expected.json create mode 100644 test/fixtures/esprima/statement-debugger/migrated_0000/actual.js create mode 100644 test/fixtures/esprima/statement-debugger/migrated_0000/expected.json create mode 100644 test/fixtures/esprima/statement-empty/migrated_0000/actual.js create mode 100644 test/fixtures/esprima/statement-empty/migrated_0000/expected.json create mode 100644 test/fixtures/esprima/statement-expression/migrated_0000/actual.js create mode 100644 test/fixtures/esprima/statement-expression/migrated_0000/expected.json create mode 100644 test/fixtures/esprima/statement-expression/migrated_0001/actual.js create mode 100644 test/fixtures/esprima/statement-expression/migrated_0001/expected.json create mode 100644 test/fixtures/esprima/statement-expression/migrated_0002/actual.js create mode 100644 test/fixtures/esprima/statement-expression/migrated_0002/expected.json create mode 100644 test/fixtures/esprima/statement-expression/migrated_0003/actual.js create mode 100644 test/fixtures/esprima/statement-expression/migrated_0003/expected.json create mode 100644 test/fixtures/esprima/statement-expression/migrated_0004/actual.js create mode 100644 test/fixtures/esprima/statement-expression/migrated_0004/expected.json create mode 100644 test/fixtures/esprima/statement-expression/migrated_0005/actual.js create mode 100644 test/fixtures/esprima/statement-expression/migrated_0005/expected.json create mode 100644 test/fixtures/esprima/statement-if/migrated_0000/actual.js create mode 100644 test/fixtures/esprima/statement-if/migrated_0000/expected.json create mode 100644 test/fixtures/esprima/statement-if/migrated_0001/actual.js create mode 100644 test/fixtures/esprima/statement-if/migrated_0001/expected.json create mode 100644 test/fixtures/esprima/statement-if/migrated_0002/actual.js create mode 100644 test/fixtures/esprima/statement-if/migrated_0002/expected.json create mode 100644 test/fixtures/esprima/statement-if/migrated_0003/actual.js create mode 100644 test/fixtures/esprima/statement-if/migrated_0004/actual.js create mode 100644 test/fixtures/esprima/statement-if/migrated_0004/expected.json create mode 100644 test/fixtures/esprima/statement-if/migrated_0005/actual.js create mode 100644 test/fixtures/esprima/statement-if/migrated_0005/expected.json create mode 100644 test/fixtures/esprima/statement-if/migrated_0006/actual.js create mode 100644 test/fixtures/esprima/statement-if/migrated_0006/expected.json create mode 100644 test/fixtures/esprima/statement-iteration/const_forin/actual.js create mode 100644 test/fixtures/esprima/statement-iteration/const_forin/expected.json create mode 100644 test/fixtures/esprima/statement-iteration/for-statement-with-seq/actual.js create mode 100644 test/fixtures/esprima/statement-iteration/for-statement-with-seq/expected.json create mode 100644 test/fixtures/esprima/statement-iteration/migrated_0000/actual.js create mode 100644 test/fixtures/esprima/statement-iteration/migrated_0000/expected.json create mode 100644 test/fixtures/esprima/statement-iteration/migrated_0001/actual.js create mode 100644 test/fixtures/esprima/statement-iteration/migrated_0001/expected.json create mode 100644 test/fixtures/esprima/statement-iteration/migrated_0002/actual.js create mode 100644 test/fixtures/esprima/statement-iteration/migrated_0002/expected.json create mode 100644 test/fixtures/esprima/statement-iteration/migrated_0003/actual.js create mode 100644 test/fixtures/esprima/statement-iteration/migrated_0003/expected.json create mode 100644 test/fixtures/esprima/statement-iteration/migrated_0004/actual.js create mode 100644 test/fixtures/esprima/statement-iteration/migrated_0004/expected.json create mode 100644 test/fixtures/esprima/statement-iteration/migrated_0005/actual.js create mode 100644 test/fixtures/esprima/statement-iteration/migrated_0005/expected.json create mode 100644 test/fixtures/esprima/statement-iteration/migrated_0006/actual.js create mode 100644 test/fixtures/esprima/statement-iteration/migrated_0006/expected.json create mode 100644 test/fixtures/esprima/statement-iteration/migrated_0007/actual.js create mode 100644 test/fixtures/esprima/statement-iteration/migrated_0007/expected.json create mode 100644 test/fixtures/esprima/statement-iteration/migrated_0008/actual.js create mode 100644 test/fixtures/esprima/statement-iteration/migrated_0008/expected.json create mode 100644 test/fixtures/esprima/statement-iteration/migrated_0009/actual.js create mode 100644 test/fixtures/esprima/statement-iteration/migrated_0009/expected.json create mode 100644 test/fixtures/esprima/statement-iteration/migrated_0010/actual.js create mode 100644 test/fixtures/esprima/statement-iteration/migrated_0010/expected.json create mode 100644 test/fixtures/esprima/statement-iteration/migrated_0011/actual.js create mode 100644 test/fixtures/esprima/statement-iteration/migrated_0011/expected.json create mode 100644 test/fixtures/esprima/statement-iteration/migrated_0012/actual.js create mode 100644 test/fixtures/esprima/statement-iteration/migrated_0012/expected.json create mode 100644 test/fixtures/esprima/statement-iteration/migrated_0013/actual.js create mode 100644 test/fixtures/esprima/statement-iteration/migrated_0013/expected.json create mode 100644 test/fixtures/esprima/statement-iteration/migrated_0014/actual.js create mode 100644 test/fixtures/esprima/statement-iteration/migrated_0014/expected.json create mode 100644 test/fixtures/esprima/statement-iteration/migrated_0015/actual.js create mode 100644 test/fixtures/esprima/statement-iteration/migrated_0015/expected.json create mode 100644 test/fixtures/esprima/statement-iteration/migrated_0016/actual.js create mode 100644 test/fixtures/esprima/statement-iteration/migrated_0016/expected.json create mode 100644 test/fixtures/esprima/statement-iteration/migrated_0017/actual.js create mode 100644 test/fixtures/esprima/statement-iteration/migrated_0017/expected.json create mode 100644 test/fixtures/esprima/statement-iteration/migrated_0018/actual.js create mode 100644 test/fixtures/esprima/statement-iteration/migrated_0018/expected.json create mode 100644 test/fixtures/esprima/statement-iteration/migrated_0019/actual.js create mode 100644 test/fixtures/esprima/statement-iteration/migrated_0019/expected.json create mode 100644 test/fixtures/esprima/statement-iteration/migrated_0020/actual.js create mode 100644 test/fixtures/esprima/statement-iteration/migrated_0020/expected.json create mode 100644 test/fixtures/esprima/statement-iteration/migrated_0021/actual.js create mode 100644 test/fixtures/esprima/statement-iteration/migrated_0021/expected.json create mode 100644 test/fixtures/esprima/statement-iteration/migrated_0022/actual.js create mode 100644 test/fixtures/esprima/statement-iteration/migrated_0022/expected.json create mode 100644 test/fixtures/esprima/statement-iteration/migrated_0023/actual.js create mode 100644 test/fixtures/esprima/statement-iteration/migrated_0023/expected.json create mode 100644 test/fixtures/esprima/statement-iteration/migrated_0024/actual.js create mode 100644 test/fixtures/esprima/statement-iteration/migrated_0024/expected.json create mode 100644 test/fixtures/esprima/statement-iteration/migrated_0025/actual.js create mode 100644 test/fixtures/esprima/statement-iteration/migrated_0025/expected.json create mode 100644 test/fixtures/esprima/statement-iteration/migrated_0026/actual.js create mode 100644 test/fixtures/esprima/statement-iteration/migrated_0026/expected.json create mode 100644 test/fixtures/esprima/statement-iteration/pattern-in-for-in/actual.js create mode 100644 test/fixtures/esprima/statement-labelled/migrated_0000/actual.js create mode 100644 test/fixtures/esprima/statement-labelled/migrated_0000/expected.json create mode 100644 test/fixtures/esprima/statement-labelled/migrated_0001/actual.js create mode 100644 test/fixtures/esprima/statement-labelled/migrated_0001/expected.json create mode 100644 test/fixtures/esprima/statement-labelled/migrated_0002/actual.js create mode 100644 test/fixtures/esprima/statement-labelled/migrated_0002/expected.json create mode 100644 test/fixtures/esprima/statement-return/migrated_0000/actual.js create mode 100644 test/fixtures/esprima/statement-return/migrated_0000/expected.json create mode 100644 test/fixtures/esprima/statement-return/migrated_0001/actual.js create mode 100644 test/fixtures/esprima/statement-return/migrated_0001/expected.json create mode 100644 test/fixtures/esprima/statement-return/migrated_0002/actual.js create mode 100644 test/fixtures/esprima/statement-return/migrated_0002/expected.json create mode 100644 test/fixtures/esprima/statement-return/migrated_0003/actual.js create mode 100644 test/fixtures/esprima/statement-return/migrated_0003/expected.json create mode 100644 test/fixtures/esprima/statement-switch/migrated_0000/actual.js create mode 100644 test/fixtures/esprima/statement-switch/migrated_0000/expected.json create mode 100644 test/fixtures/esprima/statement-switch/migrated_0001/actual.js create mode 100644 test/fixtures/esprima/statement-switch/migrated_0001/expected.json create mode 100644 test/fixtures/esprima/statement-switch/migrated_0002/actual.js create mode 100644 test/fixtures/esprima/statement-switch/migrated_0002/expected.json create mode 100644 test/fixtures/esprima/statement-throw/migrated_0000/actual.js create mode 100644 test/fixtures/esprima/statement-throw/migrated_0000/expected.json create mode 100644 test/fixtures/esprima/statement-throw/migrated_0001/actual.js create mode 100644 test/fixtures/esprima/statement-throw/migrated_0001/expected.json create mode 100644 test/fixtures/esprima/statement-throw/migrated_0002/actual.js create mode 100644 test/fixtures/esprima/statement-throw/migrated_0002/expected.json create mode 100644 test/fixtures/esprima/statement-try/migrated_0000/actual.js create mode 100644 test/fixtures/esprima/statement-try/migrated_0000/expected.json create mode 100644 test/fixtures/esprima/statement-try/migrated_0001/actual.js create mode 100644 test/fixtures/esprima/statement-try/migrated_0001/expected.json create mode 100644 test/fixtures/esprima/statement-try/migrated_0002/actual.js create mode 100644 test/fixtures/esprima/statement-try/migrated_0002/expected.json create mode 100644 test/fixtures/esprima/statement-try/migrated_0003/actual.js create mode 100644 test/fixtures/esprima/statement-try/migrated_0003/expected.json create mode 100644 test/fixtures/esprima/statement-try/migrated_0004/actual.js create mode 100644 test/fixtures/esprima/statement-try/migrated_0004/expected.json create mode 100644 test/fixtures/esprima/statement-try/migrated_0005/actual.js create mode 100644 test/fixtures/esprima/statement-try/migrated_0005/expected.json create mode 100644 test/fixtures/esprima/statement-try/migrated_0006/actual.js create mode 100644 test/fixtures/esprima/statement-try/migrated_0006/expected.json create mode 100644 test/fixtures/esprima/statement-variable/complex-pattern-requires-init/actual.js create mode 100644 test/fixtures/esprima/statement-variable/complex-pattern-requires-init/options.json create mode 100644 test/fixtures/esprima/statement-variable/migrated_0000/actual.js create mode 100644 test/fixtures/esprima/statement-variable/migrated_0000/expected.json create mode 100644 test/fixtures/esprima/statement-variable/migrated_0001/actual.js create mode 100644 test/fixtures/esprima/statement-variable/migrated_0001/expected.json create mode 100644 test/fixtures/esprima/statement-variable/migrated_0002/actual.js create mode 100644 test/fixtures/esprima/statement-variable/migrated_0002/expected.json create mode 100644 test/fixtures/esprima/statement-variable/migrated_0003/actual.js create mode 100644 test/fixtures/esprima/statement-variable/migrated_0003/expected.json create mode 100644 test/fixtures/esprima/statement-variable/migrated_0004/actual.js create mode 100644 test/fixtures/esprima/statement-variable/migrated_0004/expected.json create mode 100644 test/fixtures/esprima/statement-variable/migrated_0005/actual.js create mode 100644 test/fixtures/esprima/statement-variable/migrated_0005/expected.json create mode 100644 test/fixtures/esprima/statement-variable/migrated_0006/actual.js create mode 100644 test/fixtures/esprima/statement-variable/migrated_0006/expected.json create mode 100644 test/fixtures/esprima/statement-with/migrated_0000/actual.js create mode 100644 test/fixtures/esprima/statement-with/migrated_0000/expected.json create mode 100644 test/fixtures/esprima/statement-with/migrated_0001/actual.js create mode 100644 test/fixtures/esprima/statement-with/migrated_0001/expected.json create mode 100644 test/fixtures/esprima/statement-with/migrated_0002/actual.js create mode 100644 test/fixtures/esprima/statement-with/migrated_0002/expected.json create mode 100644 test/fixtures/experimental/async-functions/illegal-parens/actual.js create mode 100644 test/fixtures/experimental/async-functions/illegal-parens/options.json create mode 100644 test/fixtures/flow/regression/arrow-function-parens-with-return-type/actual.js create mode 100644 test/fixtures/flow/regression/arrow-function-parens-with-return-type/expected.json create mode 100644 test/fixtures/flow/regression/arrow-function-parens-with-return-type/options.json create mode 100644 test/fixtures/harmony/arrow-functions/inner-parens/actual.js create mode 100644 test/fixtures/harmony/arrow-functions/inner-parens/options.json create mode 100644 test/fixtures/harmony/uncategorised/289/expected.json create mode 100644 test/fixtures/harmony/uncategorised/297/expected.json diff --git a/src/options.js b/src/options.js index 5c5d6d50f1..f33e39d920 100755 --- a/src/options.js +++ b/src/options.js @@ -4,11 +4,6 @@ export const defaultOptions = { // Source type ("script" or "module") for different semantics sourceType: "script", - // By default, reserved words are not enforced. Disable - // `allowReserved` to enforce them. When this option has the - // value "never", reserved words and keywords can also not be - // used as property names. - allowReserved: true, // When enabled, a return at the top level is not considered an // error. allowReturnOutsideFunction: false, diff --git a/src/parser/expression.js b/src/parser/expression.js index 5faf80afce..3169de84e5 100644 --- a/src/parser/expression.js +++ b/src/parser/expression.js @@ -229,7 +229,7 @@ pp.parseSubscripts = function(base, startPos, startLoc, noCalls) { } else if (this.eat(tt.dot)) { let node = this.startNodeAt(startPos, startLoc); node.object = base; - node.property = this.parseIdent(true); + node.property = this.parseIdentifier(true); node.computed = false; base = this.finishNode(node, "MemberExpression"); } else if (this.eat(tt.bracketL)) { @@ -245,10 +245,10 @@ pp.parseSubscripts = function(base, startPos, startLoc, noCalls) { let node = this.startNodeAt(startPos, startLoc); node.callee = base; - node.arguments = this.parseExprList(tt.parenR, this.options.features["es7.trailingFunctionCommas"]); + node.arguments = this.parseCallExpressionArguments(tt.parenR, this.options.features["es7.trailingFunctionCommas"], possibleAsync); base = this.finishNode(node, "CallExpression"); - if (possibleAsync && (this.match(tt.colon) || this.match(tt.arrow))) { + if (possibleAsync && this.shouldParseAsyncArrow()) { base = this.parseAsyncArrowFromCallExpression(this.startNodeAt(startPos, startLoc), node); } else { this.toReferencedList(node.arguments); @@ -264,6 +264,38 @@ pp.parseSubscripts = function(base, startPos, startLoc, noCalls) { } }; +pp.parseCallExpressionArguments = function (close, allowTrailingComma, possibleAsyncArrow) { + let innerParenStart; + + let elts = [], first = true; + while (!this.eat(close)) { + if (first) { + first = false; + } else { + this.expect(tt.comma); + if (allowTrailingComma && this.eat(close)) break; + } + + // we need to make sure that if this is an async arrow functions, that we don't allow inner parens inside the params + if (this.match(tt.parenL) && !innerParenStart) { + innerParenStart = this.state.start; + } + + elts.push(this.parseExprListItem()); + } + + // we found an async arrow function so let's not allow any inner parens + if (possibleAsyncArrow && innerParenStart && this.shouldParseAsyncArrow()) { + this.unexpected(); + } + + return elts; +}; + +pp.shouldParseAsyncArrow = function () { + return this.match(tt.arrow); +}; + pp.parseAsyncArrowFromCallExpression = function (node, call) { if (!this.options.features["es7.asyncFunctions"]) this.unexpected(); this.expect(tt.arrow); @@ -286,16 +318,51 @@ pp.parseExprAtom = function (refShorthandDefaultPos) { let node, canBeArrow = this.state.potentialArrowAt === this.state.start; switch (this.state.type) { case tt._super: - if (!this.state.inFunction) + if (!this.state.inFunction) { this.raise(this.state.start, "'super' outside of function or class"); - case tt._this: - let type = this.match(tt._this) ? "ThisExpression" : "Super"; + } + node = this.startNode(); this.next(); - return this.finishNode(node, type); + if (!this.match(tt.parenL) && !this.match(tt.bracketL) && !this.match(tt.dot)) { + this.unexpected(); + } + return this.finishNode(node, "Super"); + + case tt._this: + node = this.startNode(); + this.next(); + return this.finishNode(node, "ThisExpression"); case tt._yield: - if (this.state.inGenerator) this.unexpected(); + // NOTE: falls through to _let + if (!this.state.inGenerator && this.strict) this.unexpected(); + + case tt._let: + case tt.name: + node = this.startNode(); + let id = this.parseIdentifier(true); + + if (this.options.features["es7.asyncFunctions"]) { + if (id.name === "await") { + if (this.inAsync) return this.parseAwait(node); + } else if (id.name === "async" && this.match(tt._function) && !this.canInsertSemicolon()) { + this.next(); + return this.parseFunction(node, false, false, true); + } else if (canBeArrow && id.name === "async" && this.match(tt.name)) { + var params = [this.parseIdentifier()]; + this.expect(tt.arrow); + // var foo = bar => {}; + return this.parseArrowExpression(node, params, true); + } + } + + if (canBeArrow && !this.canInsertSemicolon() && this.eat(tt.arrow)) { + return this.parseArrowExpression(node, [id]); + } + + return id; + case tt._do: if (this.options.features["es7.doExpressions"]) { @@ -311,30 +378,6 @@ pp.parseExprAtom = function (refShorthandDefaultPos) { return this.finishNode(node, "DoExpression"); } - case tt.name: - node = this.startNode(); - let id = this.parseIdent(true); - - if (this.options.features["es7.asyncFunctions"]) { - if (id.name === "await") { - if (this.inAsync) return this.parseAwait(node); - } else if (id.name === "async" && this.match(tt._function) && !this.canInsertSemicolon()) { - this.next(); - return this.parseFunction(node, false, false, true); - } else if (canBeArrow && id.name === "async" && this.match(tt.name)) { - var params = [this.parseIdent()]; - this.expect(tt.arrow); - // var foo = bar => {}; - return this.parseArrowExpression(node, params, true); - } - } - - if (canBeArrow && !this.canInsertSemicolon() && this.eat(tt.arrow)) { - return this.parseArrowExpression(node, [id]); - } - - return id; - case tt.regexp: let value = this.state.value; node = this.parseLiteral(value.value); @@ -430,7 +473,7 @@ pp.parseParenAndDistinguishExpression = function (startPos, startLoc, canBeArrow let innerStartPos = this.state.start, innerStartLoc = this.state.startLoc; let exprList = [], first = true; - let refShorthandDefaultPos = {start: 0}, spreadStart, innerParenStart, optionalCommaStart; + let refShorthandDefaultPos = { start: 0 }, spreadStart, innerParenStart, optionalCommaStart; while (!this.match(tt.parenR)) { if (first) { first = false; @@ -454,6 +497,7 @@ pp.parseParenAndDistinguishExpression = function (startPos, startLoc, canBeArrow exprList.push(this.parseMaybeAssign(false, refShorthandDefaultPos, this.parseParenItem)); } } + let innerEndPos = this.state.start; let innerEndLoc = this.state.startLoc; this.expect(tt.parenR); @@ -497,11 +541,11 @@ pp.parseParenItem = function (node) { pp.parseNew = function () { let node = this.startNode(); - let meta = this.parseIdent(true); + let meta = this.parseIdentifier(true); if (this.eat(tt.dot)) { node.meta = meta; - node.property = this.parseIdent(true); + node.property = this.parseIdentifier(true); if (node.property.name !== "target") { this.raise(node.property.start, "The only valid meta property for new is new.target"); @@ -592,7 +636,7 @@ pp.parseObj = function (isPattern, refShorthandDefaultPos) { } if (!isPattern && this.options.features["es7.asyncFunctions"] && this.isContextual("async")) { if (isGenerator) this.unexpected(); - var asyncId = this.parseIdent(); + var asyncId = this.parseIdentifier(); if (this.match(tt.colon) || this.match(tt.parenL) || this.match(tt.braceR)) { prop.key = asyncId; } else { @@ -629,22 +673,27 @@ pp.parseObjPropValue = function (prop, startPos, startLoc, isGenerator, isAsync, let paramCount = prop.kind === "get" ? 0 : 1; if (prop.value.params.length !== paramCount) { let start = prop.value.start; - if (prop.kind === "get") + if (prop.kind === "get") { this.raise(start, "getter should have no params"); - else + } else { this.raise(start, "setter should have exactly one param"); + } } } else if (!prop.computed && prop.key.type === "Identifier") { prop.kind = "init"; if (isPattern) { - if (this.isKeyword(prop.key.name) || - (this.strict && (reservedWords.strictBind(prop.key.name) || reservedWords.strict(prop.key.name))) || - (!this.options.allowReserved && this.isReservedWord(prop.key.name))) - this.raise(prop.key.start, "Binding " + prop.key.name); + var illegalBinding = this.isKeyword(prop.key.name); + if (!illegalBinding && this.strict) { + illegalBinding = reservedWords.strictBind(prop.key.name) || reservedWords.strict(prop.key.name); + } + if (illegalBinding) { + this.raise(prop.key.start, "Binding " + prop.key.name); + } prop.value = this.parseMaybeDefault(startPos, startLoc, prop.key.__clone()); } else if (this.match(tt.eq) && refShorthandDefaultPos) { - if (!refShorthandDefaultPos.start) + if (!refShorthandDefaultPos.start) { refShorthandDefaultPos.start = this.state.start; + } prop.value = this.parseMaybeDefault(startPos, startLoc, prop.key.__clone()); } else { prop.value = prop.key.__clone(); @@ -663,7 +712,7 @@ pp.parsePropertyName = function (prop) { return prop.key; } else { prop.computed = false; - return prop.key = (this.match(tt.num) || this.match(tt.string)) ? this.parseExprAtom() : this.parseIdent(true); + return prop.key = (this.match(tt.num) || this.match(tt.string)) ? this.parseExprAtom() : this.parseIdentifier(true); } }; @@ -723,16 +772,19 @@ pp.parseFunctionBody = function (node, allowExpression) { // If this is a strict mode function, verify that argument names // are not repeated, and it does not try to bind the words `eval` // or `arguments`. - if (this.strict || !isExpression && node.body.body.length && this.isUseStrict(node.body.body[0])) { - let nameHash = Object.create(null), oldStrict = this.strict; - this.strict = true; + var checkLVal = this.strict; + // arrow function + if (allowExpression) checkLVal = true; + // normal function + if (!isExpression && node.body.body.length && this.isUseStrict(node.body.body[0])) checkLVal = true; + if (checkLVal) { + let nameHash = Object.create(null); if (node.id) { this.checkLVal(node.id, true); } for (let param of (node.params: Array)) { this.checkLVal(param, true, nameHash); } - this.strict = oldStrict; } }; @@ -773,19 +825,21 @@ pp.parseExprListItem = function (allowEmpty, refShorthandDefaultPos) { // when parsing properties), it will also convert keywords into // identifiers. -pp.parseIdent = function (liberal) { +pp.parseIdentifier = function (liberal) { let node = this.startNode(); - if (this.match(tt.name)) { - if (!liberal && - ((!this.options.allowReserved && this.isReservedWord(this.state.value)) || - (this.strict && reservedWords.strict(this.state.value)))) + + if (this.isName()) { + if (!liberal && this.strict && reservedWords.strict(this.state.value)) { this.raise(this.state.start, "The keyword '" + this.state.value + "' is reserved"); + } + node.name = this.state.value; } else if (liberal && this.state.type.keyword) { node.name = this.state.type.keyword; } else { this.unexpected(); } + this.next(); return this.finishNode(node, "Identifier"); }; diff --git a/src/parser/lval.js b/src/parser/lval.js index b8ee7bc63f..7ec54ae135 100644 --- a/src/parser/lval.js +++ b/src/parser/lval.js @@ -92,17 +92,22 @@ pp.parseSpread = function (refShorthandDefaultPos) { pp.parseRest = function () { let node = this.startNode(); this.next(); - node.argument = this.match(tt.name) || this.match(tt.bracketL) ? this.parseBindingAtom() : this.unexpected(); + if (this.isName() || this.match(tt.bracketL)) { + node.argument = this.parseBindingAtom(); + } else { + this.unexpected(); + } return this.finishNode(node, "RestElement"); }; // Parses lvalue (assignable) atom. pp.parseBindingAtom = function () { - switch (this.state.type) { - case tt.name: - return this.parseIdent(); + if (this.isName()) { + return this.parseIdentifier(true); + } + switch (this.state.type) { case tt.bracketL: let node = this.startNode(); this.next(); @@ -163,8 +168,10 @@ pp.parseMaybeDefault = function (startPos, startLoc, left) { pp.checkLVal = function (expr, isBinding, checkClashes) { switch (expr.type) { case "Identifier": - if (this.strict && (reservedWords.strictBind(expr.name) || reservedWords.strict(expr.name))) + if (this.strict && (reservedWords.strictBind(expr.name) || reservedWords.strict(expr.name))) { this.raise(expr.start, (isBinding ? "Binding " : "Assigning to ") + expr.name + " in strict mode"); + } + if (checkClashes) { if (checkClashes[expr.name]) { this.raise(expr.start, "Argument name clash in strict mode"); @@ -179,7 +186,7 @@ pp.checkLVal = function (expr, isBinding, checkClashes) { break; case "ObjectPattern": - for (let prop of (expr.properties: Array)) { + for (let prop of (expr.properties: Array)) { if (prop.type === "Property") prop = prop.value; this.checkLVal(prop, isBinding, checkClashes); } diff --git a/src/parser/statement.js b/src/parser/statement.js index 8a6744f8c0..559ab8ebda 100644 --- a/src/parser/statement.js +++ b/src/parser/statement.js @@ -72,8 +72,27 @@ pp.parseStatement = function (declaration, topLevel) { case tt._switch: return this.parseSwitchStatement(node); case tt._throw: return this.parseThrowStatement(node); case tt._try: return this.parseTryStatement(node); - case tt._let: case tt._const: if (!declaration) this.unexpected(); // NOTE: falls through to _var - case tt._var: return this.parseVarStatement(node, starttype); + + case tt._let: + // NOTE: falls through to _const + if (!this.strict) { + let state = this.state.clone(); + this.next(); + + var isBindingAtomStart = this.isName() || this.match(tt.braceL) || this.match(tt.bracketL); + + // set back lookahead + this.state = state; + + if (!isBindingAtomStart) break; + } + + case tt._const: + if (!declaration) this.unexpected(); // NOTE: falls through to _var + + case tt._var: + return this.parseVarStatement(node, starttype); + case tt._while: return this.parseWhileStatement(node); case tt._with: return this.parseWithStatement(node); case tt.braceL: return this.parseBlock(); @@ -92,7 +111,7 @@ pp.parseStatement = function (declaration, topLevel) { case tt.name: if (this.options.features["es7.asyncFunctions"] && this.state.value === "async") { // peek ahead and see if next token is a function - var state = this.state.clone(); + let state = this.state.clone(); this.next(); if (this.match(tt._function) && !this.canInsertSemicolon()) { this.expect(tt._function); @@ -101,20 +120,19 @@ pp.parseStatement = function (declaration, topLevel) { this.state = state; } } + } - // If the statement does not start with a statement keyword or a - // brace, it's an ExpressionStatement or LabeledStatement. We - // simply start parsing an expression, and afterwards, if the - // next token is a colon and the expression was a simple - // Identifier node, we switch to interpreting it as a label. - default: - let maybeName = this.state.value, expr = this.parseExpression(); + // If the statement does not start with a statement keyword or a + // brace, it's an ExpressionStatement or LabeledStatement. We + // simply start parsing an expression, and afterwards, if the + // next token is a colon and the expression was a simple + // Identifier node, we switch to interpreting it as a label. + let maybeName = this.state.value, expr = this.parseExpression(); - if (starttype === tt.name && expr.type === "Identifier" && this.eat(tt.colon)) { - return this.parseLabeledStatement(node, maybeName, expr); - } else { - return this.parseExpressionStatement(node, expr); - } + if (starttype === tt.name && expr.type === "Identifier" && this.eat(tt.colon)) { + return this.parseLabeledStatement(node, maybeName, expr); + } else { + return this.parseExpressionStatement(node, expr); } }; @@ -158,7 +176,7 @@ pp.parseBreakContinueStatement = function (node, keyword) { } else if (!this.match(tt.name)) { this.unexpected(); } else { - node.label = this.parseIdent(); + node.label = this.parseIdentifier(); this.semicolon(); } @@ -487,12 +505,12 @@ pp.parseFunction = function (node, isStatement, allowExpressionBody, isAsync, op this.initFunction(node, isAsync); node.generator = this.eat(tt.star); - if (isStatement && !optionalId && !this.match(tt.name)) { + if (isStatement && !optionalId && !this.isName()) { this.unexpected(); } - if (this.match(tt.name)) { - node.id = this.parseIdent(); + if (this.isName()) { + node.id = this.parseIdentifier(); } this.parseFunctionParams(node); @@ -613,7 +631,7 @@ pp.parseClassMethod = function (classBody, method, isGenerator, isAsync) { pp.parseClassId = function (node, isStatement, optionalId) { if (this.match(tt.name)) { - node.id = this.parseIdent(); + node.id = this.parseIdentifier(); } else { if (optionalId || !isStatement) { node.id = null; @@ -636,7 +654,7 @@ pp.parseExport = function (node) { let specifier = this.startNode(); this.next(); if (this.options.features["es7.exportExtensions"] && this.eatContextual("as")) { - specifier.exported = this.parseIdent(); + specifier.exported = this.parseIdentifier(); node.specifiers = [this.finishNode(specifier, "ExportNamespaceSpecifier")]; this.parseExportSpecifiersMaybe(node); this.parseExportFrom(node, true); @@ -646,14 +664,14 @@ pp.parseExport = function (node) { } } else if (this.options.features["es7.exportExtensions"] && this.isExportDefaultSpecifier()) { let specifier = this.startNode(); - specifier.exported = this.parseIdent(true); + specifier.exported = this.parseIdentifier(true); node.specifiers = [this.finishNode(specifier, "ExportDefaultSpecifier")]; if (this.match(tt.comma) && this.lookahead().type === tt.star) { this.expect(tt.comma); let specifier = this.startNode(); this.expect(tt.star); this.expectContextual("as"); - specifier.exported = this.parseIdent(); + specifier.exported = this.parseIdentifier(); node.specifiers.push(this.finishNode(specifier, "ExportNamespaceSpecifier")); } else { this.parseExportSpecifiersMaybe(node); @@ -744,7 +762,10 @@ pp.checkExport = function (node) { // Parses a comma-separated list of module exports. pp.parseExportSpecifiers = function () { - let nodes = [], first = true; + let nodes = []; + let first = true; + let needsFrom; + // export { x, y as z } [from '...'] this.expect(tt.braceL); @@ -756,12 +777,20 @@ pp.parseExportSpecifiers = function () { if (this.eat(tt.braceR)) break; } + let isDefault = this.match(tt._default); + if (isDefault && !needsFrom) needsFrom = true; + let node = this.startNode(); - node.local = this.parseIdent(this.match(tt._default)); - node.exported = this.eatContextual("as") ? this.parseIdent(true) : node.local.__clone(); + node.local = this.parseIdentifier(isDefault); + node.exported = this.eatContextual("as") ? this.parseIdentifier(true) : node.local.__clone(); nodes.push(this.finishNode(node, "ExportSpecifier")); } + // https://github.com/ember-cli/ember-cli/pull/3739 + if (needsFrom && !this.isContextual("from")) { + this.unexpected(); + } + return nodes; }; @@ -791,7 +820,7 @@ pp.parseImportSpecifiers = function (node) { if (this.match(tt.name)) { // import defaultObj, { x, y as z } from '...' var startPos = this.state.start, startLoc = this.state.startLoc; - node.specifiers.push(this.parseImportSpecifierDefault(this.parseIdent(), startPos, startLoc)); + node.specifiers.push(this.parseImportSpecifierDefault(this.parseIdentifier(), startPos, startLoc)); if (!this.eat(tt.comma)) return; } @@ -799,7 +828,7 @@ pp.parseImportSpecifiers = function (node) { let specifier = this.startNode(); this.next(); this.expectContextual("as"); - specifier.local = this.parseIdent(); + specifier.local = this.parseIdentifier(); this.checkLVal(specifier.local, true); node.specifiers.push(this.finishNode(specifier, "ImportNamespaceSpecifier")); return; @@ -815,8 +844,8 @@ pp.parseImportSpecifiers = function (node) { } let specifier = this.startNode(); - specifier.imported = this.parseIdent(true); - specifier.local = this.eatContextual("as") ? this.parseIdent() : specifier.imported.__clone(); + specifier.imported = this.parseIdentifier(true); + specifier.local = this.eatContextual("as") ? this.parseIdentifier() : specifier.imported.__clone(); this.checkLVal(specifier.local, true); node.specifiers.push(this.finishNode(specifier, "ImportSpecifier")); } diff --git a/src/parser/util.js b/src/parser/util.js index 51ca0bdc6f..53f1e4b27d 100644 --- a/src/parser/util.js +++ b/src/parser/util.js @@ -28,6 +28,23 @@ pp.expectRelational = function (op) { } }; +// TODO + +pp.isName = function () { + if (this.match(tt.name)) { + return true; + } else if (!this.strict) { + var keyword = this.state.type.keyword; + if (keyword === "let") { + return true; + } else if (keyword === "yield") { + return !this.state.inGenerator; + } + } + + return false; +}; + // Tests whether parsed token is a contextual keyword. pp.isContextual = function (name) { diff --git a/src/plugins/flow.js b/src/plugins/flow.js index 07c68d55c6..4bc211ccb1 100644 --- a/src/plugins/flow.js +++ b/src/plugins/flow.js @@ -21,7 +21,7 @@ pp.flowParseDeclareClass = function (node) { pp.flowParseDeclareFunction = function (node) { this.next(); - var id = node.id = this.parseIdent(); + var id = node.id = this.parseIdentifier(); var typeNode = this.startNode(); var typeContainer = this.startNode(); @@ -76,7 +76,7 @@ pp.flowParseDeclareModule = function (node) { if (this.match(tt.string)) { node.id = this.parseExprAtom(); } else { - node.id = this.parseIdent(); + node.id = this.parseIdentifier(); } var bodyNode = node.body = this.startNode(); @@ -100,7 +100,7 @@ pp.flowParseDeclareModule = function (node) { // Interfaces pp.flowParseInterfaceish = function (node, allowStatic) { - node.id = this.parseIdent(); + node.id = this.parseIdentifier(); if (this.isRelational("<")) { node.typeParameters = this.flowParseTypeParameterDeclaration(); @@ -122,7 +122,7 @@ pp.flowParseInterfaceish = function (node, allowStatic) { pp.flowParseInterfaceExtends = function () { var node = this.startNode(); - node.id = this.parseIdent(); + node.id = this.parseIdentifier(); if (this.isRelational("<")) { node.typeParameters = this.flowParseTypeParameterInstantiation(); } else { @@ -140,7 +140,7 @@ pp.flowParseInterface = function (node) { // Type aliases pp.flowParseTypeAlias = function (node) { - node.id = this.parseIdent(); + node.id = this.parseIdentifier(); if (this.isRelational("<")) { node.typeParameters = this.flowParseTypeParameterDeclaration(); @@ -193,7 +193,7 @@ pp.flowParseTypeParameterInstantiation = function () { }; pp.flowParseObjectPropertyKey = function () { - return (this.match(tt.num) || this.match(tt.string)) ? this.parseExprAtom() : this.parseIdent(true); + return (this.match(tt.num) || this.match(tt.string)) ? this.parseExprAtom() : this.parseIdentifier(true); }; pp.flowParseObjectTypeIndexer = function (node, isStatic) { @@ -280,7 +280,7 @@ pp.flowParseObjectType = function (allowStatic) { nodeStart.callProperties.push(this.flowParseObjectTypeCallProperty(node, allowStatic)); } else { if (isStatic && this.match(tt.colon)) { - propertyKey = this.parseIdent(); + propertyKey = this.parseIdentifier(); } else { propertyKey = this.flowParseObjectPropertyKey(); } @@ -321,7 +321,7 @@ pp.flowParseGenericType = function (startPos, startLoc, id) { while (this.eat(tt.dot)) { var node2 = this.startNodeAt(startPos, startLoc); node2.qualification = node.id; - node2.id = this.parseIdent(); + node2.id = this.parseIdentifier(); node.id = this.finishNode(node2, "QualifiedTypeIdentifier"); } @@ -356,7 +356,7 @@ pp.flowParseTupleType = function () { pp.flowParseFunctionTypeParam = function () { var optional = false; var node = this.startNode(); - node.name = this.parseIdent(); + node.name = this.parseIdentifier(); if (this.eat(tt.question)) { optional = true; } @@ -417,7 +417,7 @@ pp.flowParsePrimaryType = function () { switch (this.state.type) { case tt.name: - return this.flowIdentToTypeAnnotation(startPos, startLoc, node, this.parseIdent()); + return this.flowIdentToTypeAnnotation(startPos, startLoc, node, this.parseIdentifier()); case tt.braceL: return this.flowParseObjectType(); @@ -570,7 +570,7 @@ pp.flowParseTypeAnnotation = function () { }; pp.flowParseTypeAnnotatableIdentifier = function (requireTypeAnnotation, canBeOptionalParam) { - var ident = this.parseIdent(); + var ident = this.parseIdentifier(); var isOptionalParam = false; if (canBeOptionalParam && this.eat(tt.question)) { @@ -592,7 +592,7 @@ pp.flowParseTypeAnnotatableIdentifier = function (requireTypeAnnotation, canBeOp }; export default function (instance) { - // function name(): string {} + // plain function return types: function name(): string {} instance.extend("parseFunctionBody", function (inner) { return function (node, allowExpression) { if (this.match(tt.colon) && !allowExpression) { @@ -605,6 +605,7 @@ export default function (instance) { }; }); + // interfaces instance.extend("parseStatement", function (inner) { return function (declaration, topLevel) { // strict mode handling of `interface` since it's a reserved word @@ -618,6 +619,7 @@ export default function (instance) { }; }); + // declares, interfaces and type aliases instance.extend("parseExpressionStatement", function (inner) { return function (node, expr) { if (expr.type === "Identifier") { @@ -638,6 +640,7 @@ export default function (instance) { }; }); + // export type instance.extend("shouldParseExportDeclaration", function (inner) { return function () { return this.isContextual("type") || inner.call(this); @@ -723,6 +726,7 @@ export default function (instance) { }; }); + // ensure that inside flow types, we bypass the jsx parser plugin instance.extend("readToken", function (inner) { return function (code) { if (this.state.inType && (code === 62 || code === 60)) { @@ -733,6 +737,7 @@ export default function (instance) { }; }); + // don't lex any token as a jsx one inside a flow type instance.extend("jsx_readToken", function (inner) { return function () { if (!this.state.inType) return inner.call(this); @@ -744,6 +749,7 @@ export default function (instance) { return node.expression; } + // turn type casts that we found in function parameter head into type annotated params instance.extend("toAssignableList", function (inner) { return function (exprList, isBinding) { for (var i = 0; i < exprList.length; i++) { @@ -756,6 +762,8 @@ export default function (instance) { }; }); + // this is a list of nodes, from something like a call expression, we need to filter the + // type casts that we've found that are illegal in this context instance.extend("toReferencedList", function () { return function (exprList) { for (var i = 0; i < exprList.length; i++) { @@ -769,6 +777,8 @@ export default function (instance) { }; }); + // parse an item inside a expression list eg. `(NODE, NODE)` where NODE represents + // the position where this function is cal;ed instance.extend("parseExprListItem", function (inner) { return function (allowEmpty, refShorthandDefaultPos) { var container = this.startNode(); @@ -784,6 +794,7 @@ export default function (instance) { }; }); + // parse class property type annotations instance.extend("parseClassProperty", function (inner) { return function (node) { if (this.match(tt.colon)) { @@ -793,12 +804,14 @@ export default function (instance) { }; }); + // determine whether or not we're currently in the position where a class property would appear instance.extend("isClassProperty", function (inner) { return function () { return this.match(tt.colon) || inner.call(this); }; }); + // parse type parameters for class methods instance.extend("parseClassMethod", function () { return function (classBody, method, isGenerator, isAsync) { var typeParameters; @@ -811,6 +824,7 @@ export default function (instance) { }; }); + // parse a the super class type parameters and implements instance.extend("parseClassSuper", function (inner) { return function (node, isStatement) { inner.call(this, node, isStatement); @@ -822,7 +836,7 @@ export default function (instance) { var implemented = node.implements = []; do { let node = this.startNode(); - node.id = this.parseIdent(); + node.id = this.parseIdentifier(); if (this.isRelational("<")) { node.typeParameters = this.flowParseTypeParameterInstantiation(); } else { @@ -834,6 +848,7 @@ export default function (instance) { }; }); + // parse type parameters for object method shorthand instance.extend("parseObjPropValue", function (inner) { return function (prop) { var typeParameters; @@ -866,11 +881,18 @@ export default function (instance) { }; }); + + // parse typeof and type imports instance.extend("parseImportSpecifiers", function (inner) { return function (node) { node.importKind = "value"; - var kind = (this.match(tt._typeof) ? "typeof" : (this.isContextual("type") ? "type" : null)); + var kind = null; + if (this.match(tt._typeof)) { + kind = "typeof"; + } else if (this.isContextual("type")) { + kind = "type"; + } if (kind) { var lh = this.lookahead(); if ((lh.type === tt.name && lh.value !== "from") || lh.type === tt.braceL || lh.type === tt.star) { @@ -883,7 +905,7 @@ export default function (instance) { }; }); - // function foo() {} + // parse function type parameters - function foo() {} instance.extend("parseFunctionParams", function (inner) { return function (node) { if (this.isRelational("<")) { @@ -893,7 +915,7 @@ export default function (instance) { }; }); - // var foo: string = bar + // parse flow type annotations on variable declarator heads - var foo: string = bar instance.extend("parseVarHead", function (inner) { return function (decl) { inner.call(this, decl); @@ -904,7 +926,7 @@ export default function (instance) { }; }); - // var foo = (async (): number => {}); + // parse the return type of an async arrow function - var foo = (async (): number => {}); instance.extend("parseAsyncArrowFromCallExpression", function (inner) { return function (node, call) { if (this.match(tt.colon)) { @@ -915,6 +937,14 @@ export default function (instance) { }; }); + // todo description + instance.extend("shouldParseAsyncArrow", function (inner) { + return function () { + return this.match(tt.colon) || inner.call(this); + }; + }); + + // handle return types for arrow functions instance.extend("parseParenAndDistinguishExpression", function (inner) { return function (startPos, startLoc, canBeArrow, isAsync) { startPos = startPos || this.state.start; diff --git a/test/fixtures/core/uncategorised/484/expected.json b/test/fixtures/core/uncategorised/484/expected.json new file mode 100644 index 0000000000..c110e76a57 --- /dev/null +++ b/test/fixtures/core/uncategorised/484/expected.json @@ -0,0 +1,117 @@ +{ + "type": "File", + "start": 0, + "end": 32, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 32 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 32, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 32 + } + }, + "sourceType": "script", + "body": [ + { + "type": "FunctionDeclaration", + "start": 0, + "end": 32, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 32 + } + }, + "id": { + "type": "Identifier", + "start": 9, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "name": "eval" + }, + "generator": false, + "expression": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 16, + "end": 32, + "loc": { + "start": { + "line": 1, + "column": 16 + }, + "end": { + "line": 1, + "column": 32 + } + }, + "body": [ + { + "type": "ExpressionStatement", + "start": 17, + "end": 30, + "loc": { + "start": { + "line": 1, + "column": 17 + }, + "end": { + "line": 1, + "column": 30 + } + }, + "expression": { + "type": "Literal", + "start": 17, + "end": 29, + "loc": { + "start": { + "line": 1, + "column": 17 + }, + "end": { + "line": 1, + "column": 29 + } + }, + "value": "use strict", + "rawValue": "use strict", + "raw": "'use strict'" + } + } + ] + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/485/expected.json b/test/fixtures/core/uncategorised/485/expected.json new file mode 100644 index 0000000000..817f907aee --- /dev/null +++ b/test/fixtures/core/uncategorised/485/expected.json @@ -0,0 +1,117 @@ +{ + "type": "File", + "start": 0, + "end": 37, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 37 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 37, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 37 + } + }, + "sourceType": "script", + "body": [ + { + "type": "FunctionDeclaration", + "start": 0, + "end": 37, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 37 + } + }, + "id": { + "type": "Identifier", + "start": 9, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "name": "arguments" + }, + "generator": false, + "expression": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 21, + "end": 37, + "loc": { + "start": { + "line": 1, + "column": 21 + }, + "end": { + "line": 1, + "column": 37 + } + }, + "body": [ + { + "type": "ExpressionStatement", + "start": 22, + "end": 35, + "loc": { + "start": { + "line": 1, + "column": 22 + }, + "end": { + "line": 1, + "column": 35 + } + }, + "expression": { + "type": "Literal", + "start": 22, + "end": 34, + "loc": { + "start": { + "line": 1, + "column": 22 + }, + "end": { + "line": 1, + "column": 34 + } + }, + "value": "use strict", + "rawValue": "use strict", + "raw": "'use strict'" + } + } + ] + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/488/expected.json b/test/fixtures/core/uncategorised/488/expected.json new file mode 100644 index 0000000000..1a995ca123 --- /dev/null +++ b/test/fixtures/core/uncategorised/488/expected.json @@ -0,0 +1,149 @@ +{ + "type": "File", + "start": 0, + "end": 36, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 36 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 36, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 36 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 36, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 36 + } + }, + "expression": { + "type": "CallExpression", + "start": 0, + "end": 36, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 36 + } + }, + "callee": { + "type": "FunctionExpression", + "start": 1, + "end": 33, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 33 + } + }, + "id": { + "type": "Identifier", + "start": 10, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "name": "eval" + }, + "generator": false, + "expression": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 17, + "end": 33, + "loc": { + "start": { + "line": 1, + "column": 17 + }, + "end": { + "line": 1, + "column": 33 + } + }, + "body": [ + { + "type": "ExpressionStatement", + "start": 18, + "end": 31, + "loc": { + "start": { + "line": 1, + "column": 18 + }, + "end": { + "line": 1, + "column": 31 + } + }, + "expression": { + "type": "Literal", + "start": 18, + "end": 30, + "loc": { + "start": { + "line": 1, + "column": 18 + }, + "end": { + "line": 1, + "column": 30 + } + }, + "value": "use strict", + "rawValue": "use strict", + "raw": "'use strict'" + } + } + ] + }, + "parenthesizedExpression": true + }, + "arguments": [] + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/489/expected.json b/test/fixtures/core/uncategorised/489/expected.json new file mode 100644 index 0000000000..34984de2e0 --- /dev/null +++ b/test/fixtures/core/uncategorised/489/expected.json @@ -0,0 +1,149 @@ +{ + "type": "File", + "start": 0, + "end": 41, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 41 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 41, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 41 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 41, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 41 + } + }, + "expression": { + "type": "CallExpression", + "start": 0, + "end": 41, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 41 + } + }, + "callee": { + "type": "FunctionExpression", + "start": 1, + "end": 38, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 38 + } + }, + "id": { + "type": "Identifier", + "start": 10, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 19 + } + }, + "name": "arguments" + }, + "generator": false, + "expression": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 22, + "end": 38, + "loc": { + "start": { + "line": 1, + "column": 22 + }, + "end": { + "line": 1, + "column": 38 + } + }, + "body": [ + { + "type": "ExpressionStatement", + "start": 23, + "end": 36, + "loc": { + "start": { + "line": 1, + "column": 23 + }, + "end": { + "line": 1, + "column": 36 + } + }, + "expression": { + "type": "Literal", + "start": 23, + "end": 35, + "loc": { + "start": { + "line": 1, + "column": 23 + }, + "end": { + "line": 1, + "column": 35 + } + }, + "value": "use strict", + "rawValue": "use strict", + "raw": "'use strict'" + } + } + ] + }, + "parenthesizedExpression": true + }, + "arguments": [] + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/491/expected.json b/test/fixtures/core/uncategorised/491/expected.json new file mode 100644 index 0000000000..d0765fadb6 --- /dev/null +++ b/test/fixtures/core/uncategorised/491/expected.json @@ -0,0 +1,149 @@ +{ + "type": "File", + "start": 0, + "end": 39, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 39 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 39, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 39 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 39, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 39 + } + }, + "expression": { + "type": "CallExpression", + "start": 0, + "end": 39, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 39 + } + }, + "callee": { + "type": "FunctionExpression", + "start": 1, + "end": 36, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 36 + } + }, + "id": { + "type": "Identifier", + "start": 10, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "name": "package" + }, + "generator": false, + "expression": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 20, + "end": 36, + "loc": { + "start": { + "line": 1, + "column": 20 + }, + "end": { + "line": 1, + "column": 36 + } + }, + "body": [ + { + "type": "ExpressionStatement", + "start": 21, + "end": 34, + "loc": { + "start": { + "line": 1, + "column": 21 + }, + "end": { + "line": 1, + "column": 34 + } + }, + "expression": { + "type": "Literal", + "start": 21, + "end": 33, + "loc": { + "start": { + "line": 1, + "column": 21 + }, + "end": { + "line": 1, + "column": 33 + } + }, + "value": "use strict", + "rawValue": "use strict", + "raw": "'use strict'" + } + } + ] + }, + "parenthesizedExpression": true + }, + "arguments": [] + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/495/expected.json b/test/fixtures/core/uncategorised/495/expected.json new file mode 100644 index 0000000000..6aa54306ed --- /dev/null +++ b/test/fixtures/core/uncategorised/495/expected.json @@ -0,0 +1,134 @@ +{ + "type": "File", + "start": 0, + "end": 36, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 36 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 36, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 36 + } + }, + "sourceType": "script", + "body": [ + { + "type": "FunctionDeclaration", + "start": 0, + "end": 36, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 36 + } + }, + "id": { + "type": "Identifier", + "start": 9, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "name": "hello" + }, + "generator": false, + "expression": false, + "params": [ + { + "type": "Identifier", + "start": 15, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 19 + } + }, + "name": "eval" + } + ], + "body": { + "type": "BlockStatement", + "start": 21, + "end": 36, + "loc": { + "start": { + "line": 1, + "column": 21 + }, + "end": { + "line": 1, + "column": 36 + } + }, + "body": [ + { + "type": "ExpressionStatement", + "start": 22, + "end": 35, + "loc": { + "start": { + "line": 1, + "column": 22 + }, + "end": { + "line": 1, + "column": 35 + } + }, + "expression": { + "type": "Literal", + "start": 22, + "end": 34, + "loc": { + "start": { + "line": 1, + "column": 22 + }, + "end": { + "line": 1, + "column": 34 + } + }, + "value": "use strict", + "rawValue": "use strict", + "raw": "'use strict'" + } + } + ] + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/496/expected.json b/test/fixtures/core/uncategorised/496/expected.json new file mode 100644 index 0000000000..5fbf9ec4b8 --- /dev/null +++ b/test/fixtures/core/uncategorised/496/expected.json @@ -0,0 +1,134 @@ +{ + "type": "File", + "start": 0, + "end": 41, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 41 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 41, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 41 + } + }, + "sourceType": "script", + "body": [ + { + "type": "FunctionDeclaration", + "start": 0, + "end": 41, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 41 + } + }, + "id": { + "type": "Identifier", + "start": 9, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "name": "hello" + }, + "generator": false, + "expression": false, + "params": [ + { + "type": "Identifier", + "start": 15, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 24 + } + }, + "name": "arguments" + } + ], + "body": { + "type": "BlockStatement", + "start": 26, + "end": 41, + "loc": { + "start": { + "line": 1, + "column": 26 + }, + "end": { + "line": 1, + "column": 41 + } + }, + "body": [ + { + "type": "ExpressionStatement", + "start": 27, + "end": 40, + "loc": { + "start": { + "line": 1, + "column": 27 + }, + "end": { + "line": 1, + "column": 40 + } + }, + "expression": { + "type": "Literal", + "start": 27, + "end": 39, + "loc": { + "start": { + "line": 1, + "column": 27 + }, + "end": { + "line": 1, + "column": 39 + } + }, + "value": "use strict", + "rawValue": "use strict", + "raw": "'use strict'" + } + } + ] + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/511/expected.json b/test/fixtures/core/uncategorised/511/expected.json new file mode 100644 index 0000000000..9454908513 --- /dev/null +++ b/test/fixtures/core/uncategorised/511/expected.json @@ -0,0 +1,134 @@ +{ + "type": "File", + "start": 0, + "end": 40, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 40 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 40, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 40 + } + }, + "sourceType": "script", + "body": [ + { + "type": "FunctionDeclaration", + "start": 0, + "end": 40, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 40 + } + }, + "id": { + "type": "Identifier", + "start": 9, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "name": "hello" + }, + "generator": false, + "expression": false, + "params": [ + { + "type": "Identifier", + "start": 15, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 21 + } + }, + "name": "static" + } + ], + "body": { + "type": "BlockStatement", + "start": 23, + "end": 40, + "loc": { + "start": { + "line": 1, + "column": 23 + }, + "end": { + "line": 1, + "column": 40 + } + }, + "body": [ + { + "type": "ExpressionStatement", + "start": 25, + "end": 38, + "loc": { + "start": { + "line": 1, + "column": 25 + }, + "end": { + "line": 1, + "column": 38 + } + }, + "expression": { + "type": "Literal", + "start": 25, + "end": 37, + "loc": { + "start": { + "line": 1, + "column": 25 + }, + "end": { + "line": 1, + "column": 37 + } + }, + "value": "use strict", + "rawValue": "use strict", + "raw": "\"use strict\"" + } + } + ] + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/512/expected.json b/test/fixtures/core/uncategorised/512/expected.json new file mode 100644 index 0000000000..42dbd8e915 --- /dev/null +++ b/test/fixtures/core/uncategorised/512/expected.json @@ -0,0 +1,117 @@ +{ + "type": "File", + "start": 0, + "end": 35, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 35 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 35, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 35 + } + }, + "sourceType": "script", + "body": [ + { + "type": "FunctionDeclaration", + "start": 0, + "end": 35, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 35 + } + }, + "id": { + "type": "Identifier", + "start": 9, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "name": "static" + }, + "generator": false, + "expression": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 18, + "end": 35, + "loc": { + "start": { + "line": 1, + "column": 18 + }, + "end": { + "line": 1, + "column": 35 + } + }, + "body": [ + { + "type": "ExpressionStatement", + "start": 20, + "end": 33, + "loc": { + "start": { + "line": 1, + "column": 20 + }, + "end": { + "line": 1, + "column": 33 + } + }, + "expression": { + "type": "Literal", + "start": 20, + "end": 32, + "loc": { + "start": { + "line": 1, + "column": 20 + }, + "end": { + "line": 1, + "column": 32 + } + }, + "value": "use strict", + "rawValue": "use strict", + "raw": "\"use strict\"" + } + } + ] + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/515/expected.json b/test/fixtures/core/uncategorised/515/expected.json new file mode 100644 index 0000000000..14824eac9f --- /dev/null +++ b/test/fixtures/core/uncategorised/515/expected.json @@ -0,0 +1,134 @@ +{ + "type": "File", + "start": 0, + "end": 34, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 34 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 34, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 34 + } + }, + "sourceType": "script", + "body": [ + { + "type": "FunctionDeclaration", + "start": 0, + "end": 34, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 34 + } + }, + "id": { + "type": "Identifier", + "start": 9, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "name": "a" + }, + "generator": false, + "expression": false, + "params": [ + { + "type": "Identifier", + "start": 11, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 11 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "name": "eval" + } + ], + "body": { + "type": "BlockStatement", + "start": 17, + "end": 34, + "loc": { + "start": { + "line": 1, + "column": 17 + }, + "end": { + "line": 1, + "column": 34 + } + }, + "body": [ + { + "type": "ExpressionStatement", + "start": 19, + "end": 32, + "loc": { + "start": { + "line": 1, + "column": 19 + }, + "end": { + "line": 1, + "column": 32 + } + }, + "expression": { + "type": "Literal", + "start": 19, + "end": 31, + "loc": { + "start": { + "line": 1, + "column": 19 + }, + "end": { + "line": 1, + "column": 31 + } + }, + "value": "use strict", + "rawValue": "use strict", + "raw": "\"use strict\"" + } + } + ] + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/516/expected.json b/test/fixtures/core/uncategorised/516/expected.json new file mode 100644 index 0000000000..b18233c76a --- /dev/null +++ b/test/fixtures/core/uncategorised/516/expected.json @@ -0,0 +1,134 @@ +{ + "type": "File", + "start": 0, + "end": 37, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 37 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 37, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 37 + } + }, + "sourceType": "script", + "body": [ + { + "type": "FunctionDeclaration", + "start": 0, + "end": 37, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 37 + } + }, + "id": { + "type": "Identifier", + "start": 9, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "name": "a" + }, + "generator": false, + "expression": false, + "params": [ + { + "type": "Identifier", + "start": 11, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 11 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "name": "package" + } + ], + "body": { + "type": "BlockStatement", + "start": 20, + "end": 37, + "loc": { + "start": { + "line": 1, + "column": 20 + }, + "end": { + "line": 1, + "column": 37 + } + }, + "body": [ + { + "type": "ExpressionStatement", + "start": 22, + "end": 35, + "loc": { + "start": { + "line": 1, + "column": 22 + }, + "end": { + "line": 1, + "column": 35 + } + }, + "expression": { + "type": "Literal", + "start": 22, + "end": 34, + "loc": { + "start": { + "line": 1, + "column": 22 + }, + "end": { + "line": 1, + "column": 34 + } + }, + "value": "use strict", + "rawValue": "use strict", + "raw": "\"use strict\"" + } + } + ] + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/520/expected.json b/test/fixtures/core/uncategorised/520/expected.json new file mode 100644 index 0000000000..a4e3e8cbd5 --- /dev/null +++ b/test/fixtures/core/uncategorised/520/expected.json @@ -0,0 +1,150 @@ +{ + "type": "File", + "start": 0, + "end": 36, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 36 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 36, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 36 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 36, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 36 + } + }, + "expression": { + "type": "FunctionExpression", + "start": 1, + "end": 35, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 35 + } + }, + "id": { + "type": "Identifier", + "start": 10, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "name": "a" + }, + "generator": false, + "expression": false, + "params": [ + { + "type": "Identifier", + "start": 12, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 12 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "name": "eval" + } + ], + "body": { + "type": "BlockStatement", + "start": 18, + "end": 35, + "loc": { + "start": { + "line": 1, + "column": 18 + }, + "end": { + "line": 1, + "column": 35 + } + }, + "body": [ + { + "type": "ExpressionStatement", + "start": 20, + "end": 33, + "loc": { + "start": { + "line": 1, + "column": 20 + }, + "end": { + "line": 1, + "column": 33 + } + }, + "expression": { + "type": "Literal", + "start": 20, + "end": 32, + "loc": { + "start": { + "line": 1, + "column": 20 + }, + "end": { + "line": 1, + "column": 32 + } + }, + "value": "use strict", + "rawValue": "use strict", + "raw": "\"use strict\"" + } + } + ] + }, + "parenthesizedExpression": true + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/521/expected.json b/test/fixtures/core/uncategorised/521/expected.json new file mode 100644 index 0000000000..63264f0559 --- /dev/null +++ b/test/fixtures/core/uncategorised/521/expected.json @@ -0,0 +1,150 @@ +{ + "type": "File", + "start": 0, + "end": 39, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 39 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 39, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 39 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 39, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 39 + } + }, + "expression": { + "type": "FunctionExpression", + "start": 1, + "end": 38, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 38 + } + }, + "id": { + "type": "Identifier", + "start": 10, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "name": "a" + }, + "generator": false, + "expression": false, + "params": [ + { + "type": "Identifier", + "start": 12, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 12 + }, + "end": { + "line": 1, + "column": 19 + } + }, + "name": "package" + } + ], + "body": { + "type": "BlockStatement", + "start": 21, + "end": 38, + "loc": { + "start": { + "line": 1, + "column": 21 + }, + "end": { + "line": 1, + "column": 38 + } + }, + "body": [ + { + "type": "ExpressionStatement", + "start": 23, + "end": 36, + "loc": { + "start": { + "line": 1, + "column": 23 + }, + "end": { + "line": 1, + "column": 36 + } + }, + "expression": { + "type": "Literal", + "start": 23, + "end": 35, + "loc": { + "start": { + "line": 1, + "column": 23 + }, + "end": { + "line": 1, + "column": 35 + } + }, + "value": "use strict", + "rawValue": "use strict", + "raw": "\"use strict\"" + } + } + ] + }, + "parenthesizedExpression": true + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/536/expected.json b/test/fixtures/core/uncategorised/536/expected.json new file mode 100644 index 0000000000..050ac2d8b2 --- /dev/null +++ b/test/fixtures/core/uncategorised/536/expected.json @@ -0,0 +1,83 @@ +{ + "type": "File", + "start": 0, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "sourceType": "script", + "body": [ + { + "type": "VariableDeclaration", + "start": 0, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 6, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "id": { + "type": "Identifier", + "start": 6, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "name": "a" + }, + "init": null + } + ], + "kind": "var" + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/LICENSE b/test/fixtures/esprima/LICENSE new file mode 100644 index 0000000000..17557eceb9 --- /dev/null +++ b/test/fixtures/esprima/LICENSE @@ -0,0 +1,21 @@ +Copyright (c) jQuery Foundation, Inc. and Contributors, All Rights Reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY +DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF +THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/test/fixtures/esprima/automatic-semicolon-insertion/migrated_0000/actual.js b/test/fixtures/esprima/automatic-semicolon-insertion/migrated_0000/actual.js new file mode 100644 index 0000000000..fd33f0ef61 --- /dev/null +++ b/test/fixtures/esprima/automatic-semicolon-insertion/migrated_0000/actual.js @@ -0,0 +1,2 @@ +{ x +++y } diff --git a/test/fixtures/esprima/automatic-semicolon-insertion/migrated_0000/expected.json b/test/fixtures/esprima/automatic-semicolon-insertion/migrated_0000/expected.json new file mode 100644 index 0000000000..bab8079535 --- /dev/null +++ b/test/fixtures/esprima/automatic-semicolon-insertion/migrated_0000/expected.json @@ -0,0 +1,129 @@ +{ + "type": "File", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 5 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 5 + } + }, + "sourceType": "script", + "body": [ + { + "type": "BlockStatement", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 5 + } + }, + "body": [ + { + "type": "ExpressionStatement", + "start": 2, + "end": 3, + "loc": { + "start": { + "line": 1, + "column": 2 + }, + "end": { + "line": 1, + "column": 3 + } + }, + "expression": { + "type": "Identifier", + "start": 2, + "end": 3, + "loc": { + "start": { + "line": 1, + "column": 2 + }, + "end": { + "line": 1, + "column": 3 + } + }, + "name": "x" + } + }, + { + "type": "ExpressionStatement", + "start": 4, + "end": 7, + "loc": { + "start": { + "line": 2, + "column": 0 + }, + "end": { + "line": 2, + "column": 3 + } + }, + "expression": { + "type": "UpdateExpression", + "start": 4, + "end": 7, + "loc": { + "start": { + "line": 2, + "column": 0 + }, + "end": { + "line": 2, + "column": 3 + } + }, + "operator": "++", + "prefix": true, + "argument": { + "type": "Identifier", + "start": 6, + "end": 7, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 2, + "column": 3 + } + }, + "name": "y" + } + } + } + ] + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/automatic-semicolon-insertion/migrated_0001/actual.js b/test/fixtures/esprima/automatic-semicolon-insertion/migrated_0001/actual.js new file mode 100644 index 0000000000..6823a7ff85 --- /dev/null +++ b/test/fixtures/esprima/automatic-semicolon-insertion/migrated_0001/actual.js @@ -0,0 +1,2 @@ +{ x +--y } diff --git a/test/fixtures/esprima/automatic-semicolon-insertion/migrated_0001/expected.json b/test/fixtures/esprima/automatic-semicolon-insertion/migrated_0001/expected.json new file mode 100644 index 0000000000..e7aa5f92ff --- /dev/null +++ b/test/fixtures/esprima/automatic-semicolon-insertion/migrated_0001/expected.json @@ -0,0 +1,129 @@ +{ + "type": "File", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 5 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 5 + } + }, + "sourceType": "script", + "body": [ + { + "type": "BlockStatement", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 5 + } + }, + "body": [ + { + "type": "ExpressionStatement", + "start": 2, + "end": 3, + "loc": { + "start": { + "line": 1, + "column": 2 + }, + "end": { + "line": 1, + "column": 3 + } + }, + "expression": { + "type": "Identifier", + "start": 2, + "end": 3, + "loc": { + "start": { + "line": 1, + "column": 2 + }, + "end": { + "line": 1, + "column": 3 + } + }, + "name": "x" + } + }, + { + "type": "ExpressionStatement", + "start": 4, + "end": 7, + "loc": { + "start": { + "line": 2, + "column": 0 + }, + "end": { + "line": 2, + "column": 3 + } + }, + "expression": { + "type": "UpdateExpression", + "start": 4, + "end": 7, + "loc": { + "start": { + "line": 2, + "column": 0 + }, + "end": { + "line": 2, + "column": 3 + } + }, + "operator": "--", + "prefix": true, + "argument": { + "type": "Identifier", + "start": 6, + "end": 7, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 2, + "column": 3 + } + }, + "name": "y" + } + } + } + ] + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/automatic-semicolon-insertion/migrated_0002/actual.js b/test/fixtures/esprima/automatic-semicolon-insertion/migrated_0002/actual.js new file mode 100644 index 0000000000..7dc79c7a8d --- /dev/null +++ b/test/fixtures/esprima/automatic-semicolon-insertion/migrated_0002/actual.js @@ -0,0 +1 @@ +var x /* comment */; diff --git a/test/fixtures/esprima/automatic-semicolon-insertion/migrated_0002/expected.json b/test/fixtures/esprima/automatic-semicolon-insertion/migrated_0002/expected.json new file mode 100644 index 0000000000..bfca2ac2a5 --- /dev/null +++ b/test/fixtures/esprima/automatic-semicolon-insertion/migrated_0002/expected.json @@ -0,0 +1,129 @@ +{ + "type": "File", + "start": 0, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "sourceType": "script", + "body": [ + { + "type": "VariableDeclaration", + "start": 0, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 4, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "id": { + "type": "Identifier", + "start": 4, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "name": "x", + "leadingComments": null, + "trailingComments": null + }, + "init": null, + "trailingComments": [ + { + "type": "CommentBlock", + "value": " comment ", + "start": 6, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 19 + } + }, + "range": [ + 6, + 19 + ] + } + ] + } + ], + "kind": "var" + } + ] + }, + "comments": [ + { + "type": "CommentBlock", + "value": " comment ", + "start": 6, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 19 + } + }, + "range": [ + 6, + 19 + ] + } + ] +} \ No newline at end of file diff --git a/test/fixtures/esprima/automatic-semicolon-insertion/migrated_0003/actual.js b/test/fixtures/esprima/automatic-semicolon-insertion/migrated_0003/actual.js new file mode 100644 index 0000000000..2f881957fe --- /dev/null +++ b/test/fixtures/esprima/automatic-semicolon-insertion/migrated_0003/actual.js @@ -0,0 +1,2 @@ +{ var x = 14, y = 3 +z; } diff --git a/test/fixtures/esprima/automatic-semicolon-insertion/migrated_0003/expected.json b/test/fixtures/esprima/automatic-semicolon-insertion/migrated_0003/expected.json new file mode 100644 index 0000000000..54b06ec57a --- /dev/null +++ b/test/fixtures/esprima/automatic-semicolon-insertion/migrated_0003/expected.json @@ -0,0 +1,197 @@ +{ + "type": "File", + "start": 0, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 4 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 4 + } + }, + "sourceType": "script", + "body": [ + { + "type": "BlockStatement", + "start": 0, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 4 + } + }, + "body": [ + { + "type": "VariableDeclaration", + "start": 2, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 2 + }, + "end": { + "line": 1, + "column": 19 + } + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 6, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "id": { + "type": "Identifier", + "start": 6, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "name": "x" + }, + "init": { + "type": "Literal", + "start": 10, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "value": 14, + "rawValue": 14, + "raw": "14" + } + }, + { + "type": "VariableDeclarator", + "start": 14, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 14 + }, + "end": { + "line": 1, + "column": 19 + } + }, + "id": { + "type": "Identifier", + "start": 14, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 14 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "name": "y" + }, + "init": { + "type": "Literal", + "start": 18, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 18 + }, + "end": { + "line": 1, + "column": 19 + } + }, + "value": 3, + "rawValue": 3, + "raw": "3" + } + } + ], + "kind": "var" + }, + { + "type": "ExpressionStatement", + "start": 20, + "end": 22, + "loc": { + "start": { + "line": 2, + "column": 0 + }, + "end": { + "line": 2, + "column": 2 + } + }, + "expression": { + "type": "Identifier", + "start": 20, + "end": 21, + "loc": { + "start": { + "line": 2, + "column": 0 + }, + "end": { + "line": 2, + "column": 1 + } + }, + "name": "z" + } + } + ] + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/automatic-semicolon-insertion/migrated_0004/actual.js b/test/fixtures/esprima/automatic-semicolon-insertion/migrated_0004/actual.js new file mode 100644 index 0000000000..a2a0280978 --- /dev/null +++ b/test/fixtures/esprima/automatic-semicolon-insertion/migrated_0004/actual.js @@ -0,0 +1,2 @@ +while (true) { continue +there; } diff --git a/test/fixtures/esprima/automatic-semicolon-insertion/migrated_0004/expected.json b/test/fixtures/esprima/automatic-semicolon-insertion/migrated_0004/expected.json new file mode 100644 index 0000000000..417879a077 --- /dev/null +++ b/test/fixtures/esprima/automatic-semicolon-insertion/migrated_0004/expected.json @@ -0,0 +1,130 @@ +{ + "type": "File", + "start": 0, + "end": 32, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 8 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 32, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 8 + } + }, + "sourceType": "script", + "body": [ + { + "type": "WhileStatement", + "start": 0, + "end": 32, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 8 + } + }, + "test": { + "type": "Literal", + "start": 7, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "value": true, + "rawValue": true, + "raw": "true" + }, + "body": { + "type": "BlockStatement", + "start": 13, + "end": 32, + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 2, + "column": 8 + } + }, + "body": [ + { + "type": "ContinueStatement", + "start": 15, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "label": null + }, + { + "type": "ExpressionStatement", + "start": 24, + "end": 30, + "loc": { + "start": { + "line": 2, + "column": 0 + }, + "end": { + "line": 2, + "column": 6 + } + }, + "expression": { + "type": "Identifier", + "start": 24, + "end": 29, + "loc": { + "start": { + "line": 2, + "column": 0 + }, + "end": { + "line": 2, + "column": 5 + } + }, + "name": "there" + } + } + ] + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/automatic-semicolon-insertion/migrated_0005/actual.js b/test/fixtures/esprima/automatic-semicolon-insertion/migrated_0005/actual.js new file mode 100644 index 0000000000..40aea02e2c --- /dev/null +++ b/test/fixtures/esprima/automatic-semicolon-insertion/migrated_0005/actual.js @@ -0,0 +1,2 @@ +while (true) { continue // Comment +there; } diff --git a/test/fixtures/esprima/automatic-semicolon-insertion/migrated_0005/expected.json b/test/fixtures/esprima/automatic-semicolon-insertion/migrated_0005/expected.json new file mode 100644 index 0000000000..22f542ddac --- /dev/null +++ b/test/fixtures/esprima/automatic-semicolon-insertion/migrated_0005/expected.json @@ -0,0 +1,198 @@ +{ + "type": "File", + "start": 0, + "end": 43, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 8 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 43, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 8 + } + }, + "sourceType": "script", + "body": [ + { + "type": "WhileStatement", + "start": 0, + "end": 43, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 8 + } + }, + "test": { + "type": "Literal", + "start": 7, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "value": true, + "rawValue": true, + "raw": "true" + }, + "body": { + "type": "BlockStatement", + "start": 13, + "end": 43, + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 2, + "column": 8 + } + }, + "body": [ + { + "type": "ContinueStatement", + "start": 15, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "label": null, + "leadingComments": null, + "trailingComments": [ + { + "type": "CommentLine", + "value": " Comment", + "start": 24, + "end": 34, + "loc": { + "start": { + "line": 1, + "column": 24 + }, + "end": { + "line": 1, + "column": 34 + } + }, + "range": [ + 24, + 34 + ] + } + ] + }, + { + "type": "ExpressionStatement", + "start": 35, + "end": 41, + "loc": { + "start": { + "line": 2, + "column": 0 + }, + "end": { + "line": 2, + "column": 6 + } + }, + "expression": { + "type": "Identifier", + "start": 35, + "end": 40, + "loc": { + "start": { + "line": 2, + "column": 0 + }, + "end": { + "line": 2, + "column": 5 + } + }, + "name": "there", + "leadingComments": null + }, + "leadingComments": [ + { + "type": "CommentLine", + "value": " Comment", + "start": 24, + "end": 34, + "loc": { + "start": { + "line": 1, + "column": 24 + }, + "end": { + "line": 1, + "column": 34 + } + }, + "range": [ + 24, + 34 + ] + } + ] + } + ] + } + } + ] + }, + "comments": [ + { + "type": "CommentLine", + "value": " Comment", + "start": 24, + "end": 34, + "loc": { + "start": { + "line": 1, + "column": 24 + }, + "end": { + "line": 1, + "column": 34 + } + }, + "range": [ + 24, + 34 + ] + } + ] +} \ No newline at end of file diff --git a/test/fixtures/esprima/automatic-semicolon-insertion/migrated_0006/actual.js b/test/fixtures/esprima/automatic-semicolon-insertion/migrated_0006/actual.js new file mode 100644 index 0000000000..31cc7daf97 --- /dev/null +++ b/test/fixtures/esprima/automatic-semicolon-insertion/migrated_0006/actual.js @@ -0,0 +1,2 @@ +while (true) { continue /* Multiline +Comment */there; } diff --git a/test/fixtures/esprima/automatic-semicolon-insertion/migrated_0006/expected.json b/test/fixtures/esprima/automatic-semicolon-insertion/migrated_0006/expected.json new file mode 100644 index 0000000000..d4241aabc4 --- /dev/null +++ b/test/fixtures/esprima/automatic-semicolon-insertion/migrated_0006/expected.json @@ -0,0 +1,198 @@ +{ + "type": "File", + "start": 0, + "end": 55, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 18 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 55, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 18 + } + }, + "sourceType": "script", + "body": [ + { + "type": "WhileStatement", + "start": 0, + "end": 55, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 18 + } + }, + "test": { + "type": "Literal", + "start": 7, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "value": true, + "rawValue": true, + "raw": "true" + }, + "body": { + "type": "BlockStatement", + "start": 13, + "end": 55, + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 2, + "column": 18 + } + }, + "body": [ + { + "type": "ContinueStatement", + "start": 15, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "label": null, + "leadingComments": null, + "trailingComments": [ + { + "type": "CommentBlock", + "value": " Multiline\nComment ", + "start": 24, + "end": 47, + "loc": { + "start": { + "line": 1, + "column": 24 + }, + "end": { + "line": 2, + "column": 10 + } + }, + "range": [ + 24, + 47 + ] + } + ] + }, + { + "type": "ExpressionStatement", + "start": 47, + "end": 53, + "loc": { + "start": { + "line": 2, + "column": 10 + }, + "end": { + "line": 2, + "column": 16 + } + }, + "expression": { + "type": "Identifier", + "start": 47, + "end": 52, + "loc": { + "start": { + "line": 2, + "column": 10 + }, + "end": { + "line": 2, + "column": 15 + } + }, + "name": "there", + "leadingComments": null + }, + "leadingComments": [ + { + "type": "CommentBlock", + "value": " Multiline\nComment ", + "start": 24, + "end": 47, + "loc": { + "start": { + "line": 1, + "column": 24 + }, + "end": { + "line": 2, + "column": 10 + } + }, + "range": [ + 24, + 47 + ] + } + ] + } + ] + } + } + ] + }, + "comments": [ + { + "type": "CommentBlock", + "value": " Multiline\nComment ", + "start": 24, + "end": 47, + "loc": { + "start": { + "line": 1, + "column": 24 + }, + "end": { + "line": 2, + "column": 10 + } + }, + "range": [ + 24, + 47 + ] + } + ] +} \ No newline at end of file diff --git a/test/fixtures/esprima/automatic-semicolon-insertion/migrated_0007/actual.js b/test/fixtures/esprima/automatic-semicolon-insertion/migrated_0007/actual.js new file mode 100644 index 0000000000..21400a2714 --- /dev/null +++ b/test/fixtures/esprima/automatic-semicolon-insertion/migrated_0007/actual.js @@ -0,0 +1,2 @@ +while (true) { break +there; } diff --git a/test/fixtures/esprima/automatic-semicolon-insertion/migrated_0007/expected.json b/test/fixtures/esprima/automatic-semicolon-insertion/migrated_0007/expected.json new file mode 100644 index 0000000000..6f55ed4658 --- /dev/null +++ b/test/fixtures/esprima/automatic-semicolon-insertion/migrated_0007/expected.json @@ -0,0 +1,130 @@ +{ + "type": "File", + "start": 0, + "end": 29, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 8 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 29, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 8 + } + }, + "sourceType": "script", + "body": [ + { + "type": "WhileStatement", + "start": 0, + "end": 29, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 8 + } + }, + "test": { + "type": "Literal", + "start": 7, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "value": true, + "rawValue": true, + "raw": "true" + }, + "body": { + "type": "BlockStatement", + "start": 13, + "end": 29, + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 2, + "column": 8 + } + }, + "body": [ + { + "type": "BreakStatement", + "start": 15, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "label": null + }, + { + "type": "ExpressionStatement", + "start": 21, + "end": 27, + "loc": { + "start": { + "line": 2, + "column": 0 + }, + "end": { + "line": 2, + "column": 6 + } + }, + "expression": { + "type": "Identifier", + "start": 21, + "end": 26, + "loc": { + "start": { + "line": 2, + "column": 0 + }, + "end": { + "line": 2, + "column": 5 + } + }, + "name": "there" + } + } + ] + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/automatic-semicolon-insertion/migrated_0008/actual.js b/test/fixtures/esprima/automatic-semicolon-insertion/migrated_0008/actual.js new file mode 100644 index 0000000000..25f5810894 --- /dev/null +++ b/test/fixtures/esprima/automatic-semicolon-insertion/migrated_0008/actual.js @@ -0,0 +1,2 @@ +while (true) { break // Comment +there; } diff --git a/test/fixtures/esprima/automatic-semicolon-insertion/migrated_0008/expected.json b/test/fixtures/esprima/automatic-semicolon-insertion/migrated_0008/expected.json new file mode 100644 index 0000000000..aaf8f84a1d --- /dev/null +++ b/test/fixtures/esprima/automatic-semicolon-insertion/migrated_0008/expected.json @@ -0,0 +1,198 @@ +{ + "type": "File", + "start": 0, + "end": 40, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 8 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 40, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 8 + } + }, + "sourceType": "script", + "body": [ + { + "type": "WhileStatement", + "start": 0, + "end": 40, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 8 + } + }, + "test": { + "type": "Literal", + "start": 7, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "value": true, + "rawValue": true, + "raw": "true" + }, + "body": { + "type": "BlockStatement", + "start": 13, + "end": 40, + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 2, + "column": 8 + } + }, + "body": [ + { + "type": "BreakStatement", + "start": 15, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "label": null, + "leadingComments": null, + "trailingComments": [ + { + "type": "CommentLine", + "value": " Comment", + "start": 21, + "end": 31, + "loc": { + "start": { + "line": 1, + "column": 21 + }, + "end": { + "line": 1, + "column": 31 + } + }, + "range": [ + 21, + 31 + ] + } + ] + }, + { + "type": "ExpressionStatement", + "start": 32, + "end": 38, + "loc": { + "start": { + "line": 2, + "column": 0 + }, + "end": { + "line": 2, + "column": 6 + } + }, + "expression": { + "type": "Identifier", + "start": 32, + "end": 37, + "loc": { + "start": { + "line": 2, + "column": 0 + }, + "end": { + "line": 2, + "column": 5 + } + }, + "name": "there", + "leadingComments": null + }, + "leadingComments": [ + { + "type": "CommentLine", + "value": " Comment", + "start": 21, + "end": 31, + "loc": { + "start": { + "line": 1, + "column": 21 + }, + "end": { + "line": 1, + "column": 31 + } + }, + "range": [ + 21, + 31 + ] + } + ] + } + ] + } + } + ] + }, + "comments": [ + { + "type": "CommentLine", + "value": " Comment", + "start": 21, + "end": 31, + "loc": { + "start": { + "line": 1, + "column": 21 + }, + "end": { + "line": 1, + "column": 31 + } + }, + "range": [ + 21, + 31 + ] + } + ] +} \ No newline at end of file diff --git a/test/fixtures/esprima/automatic-semicolon-insertion/migrated_0009/actual.js b/test/fixtures/esprima/automatic-semicolon-insertion/migrated_0009/actual.js new file mode 100644 index 0000000000..df2c682c74 --- /dev/null +++ b/test/fixtures/esprima/automatic-semicolon-insertion/migrated_0009/actual.js @@ -0,0 +1,2 @@ +while (true) { break /* Multiline +Comment */there; } diff --git a/test/fixtures/esprima/automatic-semicolon-insertion/migrated_0009/expected.json b/test/fixtures/esprima/automatic-semicolon-insertion/migrated_0009/expected.json new file mode 100644 index 0000000000..cae3efe70d --- /dev/null +++ b/test/fixtures/esprima/automatic-semicolon-insertion/migrated_0009/expected.json @@ -0,0 +1,198 @@ +{ + "type": "File", + "start": 0, + "end": 52, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 18 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 52, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 18 + } + }, + "sourceType": "script", + "body": [ + { + "type": "WhileStatement", + "start": 0, + "end": 52, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 18 + } + }, + "test": { + "type": "Literal", + "start": 7, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "value": true, + "rawValue": true, + "raw": "true" + }, + "body": { + "type": "BlockStatement", + "start": 13, + "end": 52, + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 2, + "column": 18 + } + }, + "body": [ + { + "type": "BreakStatement", + "start": 15, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "label": null, + "leadingComments": null, + "trailingComments": [ + { + "type": "CommentBlock", + "value": " Multiline\nComment ", + "start": 21, + "end": 44, + "loc": { + "start": { + "line": 1, + "column": 21 + }, + "end": { + "line": 2, + "column": 10 + } + }, + "range": [ + 21, + 44 + ] + } + ] + }, + { + "type": "ExpressionStatement", + "start": 44, + "end": 50, + "loc": { + "start": { + "line": 2, + "column": 10 + }, + "end": { + "line": 2, + "column": 16 + } + }, + "expression": { + "type": "Identifier", + "start": 44, + "end": 49, + "loc": { + "start": { + "line": 2, + "column": 10 + }, + "end": { + "line": 2, + "column": 15 + } + }, + "name": "there", + "leadingComments": null + }, + "leadingComments": [ + { + "type": "CommentBlock", + "value": " Multiline\nComment ", + "start": 21, + "end": 44, + "loc": { + "start": { + "line": 1, + "column": 21 + }, + "end": { + "line": 2, + "column": 10 + } + }, + "range": [ + 21, + 44 + ] + } + ] + } + ] + } + } + ] + }, + "comments": [ + { + "type": "CommentBlock", + "value": " Multiline\nComment ", + "start": 21, + "end": 44, + "loc": { + "start": { + "line": 1, + "column": 21 + }, + "end": { + "line": 2, + "column": 10 + } + }, + "range": [ + 21, + 44 + ] + } + ] +} \ No newline at end of file diff --git a/test/fixtures/esprima/automatic-semicolon-insertion/migrated_0010/actual.js b/test/fixtures/esprima/automatic-semicolon-insertion/migrated_0010/actual.js new file mode 100644 index 0000000000..0e73a24144 --- /dev/null +++ b/test/fixtures/esprima/automatic-semicolon-insertion/migrated_0010/actual.js @@ -0,0 +1,2 @@ +(function(){ return +x; }) diff --git a/test/fixtures/esprima/automatic-semicolon-insertion/migrated_0010/expected.json b/test/fixtures/esprima/automatic-semicolon-insertion/migrated_0010/expected.json new file mode 100644 index 0000000000..9098864a2b --- /dev/null +++ b/test/fixtures/esprima/automatic-semicolon-insertion/migrated_0010/expected.json @@ -0,0 +1,132 @@ +{ + "type": "File", + "start": 0, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 5 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 5 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 5 + } + }, + "expression": { + "type": "FunctionExpression", + "start": 1, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 2, + "column": 4 + } + }, + "id": null, + "generator": false, + "expression": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 11, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 11 + }, + "end": { + "line": 2, + "column": 4 + } + }, + "body": [ + { + "type": "ReturnStatement", + "start": 13, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 1, + "column": 19 + } + }, + "argument": null + }, + { + "type": "ExpressionStatement", + "start": 20, + "end": 22, + "loc": { + "start": { + "line": 2, + "column": 0 + }, + "end": { + "line": 2, + "column": 2 + } + }, + "expression": { + "type": "Identifier", + "start": 20, + "end": 21, + "loc": { + "start": { + "line": 2, + "column": 0 + }, + "end": { + "line": 2, + "column": 1 + } + }, + "name": "x" + } + } + ] + }, + "parenthesizedExpression": true + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/automatic-semicolon-insertion/migrated_0011/actual.js b/test/fixtures/esprima/automatic-semicolon-insertion/migrated_0011/actual.js new file mode 100644 index 0000000000..f2651888c1 --- /dev/null +++ b/test/fixtures/esprima/automatic-semicolon-insertion/migrated_0011/actual.js @@ -0,0 +1,2 @@ +(function(){ return // Comment +x; }) diff --git a/test/fixtures/esprima/automatic-semicolon-insertion/migrated_0011/expected.json b/test/fixtures/esprima/automatic-semicolon-insertion/migrated_0011/expected.json new file mode 100644 index 0000000000..8c387c91d1 --- /dev/null +++ b/test/fixtures/esprima/automatic-semicolon-insertion/migrated_0011/expected.json @@ -0,0 +1,200 @@ +{ + "type": "File", + "start": 0, + "end": 36, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 5 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 36, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 5 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 36, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 5 + } + }, + "expression": { + "type": "FunctionExpression", + "start": 1, + "end": 35, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 2, + "column": 4 + } + }, + "id": null, + "generator": false, + "expression": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 11, + "end": 35, + "loc": { + "start": { + "line": 1, + "column": 11 + }, + "end": { + "line": 2, + "column": 4 + } + }, + "body": [ + { + "type": "ReturnStatement", + "start": 13, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 1, + "column": 19 + } + }, + "argument": null, + "leadingComments": null, + "trailingComments": [ + { + "type": "CommentLine", + "value": " Comment", + "start": 20, + "end": 30, + "loc": { + "start": { + "line": 1, + "column": 20 + }, + "end": { + "line": 1, + "column": 30 + } + }, + "range": [ + 20, + 30 + ] + } + ] + }, + { + "type": "ExpressionStatement", + "start": 31, + "end": 33, + "loc": { + "start": { + "line": 2, + "column": 0 + }, + "end": { + "line": 2, + "column": 2 + } + }, + "expression": { + "type": "Identifier", + "start": 31, + "end": 32, + "loc": { + "start": { + "line": 2, + "column": 0 + }, + "end": { + "line": 2, + "column": 1 + } + }, + "name": "x", + "leadingComments": null + }, + "leadingComments": [ + { + "type": "CommentLine", + "value": " Comment", + "start": 20, + "end": 30, + "loc": { + "start": { + "line": 1, + "column": 20 + }, + "end": { + "line": 1, + "column": 30 + } + }, + "range": [ + 20, + 30 + ] + } + ] + } + ] + }, + "parenthesizedExpression": true + } + } + ] + }, + "comments": [ + { + "type": "CommentLine", + "value": " Comment", + "start": 20, + "end": 30, + "loc": { + "start": { + "line": 1, + "column": 20 + }, + "end": { + "line": 1, + "column": 30 + } + }, + "range": [ + 20, + 30 + ] + } + ] +} \ No newline at end of file diff --git a/test/fixtures/esprima/automatic-semicolon-insertion/migrated_0012/actual.js b/test/fixtures/esprima/automatic-semicolon-insertion/migrated_0012/actual.js new file mode 100644 index 0000000000..74aa0f55fa --- /dev/null +++ b/test/fixtures/esprima/automatic-semicolon-insertion/migrated_0012/actual.js @@ -0,0 +1,2 @@ +(function(){ return/* Multiline +Comment */x; }) diff --git a/test/fixtures/esprima/automatic-semicolon-insertion/migrated_0012/expected.json b/test/fixtures/esprima/automatic-semicolon-insertion/migrated_0012/expected.json new file mode 100644 index 0000000000..2eb4083a3c --- /dev/null +++ b/test/fixtures/esprima/automatic-semicolon-insertion/migrated_0012/expected.json @@ -0,0 +1,200 @@ +{ + "type": "File", + "start": 0, + "end": 47, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 15 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 47, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 15 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 47, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 15 + } + }, + "expression": { + "type": "FunctionExpression", + "start": 1, + "end": 46, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 2, + "column": 14 + } + }, + "id": null, + "generator": false, + "expression": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 11, + "end": 46, + "loc": { + "start": { + "line": 1, + "column": 11 + }, + "end": { + "line": 2, + "column": 14 + } + }, + "body": [ + { + "type": "ReturnStatement", + "start": 13, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 1, + "column": 19 + } + }, + "argument": null, + "leadingComments": null, + "trailingComments": [ + { + "type": "CommentBlock", + "value": " Multiline\nComment ", + "start": 19, + "end": 42, + "loc": { + "start": { + "line": 1, + "column": 19 + }, + "end": { + "line": 2, + "column": 10 + } + }, + "range": [ + 19, + 42 + ] + } + ] + }, + { + "type": "ExpressionStatement", + "start": 42, + "end": 44, + "loc": { + "start": { + "line": 2, + "column": 10 + }, + "end": { + "line": 2, + "column": 12 + } + }, + "expression": { + "type": "Identifier", + "start": 42, + "end": 43, + "loc": { + "start": { + "line": 2, + "column": 10 + }, + "end": { + "line": 2, + "column": 11 + } + }, + "name": "x", + "leadingComments": null + }, + "leadingComments": [ + { + "type": "CommentBlock", + "value": " Multiline\nComment ", + "start": 19, + "end": 42, + "loc": { + "start": { + "line": 1, + "column": 19 + }, + "end": { + "line": 2, + "column": 10 + } + }, + "range": [ + 19, + 42 + ] + } + ] + } + ] + }, + "parenthesizedExpression": true + } + } + ] + }, + "comments": [ + { + "type": "CommentBlock", + "value": " Multiline\nComment ", + "start": 19, + "end": 42, + "loc": { + "start": { + "line": 1, + "column": 19 + }, + "end": { + "line": 2, + "column": 10 + } + }, + "range": [ + 19, + 42 + ] + } + ] +} \ No newline at end of file diff --git a/test/fixtures/esprima/automatic-semicolon-insertion/migrated_0013/actual.js b/test/fixtures/esprima/automatic-semicolon-insertion/migrated_0013/actual.js new file mode 100644 index 0000000000..1e05557a75 --- /dev/null +++ b/test/fixtures/esprima/automatic-semicolon-insertion/migrated_0013/actual.js @@ -0,0 +1,2 @@ +{ throw error +error; } diff --git a/test/fixtures/esprima/automatic-semicolon-insertion/migrated_0013/expected.json b/test/fixtures/esprima/automatic-semicolon-insertion/migrated_0013/expected.json new file mode 100644 index 0000000000..d55af430c7 --- /dev/null +++ b/test/fixtures/esprima/automatic-semicolon-insertion/migrated_0013/expected.json @@ -0,0 +1,112 @@ +{ + "type": "File", + "start": 0, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 8 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 8 + } + }, + "sourceType": "script", + "body": [ + { + "type": "BlockStatement", + "start": 0, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 8 + } + }, + "body": [ + { + "type": "ThrowStatement", + "start": 2, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 2 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "argument": { + "type": "Identifier", + "start": 8, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "name": "error" + } + }, + { + "type": "ExpressionStatement", + "start": 14, + "end": 20, + "loc": { + "start": { + "line": 2, + "column": 0 + }, + "end": { + "line": 2, + "column": 6 + } + }, + "expression": { + "type": "Identifier", + "start": 14, + "end": 19, + "loc": { + "start": { + "line": 2, + "column": 0 + }, + "end": { + "line": 2, + "column": 5 + } + }, + "name": "error" + } + } + ] + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/automatic-semicolon-insertion/migrated_0014/actual.js b/test/fixtures/esprima/automatic-semicolon-insertion/migrated_0014/actual.js new file mode 100644 index 0000000000..d400cf220c --- /dev/null +++ b/test/fixtures/esprima/automatic-semicolon-insertion/migrated_0014/actual.js @@ -0,0 +1,2 @@ +{ throw error// Comment +error; } diff --git a/test/fixtures/esprima/automatic-semicolon-insertion/migrated_0014/expected.json b/test/fixtures/esprima/automatic-semicolon-insertion/migrated_0014/expected.json new file mode 100644 index 0000000000..59760cfccf --- /dev/null +++ b/test/fixtures/esprima/automatic-semicolon-insertion/migrated_0014/expected.json @@ -0,0 +1,181 @@ +{ + "type": "File", + "start": 0, + "end": 32, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 8 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 32, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 8 + } + }, + "sourceType": "script", + "body": [ + { + "type": "BlockStatement", + "start": 0, + "end": 32, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 8 + } + }, + "body": [ + { + "type": "ThrowStatement", + "start": 2, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 2 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "argument": { + "type": "Identifier", + "start": 8, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "name": "error", + "leadingComments": null, + "trailingComments": null + }, + "trailingComments": [ + { + "type": "CommentLine", + "value": " Comment", + "start": 13, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "range": [ + 13, + 23 + ] + } + ] + }, + { + "type": "ExpressionStatement", + "start": 24, + "end": 30, + "loc": { + "start": { + "line": 2, + "column": 0 + }, + "end": { + "line": 2, + "column": 6 + } + }, + "expression": { + "type": "Identifier", + "start": 24, + "end": 29, + "loc": { + "start": { + "line": 2, + "column": 0 + }, + "end": { + "line": 2, + "column": 5 + } + }, + "name": "error", + "leadingComments": null + }, + "leadingComments": [ + { + "type": "CommentLine", + "value": " Comment", + "start": 13, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "range": [ + 13, + 23 + ] + } + ] + } + ] + } + ] + }, + "comments": [ + { + "type": "CommentLine", + "value": " Comment", + "start": 13, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "range": [ + 13, + 23 + ] + } + ] +} \ No newline at end of file diff --git a/test/fixtures/esprima/automatic-semicolon-insertion/migrated_0015/actual.js b/test/fixtures/esprima/automatic-semicolon-insertion/migrated_0015/actual.js new file mode 100644 index 0000000000..88ec9f1ed8 --- /dev/null +++ b/test/fixtures/esprima/automatic-semicolon-insertion/migrated_0015/actual.js @@ -0,0 +1,2 @@ +{ throw error/* Multiline +Comment */error; } diff --git a/test/fixtures/esprima/automatic-semicolon-insertion/migrated_0015/expected.json b/test/fixtures/esprima/automatic-semicolon-insertion/migrated_0015/expected.json new file mode 100644 index 0000000000..316c90a92c --- /dev/null +++ b/test/fixtures/esprima/automatic-semicolon-insertion/migrated_0015/expected.json @@ -0,0 +1,181 @@ +{ + "type": "File", + "start": 0, + "end": 44, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 18 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 44, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 18 + } + }, + "sourceType": "script", + "body": [ + { + "type": "BlockStatement", + "start": 0, + "end": 44, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 18 + } + }, + "body": [ + { + "type": "ThrowStatement", + "start": 2, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 2 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "argument": { + "type": "Identifier", + "start": 8, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "name": "error", + "leadingComments": null, + "trailingComments": null + }, + "trailingComments": [ + { + "type": "CommentBlock", + "value": " Multiline\nComment ", + "start": 13, + "end": 36, + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 2, + "column": 10 + } + }, + "range": [ + 13, + 36 + ] + } + ] + }, + { + "type": "ExpressionStatement", + "start": 36, + "end": 42, + "loc": { + "start": { + "line": 2, + "column": 10 + }, + "end": { + "line": 2, + "column": 16 + } + }, + "expression": { + "type": "Identifier", + "start": 36, + "end": 41, + "loc": { + "start": { + "line": 2, + "column": 10 + }, + "end": { + "line": 2, + "column": 15 + } + }, + "name": "error", + "leadingComments": null + }, + "leadingComments": [ + { + "type": "CommentBlock", + "value": " Multiline\nComment ", + "start": 13, + "end": 36, + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 2, + "column": 10 + } + }, + "range": [ + 13, + 36 + ] + } + ] + } + ] + } + ] + }, + "comments": [ + { + "type": "CommentBlock", + "value": " Multiline\nComment ", + "start": 13, + "end": 36, + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 2, + "column": 10 + } + }, + "range": [ + 13, + 36 + ] + } + ] +} \ No newline at end of file diff --git a/test/fixtures/esprima/declaration-const/migrated_0000/actual.js b/test/fixtures/esprima/declaration-const/migrated_0000/actual.js new file mode 100644 index 0000000000..bf90b1a026 --- /dev/null +++ b/test/fixtures/esprima/declaration-const/migrated_0000/actual.js @@ -0,0 +1 @@ +const x = 42 diff --git a/test/fixtures/esprima/declaration-const/migrated_0000/expected.json b/test/fixtures/esprima/declaration-const/migrated_0000/expected.json new file mode 100644 index 0000000000..7a3105b73c --- /dev/null +++ b/test/fixtures/esprima/declaration-const/migrated_0000/expected.json @@ -0,0 +1,100 @@ +{ + "type": "File", + "start": 0, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "sourceType": "script", + "body": [ + { + "type": "VariableDeclaration", + "start": 0, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 6, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "id": { + "type": "Identifier", + "start": 6, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "name": "x" + }, + "init": { + "type": "Literal", + "start": 10, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "value": 42, + "rawValue": 42, + "raw": "42" + } + } + ], + "kind": "const" + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/declaration-const/migrated_0001/actual.js b/test/fixtures/esprima/declaration-const/migrated_0001/actual.js new file mode 100644 index 0000000000..88d50d85b5 --- /dev/null +++ b/test/fixtures/esprima/declaration-const/migrated_0001/actual.js @@ -0,0 +1 @@ +{ const x = 42 } diff --git a/test/fixtures/esprima/declaration-const/migrated_0001/expected.json b/test/fixtures/esprima/declaration-const/migrated_0001/expected.json new file mode 100644 index 0000000000..80198c2546 --- /dev/null +++ b/test/fixtures/esprima/declaration-const/migrated_0001/expected.json @@ -0,0 +1,117 @@ +{ + "type": "File", + "start": 0, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "sourceType": "script", + "body": [ + { + "type": "BlockStatement", + "start": 0, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "body": [ + { + "type": "VariableDeclaration", + "start": 2, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 2 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 8, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "id": { + "type": "Identifier", + "start": 8, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "name": "x" + }, + "init": { + "type": "Literal", + "start": 12, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 12 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "value": 42, + "rawValue": 42, + "raw": "42" + } + } + ], + "kind": "const" + } + ] + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/declaration-const/migrated_0002/actual.js b/test/fixtures/esprima/declaration-const/migrated_0002/actual.js new file mode 100644 index 0000000000..dc4cc9cfd3 --- /dev/null +++ b/test/fixtures/esprima/declaration-const/migrated_0002/actual.js @@ -0,0 +1 @@ +{ const x = 14, y = 3, z = 1977 } diff --git a/test/fixtures/esprima/declaration-const/migrated_0002/expected.json b/test/fixtures/esprima/declaration-const/migrated_0002/expected.json new file mode 100644 index 0000000000..79a7b04629 --- /dev/null +++ b/test/fixtures/esprima/declaration-const/migrated_0002/expected.json @@ -0,0 +1,215 @@ +{ + "type": "File", + "start": 0, + "end": 33, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 33 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 33, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 33 + } + }, + "sourceType": "script", + "body": [ + { + "type": "BlockStatement", + "start": 0, + "end": 33, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 33 + } + }, + "body": [ + { + "type": "VariableDeclaration", + "start": 2, + "end": 31, + "loc": { + "start": { + "line": 1, + "column": 2 + }, + "end": { + "line": 1, + "column": 31 + } + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 8, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "id": { + "type": "Identifier", + "start": 8, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "name": "x" + }, + "init": { + "type": "Literal", + "start": 12, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 12 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "value": 14, + "rawValue": 14, + "raw": "14" + } + }, + { + "type": "VariableDeclarator", + "start": 16, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 16 + }, + "end": { + "line": 1, + "column": 21 + } + }, + "id": { + "type": "Identifier", + "start": 16, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 16 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "name": "y" + }, + "init": { + "type": "Literal", + "start": 20, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 20 + }, + "end": { + "line": 1, + "column": 21 + } + }, + "value": 3, + "rawValue": 3, + "raw": "3" + } + }, + { + "type": "VariableDeclarator", + "start": 23, + "end": 31, + "loc": { + "start": { + "line": 1, + "column": 23 + }, + "end": { + "line": 1, + "column": 31 + } + }, + "id": { + "type": "Identifier", + "start": 23, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 23 + }, + "end": { + "line": 1, + "column": 24 + } + }, + "name": "z" + }, + "init": { + "type": "Literal", + "start": 27, + "end": 31, + "loc": { + "start": { + "line": 1, + "column": 27 + }, + "end": { + "line": 1, + "column": 31 + } + }, + "value": 1977, + "rawValue": 1977, + "raw": "1977" + } + } + ], + "kind": "const" + } + ] + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/declaration-function/dupe-param/actual.js b/test/fixtures/esprima/declaration-function/dupe-param/actual.js new file mode 100644 index 0000000000..3b836d372c --- /dev/null +++ b/test/fixtures/esprima/declaration-function/dupe-param/actual.js @@ -0,0 +1 @@ +function a(x, x) {'use strict';} diff --git a/test/fixtures/esprima/declaration-function/empty-param/actual.js b/test/fixtures/esprima/declaration-function/empty-param/actual.js new file mode 100644 index 0000000000..860cafa480 --- /dev/null +++ b/test/fixtures/esprima/declaration-function/empty-param/actual.js @@ -0,0 +1 @@ +function a([], []) {'use strict';} diff --git a/test/fixtures/esprima/declaration-function/empty-param/expected.json b/test/fixtures/esprima/declaration-function/empty-param/expected.json new file mode 100644 index 0000000000..546a1c4026 --- /dev/null +++ b/test/fixtures/esprima/declaration-function/empty-param/expected.json @@ -0,0 +1,150 @@ +{ + "type": "File", + "start": 0, + "end": 34, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 34 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 34, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 34 + } + }, + "sourceType": "script", + "body": [ + { + "type": "FunctionDeclaration", + "start": 0, + "end": 34, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 34 + } + }, + "id": { + "type": "Identifier", + "start": 9, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "name": "a" + }, + "generator": false, + "expression": false, + "params": [ + { + "type": "ArrayPattern", + "start": 11, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 11 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "elements": [] + }, + { + "type": "ArrayPattern", + "start": 15, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "elements": [] + } + ], + "body": { + "type": "BlockStatement", + "start": 19, + "end": 34, + "loc": { + "start": { + "line": 1, + "column": 19 + }, + "end": { + "line": 1, + "column": 34 + } + }, + "body": [ + { + "type": "ExpressionStatement", + "start": 20, + "end": 33, + "loc": { + "start": { + "line": 1, + "column": 20 + }, + "end": { + "line": 1, + "column": 33 + } + }, + "expression": { + "type": "Literal", + "start": 20, + "end": 32, + "loc": { + "start": { + "line": 1, + "column": 20 + }, + "end": { + "line": 1, + "column": 32 + } + }, + "value": "use strict", + "rawValue": "use strict", + "raw": "'use strict'" + } + } + ] + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/declaration-function/migrated_0000/actual.js b/test/fixtures/esprima/declaration-function/migrated_0000/actual.js new file mode 100644 index 0000000000..58671af140 --- /dev/null +++ b/test/fixtures/esprima/declaration-function/migrated_0000/actual.js @@ -0,0 +1 @@ +function hello() { sayHi(); } diff --git a/test/fixtures/esprima/declaration-function/migrated_0000/expected.json b/test/fixtures/esprima/declaration-function/migrated_0000/expected.json new file mode 100644 index 0000000000..8de460e887 --- /dev/null +++ b/test/fixtures/esprima/declaration-function/migrated_0000/expected.json @@ -0,0 +1,131 @@ +{ + "type": "File", + "start": 0, + "end": 29, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 29 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 29, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 29 + } + }, + "sourceType": "script", + "body": [ + { + "type": "FunctionDeclaration", + "start": 0, + "end": 29, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 29 + } + }, + "id": { + "type": "Identifier", + "start": 9, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "name": "hello" + }, + "generator": false, + "expression": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 17, + "end": 29, + "loc": { + "start": { + "line": 1, + "column": 17 + }, + "end": { + "line": 1, + "column": 29 + } + }, + "body": [ + { + "type": "ExpressionStatement", + "start": 19, + "end": 27, + "loc": { + "start": { + "line": 1, + "column": 19 + }, + "end": { + "line": 1, + "column": 27 + } + }, + "expression": { + "type": "CallExpression", + "start": 19, + "end": 26, + "loc": { + "start": { + "line": 1, + "column": 19 + }, + "end": { + "line": 1, + "column": 26 + } + }, + "callee": { + "type": "Identifier", + "start": 19, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 19 + }, + "end": { + "line": 1, + "column": 24 + } + }, + "name": "sayHi" + }, + "arguments": [] + } + } + ] + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/declaration-function/migrated_0001/actual.js b/test/fixtures/esprima/declaration-function/migrated_0001/actual.js new file mode 100644 index 0000000000..bcb22bdb50 --- /dev/null +++ b/test/fixtures/esprima/declaration-function/migrated_0001/actual.js @@ -0,0 +1 @@ +function eval() { } diff --git a/test/fixtures/esprima/declaration-function/migrated_0001/expected.json b/test/fixtures/esprima/declaration-function/migrated_0001/expected.json new file mode 100644 index 0000000000..d8bcde0844 --- /dev/null +++ b/test/fixtures/esprima/declaration-function/migrated_0001/expected.json @@ -0,0 +1,83 @@ +{ + "type": "File", + "start": 0, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 19 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 19 + } + }, + "sourceType": "script", + "body": [ + { + "type": "FunctionDeclaration", + "start": 0, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 19 + } + }, + "id": { + "type": "Identifier", + "start": 9, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "name": "eval" + }, + "generator": false, + "expression": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 16, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 16 + }, + "end": { + "line": 1, + "column": 19 + } + }, + "body": [] + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/declaration-function/migrated_0002/actual.js b/test/fixtures/esprima/declaration-function/migrated_0002/actual.js new file mode 100644 index 0000000000..fc4384962c --- /dev/null +++ b/test/fixtures/esprima/declaration-function/migrated_0002/actual.js @@ -0,0 +1 @@ +function arguments() { } diff --git a/test/fixtures/esprima/declaration-function/migrated_0002/expected.json b/test/fixtures/esprima/declaration-function/migrated_0002/expected.json new file mode 100644 index 0000000000..086e1ef65b --- /dev/null +++ b/test/fixtures/esprima/declaration-function/migrated_0002/expected.json @@ -0,0 +1,83 @@ +{ + "type": "File", + "start": 0, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 24 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 24 + } + }, + "sourceType": "script", + "body": [ + { + "type": "FunctionDeclaration", + "start": 0, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 24 + } + }, + "id": { + "type": "Identifier", + "start": 9, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "name": "arguments" + }, + "generator": false, + "expression": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 21, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 21 + }, + "end": { + "line": 1, + "column": 24 + } + }, + "body": [] + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/declaration-function/migrated_0003/actual.js b/test/fixtures/esprima/declaration-function/migrated_0003/actual.js new file mode 100644 index 0000000000..95368d4da2 --- /dev/null +++ b/test/fixtures/esprima/declaration-function/migrated_0003/actual.js @@ -0,0 +1 @@ +function test(t, t) { } diff --git a/test/fixtures/esprima/declaration-function/migrated_0003/expected.json b/test/fixtures/esprima/declaration-function/migrated_0003/expected.json new file mode 100644 index 0000000000..c081c978ea --- /dev/null +++ b/test/fixtures/esprima/declaration-function/migrated_0003/expected.json @@ -0,0 +1,116 @@ +{ + "type": "File", + "start": 0, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "sourceType": "script", + "body": [ + { + "type": "FunctionDeclaration", + "start": 0, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "id": { + "type": "Identifier", + "start": 9, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "name": "test" + }, + "generator": false, + "expression": false, + "params": [ + { + "type": "Identifier", + "start": 14, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 14 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "name": "t" + }, + { + "type": "Identifier", + "start": 17, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 17 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "name": "t" + } + ], + "body": { + "type": "BlockStatement", + "start": 20, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 20 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "body": [] + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/declaration-function/migrated_0004/actual.js b/test/fixtures/esprima/declaration-function/migrated_0004/actual.js new file mode 100644 index 0000000000..bc5fe5b5e8 --- /dev/null +++ b/test/fixtures/esprima/declaration-function/migrated_0004/actual.js @@ -0,0 +1 @@ +(function test(t, t) { }) diff --git a/test/fixtures/esprima/declaration-function/migrated_0004/expected.json b/test/fixtures/esprima/declaration-function/migrated_0004/expected.json new file mode 100644 index 0000000000..246b6b5a20 --- /dev/null +++ b/test/fixtures/esprima/declaration-function/migrated_0004/expected.json @@ -0,0 +1,132 @@ +{ + "type": "File", + "start": 0, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 25 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 25 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 25 + } + }, + "expression": { + "type": "FunctionExpression", + "start": 1, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 24 + } + }, + "id": { + "type": "Identifier", + "start": 10, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "name": "test" + }, + "generator": false, + "expression": false, + "params": [ + { + "type": "Identifier", + "start": 15, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "name": "t" + }, + { + "type": "Identifier", + "start": 18, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 18 + }, + "end": { + "line": 1, + "column": 19 + } + }, + "name": "t" + } + ], + "body": { + "type": "BlockStatement", + "start": 21, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 21 + }, + "end": { + "line": 1, + "column": 24 + } + }, + "body": [] + }, + "parenthesizedExpression": true + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/declaration-function/migrated_0005/actual.js b/test/fixtures/esprima/declaration-function/migrated_0005/actual.js new file mode 100644 index 0000000000..54349ae31c --- /dev/null +++ b/test/fixtures/esprima/declaration-function/migrated_0005/actual.js @@ -0,0 +1 @@ +function eval() { function inner() { "use strict" } } diff --git a/test/fixtures/esprima/declaration-function/migrated_0005/expected.json b/test/fixtures/esprima/declaration-function/migrated_0005/expected.json new file mode 100644 index 0000000000..c1db4cf35a --- /dev/null +++ b/test/fixtures/esprima/declaration-function/migrated_0005/expected.json @@ -0,0 +1,168 @@ +{ + "type": "File", + "start": 0, + "end": 53, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 53 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 53, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 53 + } + }, + "sourceType": "script", + "body": [ + { + "type": "FunctionDeclaration", + "start": 0, + "end": 53, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 53 + } + }, + "id": { + "type": "Identifier", + "start": 9, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "name": "eval" + }, + "generator": false, + "expression": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 16, + "end": 53, + "loc": { + "start": { + "line": 1, + "column": 16 + }, + "end": { + "line": 1, + "column": 53 + } + }, + "body": [ + { + "type": "FunctionDeclaration", + "start": 18, + "end": 51, + "loc": { + "start": { + "line": 1, + "column": 18 + }, + "end": { + "line": 1, + "column": 51 + } + }, + "id": { + "type": "Identifier", + "start": 27, + "end": 32, + "loc": { + "start": { + "line": 1, + "column": 27 + }, + "end": { + "line": 1, + "column": 32 + } + }, + "name": "inner" + }, + "generator": false, + "expression": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 35, + "end": 51, + "loc": { + "start": { + "line": 1, + "column": 35 + }, + "end": { + "line": 1, + "column": 51 + } + }, + "body": [ + { + "type": "ExpressionStatement", + "start": 37, + "end": 49, + "loc": { + "start": { + "line": 1, + "column": 37 + }, + "end": { + "line": 1, + "column": 49 + } + }, + "expression": { + "type": "Literal", + "start": 37, + "end": 49, + "loc": { + "start": { + "line": 1, + "column": 37 + }, + "end": { + "line": 1, + "column": 49 + } + }, + "value": "use strict", + "rawValue": "use strict", + "raw": "\"use strict\"" + } + } + ] + } + } + ] + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/declaration-function/migrated_0006/actual.js b/test/fixtures/esprima/declaration-function/migrated_0006/actual.js new file mode 100644 index 0000000000..0b2880aaa9 --- /dev/null +++ b/test/fixtures/esprima/declaration-function/migrated_0006/actual.js @@ -0,0 +1 @@ +function hello(a) { sayHi(); } diff --git a/test/fixtures/esprima/declaration-function/migrated_0006/expected.json b/test/fixtures/esprima/declaration-function/migrated_0006/expected.json new file mode 100644 index 0000000000..3d1b214f48 --- /dev/null +++ b/test/fixtures/esprima/declaration-function/migrated_0006/expected.json @@ -0,0 +1,148 @@ +{ + "type": "File", + "start": 0, + "end": 30, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 30 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 30, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 30 + } + }, + "sourceType": "script", + "body": [ + { + "type": "FunctionDeclaration", + "start": 0, + "end": 30, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 30 + } + }, + "id": { + "type": "Identifier", + "start": 9, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "name": "hello" + }, + "generator": false, + "expression": false, + "params": [ + { + "type": "Identifier", + "start": 15, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "name": "a" + } + ], + "body": { + "type": "BlockStatement", + "start": 18, + "end": 30, + "loc": { + "start": { + "line": 1, + "column": 18 + }, + "end": { + "line": 1, + "column": 30 + } + }, + "body": [ + { + "type": "ExpressionStatement", + "start": 20, + "end": 28, + "loc": { + "start": { + "line": 1, + "column": 20 + }, + "end": { + "line": 1, + "column": 28 + } + }, + "expression": { + "type": "CallExpression", + "start": 20, + "end": 27, + "loc": { + "start": { + "line": 1, + "column": 20 + }, + "end": { + "line": 1, + "column": 27 + } + }, + "callee": { + "type": "Identifier", + "start": 20, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 20 + }, + "end": { + "line": 1, + "column": 25 + } + }, + "name": "sayHi" + }, + "arguments": [] + } + } + ] + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/declaration-function/migrated_0007/actual.js b/test/fixtures/esprima/declaration-function/migrated_0007/actual.js new file mode 100644 index 0000000000..8d67f5afb4 --- /dev/null +++ b/test/fixtures/esprima/declaration-function/migrated_0007/actual.js @@ -0,0 +1 @@ +function hello(a, b) { sayHi(); } diff --git a/test/fixtures/esprima/declaration-function/migrated_0007/expected.json b/test/fixtures/esprima/declaration-function/migrated_0007/expected.json new file mode 100644 index 0000000000..8bc6714852 --- /dev/null +++ b/test/fixtures/esprima/declaration-function/migrated_0007/expected.json @@ -0,0 +1,164 @@ +{ + "type": "File", + "start": 0, + "end": 33, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 33 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 33, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 33 + } + }, + "sourceType": "script", + "body": [ + { + "type": "FunctionDeclaration", + "start": 0, + "end": 33, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 33 + } + }, + "id": { + "type": "Identifier", + "start": 9, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "name": "hello" + }, + "generator": false, + "expression": false, + "params": [ + { + "type": "Identifier", + "start": 15, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "name": "a" + }, + { + "type": "Identifier", + "start": 18, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 18 + }, + "end": { + "line": 1, + "column": 19 + } + }, + "name": "b" + } + ], + "body": { + "type": "BlockStatement", + "start": 21, + "end": 33, + "loc": { + "start": { + "line": 1, + "column": 21 + }, + "end": { + "line": 1, + "column": 33 + } + }, + "body": [ + { + "type": "ExpressionStatement", + "start": 23, + "end": 31, + "loc": { + "start": { + "line": 1, + "column": 23 + }, + "end": { + "line": 1, + "column": 31 + } + }, + "expression": { + "type": "CallExpression", + "start": 23, + "end": 30, + "loc": { + "start": { + "line": 1, + "column": 23 + }, + "end": { + "line": 1, + "column": 30 + } + }, + "callee": { + "type": "Identifier", + "start": 23, + "end": 28, + "loc": { + "start": { + "line": 1, + "column": 23 + }, + "end": { + "line": 1, + "column": 28 + } + }, + "name": "sayHi" + }, + "arguments": [] + } + } + ] + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/declaration-function/migrated_0008/actual.js b/test/fixtures/esprima/declaration-function/migrated_0008/actual.js new file mode 100644 index 0000000000..67366da16c --- /dev/null +++ b/test/fixtures/esprima/declaration-function/migrated_0008/actual.js @@ -0,0 +1 @@ +var hi = function() { sayHi() }; diff --git a/test/fixtures/esprima/declaration-function/migrated_0008/expected.json b/test/fixtures/esprima/declaration-function/migrated_0008/expected.json new file mode 100644 index 0000000000..6483debdcd --- /dev/null +++ b/test/fixtures/esprima/declaration-function/migrated_0008/expected.json @@ -0,0 +1,165 @@ +{ + "type": "File", + "start": 0, + "end": 32, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 32 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 32, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 32 + } + }, + "sourceType": "script", + "body": [ + { + "type": "VariableDeclaration", + "start": 0, + "end": 32, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 32 + } + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 4, + "end": 31, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 31 + } + }, + "id": { + "type": "Identifier", + "start": 4, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "name": "hi" + }, + "init": { + "type": "FunctionExpression", + "start": 9, + "end": 31, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 31 + } + }, + "id": null, + "generator": false, + "expression": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 20, + "end": 31, + "loc": { + "start": { + "line": 1, + "column": 20 + }, + "end": { + "line": 1, + "column": 31 + } + }, + "body": [ + { + "type": "ExpressionStatement", + "start": 22, + "end": 29, + "loc": { + "start": { + "line": 1, + "column": 22 + }, + "end": { + "line": 1, + "column": 29 + } + }, + "expression": { + "type": "CallExpression", + "start": 22, + "end": 29, + "loc": { + "start": { + "line": 1, + "column": 22 + }, + "end": { + "line": 1, + "column": 29 + } + }, + "callee": { + "type": "Identifier", + "start": 22, + "end": 27, + "loc": { + "start": { + "line": 1, + "column": 22 + }, + "end": { + "line": 1, + "column": 27 + } + }, + "name": "sayHi" + }, + "arguments": [] + } + } + ] + } + } + } + ], + "kind": "var" + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/declaration-function/migrated_0009/actual.js b/test/fixtures/esprima/declaration-function/migrated_0009/actual.js new file mode 100644 index 0000000000..5a2a82fb35 --- /dev/null +++ b/test/fixtures/esprima/declaration-function/migrated_0009/actual.js @@ -0,0 +1 @@ +var hi = function eval() { }; diff --git a/test/fixtures/esprima/declaration-function/migrated_0009/expected.json b/test/fixtures/esprima/declaration-function/migrated_0009/expected.json new file mode 100644 index 0000000000..b4b770ef03 --- /dev/null +++ b/test/fixtures/esprima/declaration-function/migrated_0009/expected.json @@ -0,0 +1,132 @@ +{ + "type": "File", + "start": 0, + "end": 29, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 29 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 29, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 29 + } + }, + "sourceType": "script", + "body": [ + { + "type": "VariableDeclaration", + "start": 0, + "end": 29, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 29 + } + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 4, + "end": 28, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 28 + } + }, + "id": { + "type": "Identifier", + "start": 4, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "name": "hi" + }, + "init": { + "type": "FunctionExpression", + "start": 9, + "end": 28, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 28 + } + }, + "id": { + "type": "Identifier", + "start": 18, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 18 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "name": "eval" + }, + "generator": false, + "expression": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 25, + "end": 28, + "loc": { + "start": { + "line": 1, + "column": 25 + }, + "end": { + "line": 1, + "column": 28 + } + }, + "body": [] + } + } + } + ], + "kind": "var" + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/declaration-function/migrated_0010/actual.js b/test/fixtures/esprima/declaration-function/migrated_0010/actual.js new file mode 100644 index 0000000000..4d0ce45e67 --- /dev/null +++ b/test/fixtures/esprima/declaration-function/migrated_0010/actual.js @@ -0,0 +1 @@ +var hi = function arguments() { }; diff --git a/test/fixtures/esprima/declaration-function/migrated_0010/expected.json b/test/fixtures/esprima/declaration-function/migrated_0010/expected.json new file mode 100644 index 0000000000..75abd7b81c --- /dev/null +++ b/test/fixtures/esprima/declaration-function/migrated_0010/expected.json @@ -0,0 +1,132 @@ +{ + "type": "File", + "start": 0, + "end": 34, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 34 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 34, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 34 + } + }, + "sourceType": "script", + "body": [ + { + "type": "VariableDeclaration", + "start": 0, + "end": 34, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 34 + } + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 4, + "end": 33, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 33 + } + }, + "id": { + "type": "Identifier", + "start": 4, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "name": "hi" + }, + "init": { + "type": "FunctionExpression", + "start": 9, + "end": 33, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 33 + } + }, + "id": { + "type": "Identifier", + "start": 18, + "end": 27, + "loc": { + "start": { + "line": 1, + "column": 18 + }, + "end": { + "line": 1, + "column": 27 + } + }, + "name": "arguments" + }, + "generator": false, + "expression": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 30, + "end": 33, + "loc": { + "start": { + "line": 1, + "column": 30 + }, + "end": { + "line": 1, + "column": 33 + } + }, + "body": [] + } + } + } + ], + "kind": "var" + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/declaration-function/migrated_0011/actual.js b/test/fixtures/esprima/declaration-function/migrated_0011/actual.js new file mode 100644 index 0000000000..17c1c9bbe9 --- /dev/null +++ b/test/fixtures/esprima/declaration-function/migrated_0011/actual.js @@ -0,0 +1 @@ +var hello = function hi() { sayHi() }; diff --git a/test/fixtures/esprima/declaration-function/migrated_0011/expected.json b/test/fixtures/esprima/declaration-function/migrated_0011/expected.json new file mode 100644 index 0000000000..71c7365c51 --- /dev/null +++ b/test/fixtures/esprima/declaration-function/migrated_0011/expected.json @@ -0,0 +1,180 @@ +{ + "type": "File", + "start": 0, + "end": 38, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 38 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 38, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 38 + } + }, + "sourceType": "script", + "body": [ + { + "type": "VariableDeclaration", + "start": 0, + "end": 38, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 38 + } + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 4, + "end": 37, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 37 + } + }, + "id": { + "type": "Identifier", + "start": 4, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "name": "hello" + }, + "init": { + "type": "FunctionExpression", + "start": 12, + "end": 37, + "loc": { + "start": { + "line": 1, + "column": 12 + }, + "end": { + "line": 1, + "column": 37 + } + }, + "id": { + "type": "Identifier", + "start": 21, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 21 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "name": "hi" + }, + "generator": false, + "expression": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 26, + "end": 37, + "loc": { + "start": { + "line": 1, + "column": 26 + }, + "end": { + "line": 1, + "column": 37 + } + }, + "body": [ + { + "type": "ExpressionStatement", + "start": 28, + "end": 35, + "loc": { + "start": { + "line": 1, + "column": 28 + }, + "end": { + "line": 1, + "column": 35 + } + }, + "expression": { + "type": "CallExpression", + "start": 28, + "end": 35, + "loc": { + "start": { + "line": 1, + "column": 28 + }, + "end": { + "line": 1, + "column": 35 + } + }, + "callee": { + "type": "Identifier", + "start": 28, + "end": 33, + "loc": { + "start": { + "line": 1, + "column": 28 + }, + "end": { + "line": 1, + "column": 33 + } + }, + "name": "sayHi" + }, + "arguments": [] + } + } + ] + } + } + } + ], + "kind": "var" + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/declaration-function/migrated_0012/actual.js b/test/fixtures/esprima/declaration-function/migrated_0012/actual.js new file mode 100644 index 0000000000..0c3a328272 --- /dev/null +++ b/test/fixtures/esprima/declaration-function/migrated_0012/actual.js @@ -0,0 +1 @@ +(function(){}) diff --git a/test/fixtures/esprima/declaration-function/migrated_0012/expected.json b/test/fixtures/esprima/declaration-function/migrated_0012/expected.json new file mode 100644 index 0000000000..4841a07e51 --- /dev/null +++ b/test/fixtures/esprima/declaration-function/migrated_0012/expected.json @@ -0,0 +1,84 @@ +{ + "type": "File", + "start": 0, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "expression": { + "type": "FunctionExpression", + "start": 1, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "id": null, + "generator": false, + "expression": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 11, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 11 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "body": [] + }, + "parenthesizedExpression": true + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/declaration-function/migrated_0013/actual.js b/test/fixtures/esprima/declaration-function/migrated_0013/actual.js new file mode 100644 index 0000000000..3219ae202f --- /dev/null +++ b/test/fixtures/esprima/declaration-function/migrated_0013/actual.js @@ -0,0 +1 @@ +function universe(__proto__) { } diff --git a/test/fixtures/esprima/declaration-function/migrated_0013/expected.json b/test/fixtures/esprima/declaration-function/migrated_0013/expected.json new file mode 100644 index 0000000000..e9af076d07 --- /dev/null +++ b/test/fixtures/esprima/declaration-function/migrated_0013/expected.json @@ -0,0 +1,100 @@ +{ + "type": "File", + "start": 0, + "end": 32, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 32 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 32, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 32 + } + }, + "sourceType": "script", + "body": [ + { + "type": "FunctionDeclaration", + "start": 0, + "end": 32, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 32 + } + }, + "id": { + "type": "Identifier", + "start": 9, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "name": "universe" + }, + "generator": false, + "expression": false, + "params": [ + { + "type": "Identifier", + "start": 18, + "end": 27, + "loc": { + "start": { + "line": 1, + "column": 18 + }, + "end": { + "line": 1, + "column": 27 + } + }, + "name": "__proto__" + } + ], + "body": { + "type": "BlockStatement", + "start": 29, + "end": 32, + "loc": { + "start": { + "line": 1, + "column": 29 + }, + "end": { + "line": 1, + "column": 32 + } + }, + "body": [] + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/declaration-function/migrated_0014/actual.js b/test/fixtures/esprima/declaration-function/migrated_0014/actual.js new file mode 100644 index 0000000000..7e29601a2c --- /dev/null +++ b/test/fixtures/esprima/declaration-function/migrated_0014/actual.js @@ -0,0 +1 @@ +function test() { "use strict" + 42; } diff --git a/test/fixtures/esprima/declaration-function/migrated_0014/expected.json b/test/fixtures/esprima/declaration-function/migrated_0014/expected.json new file mode 100644 index 0000000000..72f253f625 --- /dev/null +++ b/test/fixtures/esprima/declaration-function/migrated_0014/expected.json @@ -0,0 +1,151 @@ +{ + "type": "File", + "start": 0, + "end": 38, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 38 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 38, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 38 + } + }, + "sourceType": "script", + "body": [ + { + "type": "FunctionDeclaration", + "start": 0, + "end": 38, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 38 + } + }, + "id": { + "type": "Identifier", + "start": 9, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "name": "test" + }, + "generator": false, + "expression": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 16, + "end": 38, + "loc": { + "start": { + "line": 1, + "column": 16 + }, + "end": { + "line": 1, + "column": 38 + } + }, + "body": [ + { + "type": "ExpressionStatement", + "start": 18, + "end": 36, + "loc": { + "start": { + "line": 1, + "column": 18 + }, + "end": { + "line": 1, + "column": 36 + } + }, + "expression": { + "type": "BinaryExpression", + "start": 18, + "end": 35, + "loc": { + "start": { + "line": 1, + "column": 18 + }, + "end": { + "line": 1, + "column": 35 + } + }, + "left": { + "type": "Literal", + "start": 18, + "end": 30, + "loc": { + "start": { + "line": 1, + "column": 18 + }, + "end": { + "line": 1, + "column": 30 + } + }, + "value": "use strict", + "rawValue": "use strict", + "raw": "\"use strict\"" + }, + "operator": "+", + "right": { + "type": "Literal", + "start": 33, + "end": 35, + "loc": { + "start": { + "line": 1, + "column": 33 + }, + "end": { + "line": 1, + "column": 35 + } + }, + "value": 42, + "rawValue": 42, + "raw": "42" + } + } + } + ] + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/declaration-let/migrated_0000/actual.js b/test/fixtures/esprima/declaration-let/migrated_0000/actual.js new file mode 100644 index 0000000000..d29e51d21f --- /dev/null +++ b/test/fixtures/esprima/declaration-let/migrated_0000/actual.js @@ -0,0 +1 @@ +let x diff --git a/test/fixtures/esprima/declaration-let/migrated_0000/expected.json b/test/fixtures/esprima/declaration-let/migrated_0000/expected.json new file mode 100644 index 0000000000..9e7caa0016 --- /dev/null +++ b/test/fixtures/esprima/declaration-let/migrated_0000/expected.json @@ -0,0 +1,83 @@ +{ + "type": "File", + "start": 0, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "sourceType": "script", + "body": [ + { + "type": "VariableDeclaration", + "start": 0, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 4, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "id": { + "type": "Identifier", + "start": 4, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "name": "x" + }, + "init": null + } + ], + "kind": "let" + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/declaration-let/migrated_0001/actual.js b/test/fixtures/esprima/declaration-let/migrated_0001/actual.js new file mode 100644 index 0000000000..eb76ecd156 --- /dev/null +++ b/test/fixtures/esprima/declaration-let/migrated_0001/actual.js @@ -0,0 +1 @@ +{ let x } diff --git a/test/fixtures/esprima/declaration-let/migrated_0001/expected.json b/test/fixtures/esprima/declaration-let/migrated_0001/expected.json new file mode 100644 index 0000000000..1e0f4d8fa5 --- /dev/null +++ b/test/fixtures/esprima/declaration-let/migrated_0001/expected.json @@ -0,0 +1,100 @@ +{ + "type": "File", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "sourceType": "script", + "body": [ + { + "type": "BlockStatement", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "body": [ + { + "type": "VariableDeclaration", + "start": 2, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 2 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 6, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "id": { + "type": "Identifier", + "start": 6, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "name": "x" + }, + "init": null + } + ], + "kind": "let" + } + ] + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/declaration-let/migrated_0002/actual.js b/test/fixtures/esprima/declaration-let/migrated_0002/actual.js new file mode 100644 index 0000000000..f74da40ece --- /dev/null +++ b/test/fixtures/esprima/declaration-let/migrated_0002/actual.js @@ -0,0 +1 @@ +{ let x = 42 } diff --git a/test/fixtures/esprima/declaration-let/migrated_0002/expected.json b/test/fixtures/esprima/declaration-let/migrated_0002/expected.json new file mode 100644 index 0000000000..421e69547d --- /dev/null +++ b/test/fixtures/esprima/declaration-let/migrated_0002/expected.json @@ -0,0 +1,117 @@ +{ + "type": "File", + "start": 0, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "sourceType": "script", + "body": [ + { + "type": "BlockStatement", + "start": 0, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "body": [ + { + "type": "VariableDeclaration", + "start": 2, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 2 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 6, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "id": { + "type": "Identifier", + "start": 6, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "name": "x" + }, + "init": { + "type": "Literal", + "start": 10, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "value": 42, + "rawValue": 42, + "raw": "42" + } + } + ], + "kind": "let" + } + ] + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/declaration-let/migrated_0003/actual.js b/test/fixtures/esprima/declaration-let/migrated_0003/actual.js new file mode 100644 index 0000000000..d0dbf07f59 --- /dev/null +++ b/test/fixtures/esprima/declaration-let/migrated_0003/actual.js @@ -0,0 +1 @@ +{ let x = 14, y = 3, z = 1977 } diff --git a/test/fixtures/esprima/declaration-let/migrated_0003/expected.json b/test/fixtures/esprima/declaration-let/migrated_0003/expected.json new file mode 100644 index 0000000000..1614fceb4c --- /dev/null +++ b/test/fixtures/esprima/declaration-let/migrated_0003/expected.json @@ -0,0 +1,215 @@ +{ + "type": "File", + "start": 0, + "end": 31, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 31 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 31, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 31 + } + }, + "sourceType": "script", + "body": [ + { + "type": "BlockStatement", + "start": 0, + "end": 31, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 31 + } + }, + "body": [ + { + "type": "VariableDeclaration", + "start": 2, + "end": 29, + "loc": { + "start": { + "line": 1, + "column": 2 + }, + "end": { + "line": 1, + "column": 29 + } + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 6, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "id": { + "type": "Identifier", + "start": 6, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "name": "x" + }, + "init": { + "type": "Literal", + "start": 10, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "value": 14, + "rawValue": 14, + "raw": "14" + } + }, + { + "type": "VariableDeclarator", + "start": 14, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 14 + }, + "end": { + "line": 1, + "column": 19 + } + }, + "id": { + "type": "Identifier", + "start": 14, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 14 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "name": "y" + }, + "init": { + "type": "Literal", + "start": 18, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 18 + }, + "end": { + "line": 1, + "column": 19 + } + }, + "value": 3, + "rawValue": 3, + "raw": "3" + } + }, + { + "type": "VariableDeclarator", + "start": 21, + "end": 29, + "loc": { + "start": { + "line": 1, + "column": 21 + }, + "end": { + "line": 1, + "column": 29 + } + }, + "id": { + "type": "Identifier", + "start": 21, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 21 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "name": "z" + }, + "init": { + "type": "Literal", + "start": 25, + "end": 29, + "loc": { + "start": { + "line": 1, + "column": 25 + }, + "end": { + "line": 1, + "column": 29 + } + }, + "value": 1977, + "rawValue": 1977, + "raw": "1977" + } + } + ], + "kind": "let" + } + ] + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/directive-prolog/migrated_0000/actual.js b/test/fixtures/esprima/directive-prolog/migrated_0000/actual.js new file mode 100644 index 0000000000..ce29451593 --- /dev/null +++ b/test/fixtures/esprima/directive-prolog/migrated_0000/actual.js @@ -0,0 +1 @@ +(function () { 'use\x20strict'; with (i); }()) diff --git a/test/fixtures/esprima/directive-prolog/migrated_0000/expected.json b/test/fixtures/esprima/directive-prolog/migrated_0000/expected.json new file mode 100644 index 0000000000..6fc51fdb6d --- /dev/null +++ b/test/fixtures/esprima/directive-prolog/migrated_0000/expected.json @@ -0,0 +1,180 @@ +{ + "type": "File", + "start": 0, + "end": 46, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 46 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 46, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 46 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 46, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 46 + } + }, + "expression": { + "type": "CallExpression", + "start": 1, + "end": 45, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 45 + } + }, + "callee": { + "type": "FunctionExpression", + "start": 1, + "end": 43, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 43 + } + }, + "id": null, + "generator": false, + "expression": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 13, + "end": 43, + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 1, + "column": 43 + } + }, + "body": [ + { + "type": "ExpressionStatement", + "start": 15, + "end": 31, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 31 + } + }, + "expression": { + "type": "Literal", + "start": 15, + "end": 30, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 30 + } + }, + "value": "use strict", + "rawValue": "use strict", + "raw": "'use\\x20strict'" + } + }, + { + "type": "WithStatement", + "start": 32, + "end": 41, + "loc": { + "start": { + "line": 1, + "column": 32 + }, + "end": { + "line": 1, + "column": 41 + } + }, + "object": { + "type": "Identifier", + "start": 38, + "end": 39, + "loc": { + "start": { + "line": 1, + "column": 38 + }, + "end": { + "line": 1, + "column": 39 + } + }, + "name": "i" + }, + "body": { + "type": "EmptyStatement", + "start": 40, + "end": 41, + "loc": { + "start": { + "line": 1, + "column": 40 + }, + "end": { + "line": 1, + "column": 41 + } + } + } + } + ] + } + }, + "arguments": [], + "parenthesizedExpression": true + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/directive-prolog/migrated_0001/actual.js b/test/fixtures/esprima/directive-prolog/migrated_0001/actual.js new file mode 100644 index 0000000000..f5269df4aa --- /dev/null +++ b/test/fixtures/esprima/directive-prolog/migrated_0001/actual.js @@ -0,0 +1 @@ +(function () { 'use\nstrict'; with (i); }()) diff --git a/test/fixtures/esprima/directive-prolog/migrated_0001/expected.json b/test/fixtures/esprima/directive-prolog/migrated_0001/expected.json new file mode 100644 index 0000000000..97967a7597 --- /dev/null +++ b/test/fixtures/esprima/directive-prolog/migrated_0001/expected.json @@ -0,0 +1,180 @@ +{ + "type": "File", + "start": 0, + "end": 44, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 44 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 44, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 44 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 44, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 44 + } + }, + "expression": { + "type": "CallExpression", + "start": 1, + "end": 43, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 43 + } + }, + "callee": { + "type": "FunctionExpression", + "start": 1, + "end": 41, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 41 + } + }, + "id": null, + "generator": false, + "expression": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 13, + "end": 41, + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 1, + "column": 41 + } + }, + "body": [ + { + "type": "ExpressionStatement", + "start": 15, + "end": 29, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 29 + } + }, + "expression": { + "type": "Literal", + "start": 15, + "end": 28, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 28 + } + }, + "value": "use\nstrict", + "rawValue": "use\nstrict", + "raw": "'use\\nstrict'" + } + }, + { + "type": "WithStatement", + "start": 30, + "end": 39, + "loc": { + "start": { + "line": 1, + "column": 30 + }, + "end": { + "line": 1, + "column": 39 + } + }, + "object": { + "type": "Identifier", + "start": 36, + "end": 37, + "loc": { + "start": { + "line": 1, + "column": 36 + }, + "end": { + "line": 1, + "column": 37 + } + }, + "name": "i" + }, + "body": { + "type": "EmptyStatement", + "start": 38, + "end": 39, + "loc": { + "start": { + "line": 1, + "column": 38 + }, + "end": { + "line": 1, + "column": 39 + } + } + } + } + ] + } + }, + "arguments": [], + "parenthesizedExpression": true + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-array-binding-pattern/array-binding-pattern-01/actual.js b/test/fixtures/esprima/es2015-array-binding-pattern/array-binding-pattern-01/actual.js new file mode 100644 index 0000000000..17678772eb --- /dev/null +++ b/test/fixtures/esprima/es2015-array-binding-pattern/array-binding-pattern-01/actual.js @@ -0,0 +1 @@ +([a]) => [0]; diff --git a/test/fixtures/esprima/es2015-array-binding-pattern/array-binding-pattern-01/expected.json b/test/fixtures/esprima/es2015-array-binding-pattern/array-binding-pattern-01/expected.json new file mode 100644 index 0000000000..aac755fdd7 --- /dev/null +++ b/test/fixtures/esprima/es2015-array-binding-pattern/array-binding-pattern-01/expected.json @@ -0,0 +1,136 @@ +{ + "type": "File", + "start": 0, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "expression": { + "type": "ArrowFunctionExpression", + "start": 0, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "id": null, + "generator": false, + "expression": true, + "params": [ + { + "type": "ArrayPattern", + "start": 1, + "end": 4, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 4 + } + }, + "elements": [ + { + "type": "Identifier", + "start": 2, + "end": 3, + "loc": { + "start": { + "line": 1, + "column": 2 + }, + "end": { + "line": 1, + "column": 3 + } + }, + "name": "a" + } + ] + } + ], + "body": { + "type": "ArrayExpression", + "start": 9, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "elements": [ + { + "type": "Literal", + "start": 10, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "value": 0, + "rawValue": 0, + "raw": "0" + } + ] + } + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-array-binding-pattern/array-binding-pattern-02/actual.js b/test/fixtures/esprima/es2015-array-binding-pattern/array-binding-pattern-02/actual.js new file mode 100644 index 0000000000..0fe9b0cd71 --- /dev/null +++ b/test/fixtures/esprima/es2015-array-binding-pattern/array-binding-pattern-02/actual.js @@ -0,0 +1 @@ +([a,b])=>0; diff --git a/test/fixtures/esprima/es2015-array-binding-pattern/array-binding-pattern-02/expected.json b/test/fixtures/esprima/es2015-array-binding-pattern/array-binding-pattern-02/expected.json new file mode 100644 index 0000000000..acb3c68692 --- /dev/null +++ b/test/fixtures/esprima/es2015-array-binding-pattern/array-binding-pattern-02/expected.json @@ -0,0 +1,135 @@ +{ + "type": "File", + "start": 0, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "expression": { + "type": "ArrowFunctionExpression", + "start": 0, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "id": null, + "generator": false, + "expression": true, + "params": [ + { + "type": "ArrayPattern", + "start": 1, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "elements": [ + { + "type": "Identifier", + "start": 2, + "end": 3, + "loc": { + "start": { + "line": 1, + "column": 2 + }, + "end": { + "line": 1, + "column": 3 + } + }, + "name": "a" + }, + { + "type": "Identifier", + "start": 4, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "name": "b" + } + ] + } + ], + "body": { + "type": "Literal", + "start": 9, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "value": 0, + "rawValue": 0, + "raw": "0" + } + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-array-binding-pattern/array-binding-pattern-03/actual.js b/test/fixtures/esprima/es2015-array-binding-pattern/array-binding-pattern-03/actual.js new file mode 100644 index 0000000000..05fb54993f --- /dev/null +++ b/test/fixtures/esprima/es2015-array-binding-pattern/array-binding-pattern-03/actual.js @@ -0,0 +1 @@ +([a,...b])=>0; diff --git a/test/fixtures/esprima/es2015-array-binding-pattern/array-binding-pattern-03/expected.json b/test/fixtures/esprima/es2015-array-binding-pattern/array-binding-pattern-03/expected.json new file mode 100644 index 0000000000..bb4d92fc83 --- /dev/null +++ b/test/fixtures/esprima/es2015-array-binding-pattern/array-binding-pattern-03/expected.json @@ -0,0 +1,150 @@ +{ + "type": "File", + "start": 0, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "expression": { + "type": "ArrowFunctionExpression", + "start": 0, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "id": null, + "generator": false, + "expression": true, + "params": [ + { + "type": "ArrayPattern", + "start": 1, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "elements": [ + { + "type": "Identifier", + "start": 2, + "end": 3, + "loc": { + "start": { + "line": 1, + "column": 2 + }, + "end": { + "line": 1, + "column": 3 + } + }, + "name": "a" + }, + { + "type": "RestElement", + "start": 4, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "argument": { + "type": "Identifier", + "start": 7, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "name": "b" + } + } + ] + } + ], + "body": { + "type": "Literal", + "start": 12, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 12 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "value": 0, + "rawValue": 0, + "raw": "0" + } + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-array-binding-pattern/array-binding-pattern-empty/actual.js b/test/fixtures/esprima/es2015-array-binding-pattern/array-binding-pattern-empty/actual.js new file mode 100644 index 0000000000..49f16d5171 --- /dev/null +++ b/test/fixtures/esprima/es2015-array-binding-pattern/array-binding-pattern-empty/actual.js @@ -0,0 +1 @@ +([])=>0; diff --git a/test/fixtures/esprima/es2015-array-binding-pattern/array-binding-pattern-empty/expected.json b/test/fixtures/esprima/es2015-array-binding-pattern/array-binding-pattern-empty/expected.json new file mode 100644 index 0000000000..055970fd64 --- /dev/null +++ b/test/fixtures/esprima/es2015-array-binding-pattern/array-binding-pattern-empty/expected.json @@ -0,0 +1,102 @@ +{ + "type": "File", + "start": 0, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "expression": { + "type": "ArrowFunctionExpression", + "start": 0, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "id": null, + "generator": false, + "expression": true, + "params": [ + { + "type": "ArrayPattern", + "start": 1, + "end": 3, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 3 + } + }, + "elements": [] + } + ], + "body": { + "type": "Literal", + "start": 6, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "value": 0, + "rawValue": 0, + "raw": "0" + } + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-array-binding-pattern/elision/actual.js b/test/fixtures/esprima/es2015-array-binding-pattern/elision/actual.js new file mode 100644 index 0000000000..f5e9538ab1 --- /dev/null +++ b/test/fixtures/esprima/es2015-array-binding-pattern/elision/actual.js @@ -0,0 +1 @@ +([,,])=>0 diff --git a/test/fixtures/esprima/es2015-array-binding-pattern/elision/expected.json b/test/fixtures/esprima/es2015-array-binding-pattern/elision/expected.json new file mode 100644 index 0000000000..7c9c32e1c5 --- /dev/null +++ b/test/fixtures/esprima/es2015-array-binding-pattern/elision/expected.json @@ -0,0 +1,105 @@ +{ + "type": "File", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "expression": { + "type": "ArrowFunctionExpression", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "id": null, + "generator": false, + "expression": true, + "params": [ + { + "type": "ArrayPattern", + "start": 1, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "elements": [ + null, + null + ] + } + ], + "body": { + "type": "Literal", + "start": 8, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "value": 0, + "rawValue": 0, + "raw": "0" + } + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-array-binding-pattern/invalid-dup-param/actual.js b/test/fixtures/esprima/es2015-array-binding-pattern/invalid-dup-param/actual.js new file mode 100644 index 0000000000..1bd2fdef70 --- /dev/null +++ b/test/fixtures/esprima/es2015-array-binding-pattern/invalid-dup-param/actual.js @@ -0,0 +1 @@ +([a,[b],...b])=>0; diff --git a/test/fixtures/esprima/es2015-array-binding-pattern/invalid-dup-param/expected.json b/test/fixtures/esprima/es2015-array-binding-pattern/invalid-dup-param/expected.json new file mode 100644 index 0000000000..73fc92e40b --- /dev/null +++ b/test/fixtures/esprima/es2015-array-binding-pattern/invalid-dup-param/expected.json @@ -0,0 +1,183 @@ +{ + "type": "File", + "start": 0, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "expression": { + "type": "ArrowFunctionExpression", + "start": 0, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "id": null, + "generator": false, + "expression": true, + "params": [ + { + "type": "ArrayPattern", + "start": 1, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "elements": [ + { + "type": "Identifier", + "start": 2, + "end": 3, + "loc": { + "start": { + "line": 1, + "column": 2 + }, + "end": { + "line": 1, + "column": 3 + } + }, + "name": "a" + }, + { + "type": "ArrayPattern", + "start": 4, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "elements": [ + { + "type": "Identifier", + "start": 5, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "name": "b" + } + ] + }, + { + "type": "RestElement", + "start": 8, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "argument": { + "type": "Identifier", + "start": 11, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 11 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "name": "b" + } + } + ] + } + ], + "body": { + "type": "Literal", + "start": 16, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 16 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "value": 0, + "rawValue": 0, + "raw": "0" + } + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-array-binding-pattern/invalid-dup-param/options.json b/test/fixtures/esprima/es2015-array-binding-pattern/invalid-dup-param/options.json new file mode 100644 index 0000000000..34197d2efe --- /dev/null +++ b/test/fixtures/esprima/es2015-array-binding-pattern/invalid-dup-param/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Argument name clash in strict mode (1:11)" +} diff --git a/test/fixtures/esprima/es2015-array-binding-pattern/invalid-elision-after-rest/actual.js b/test/fixtures/esprima/es2015-array-binding-pattern/invalid-elision-after-rest/actual.js new file mode 100644 index 0000000000..6042292866 --- /dev/null +++ b/test/fixtures/esprima/es2015-array-binding-pattern/invalid-elision-after-rest/actual.js @@ -0,0 +1 @@ +([a,...b,])=>0; diff --git a/test/fixtures/esprima/es2015-array-binding-pattern/invalid-elision-after-rest/expected.json b/test/fixtures/esprima/es2015-array-binding-pattern/invalid-elision-after-rest/expected.json new file mode 100644 index 0000000000..aa98014263 --- /dev/null +++ b/test/fixtures/esprima/es2015-array-binding-pattern/invalid-elision-after-rest/expected.json @@ -0,0 +1,150 @@ +{ + "type": "File", + "start": 0, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "expression": { + "type": "ArrowFunctionExpression", + "start": 0, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "id": null, + "generator": false, + "expression": true, + "params": [ + { + "type": "ArrayPattern", + "start": 1, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "elements": [ + { + "type": "Identifier", + "start": 2, + "end": 3, + "loc": { + "start": { + "line": 1, + "column": 2 + }, + "end": { + "line": 1, + "column": 3 + } + }, + "name": "a" + }, + { + "type": "RestElement", + "start": 4, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "argument": { + "type": "Identifier", + "start": 7, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "name": "b" + } + } + ] + } + ], + "body": { + "type": "Literal", + "start": 13, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "value": 0, + "rawValue": 0, + "raw": "0" + } + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-array-binding-pattern/invalid-elision-after-rest/options.json b/test/fixtures/esprima/es2015-array-binding-pattern/invalid-elision-after-rest/options.json new file mode 100644 index 0000000000..358068a16a --- /dev/null +++ b/test/fixtures/esprima/es2015-array-binding-pattern/invalid-elision-after-rest/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Unexpected token (1:12)" +} \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-array-pattern/dupe-param-1/actual.js b/test/fixtures/esprima/es2015-array-pattern/dupe-param-1/actual.js new file mode 100644 index 0000000000..276ef3b4da --- /dev/null +++ b/test/fixtures/esprima/es2015-array-pattern/dupe-param-1/actual.js @@ -0,0 +1,2 @@ +"use strict"; +function a([a,a]){ } diff --git a/test/fixtures/esprima/es2015-array-pattern/dupe-param-2/actual.js b/test/fixtures/esprima/es2015-array-pattern/dupe-param-2/actual.js new file mode 100644 index 0000000000..bf5cca2904 --- /dev/null +++ b/test/fixtures/esprima/es2015-array-pattern/dupe-param-2/actual.js @@ -0,0 +1,2 @@ +"use strict"; +function a([a,...a]){ } diff --git a/test/fixtures/esprima/es2015-array-pattern/dupe-param-3/actual.js b/test/fixtures/esprima/es2015-array-pattern/dupe-param-3/actual.js new file mode 100644 index 0000000000..930726974e --- /dev/null +++ b/test/fixtures/esprima/es2015-array-pattern/dupe-param-3/actual.js @@ -0,0 +1,2 @@ +"use strict"; +function a([{a},...a]){ } diff --git a/test/fixtures/esprima/es2015-array-pattern/elision/actual.js b/test/fixtures/esprima/es2015-array-pattern/elision/actual.js new file mode 100644 index 0000000000..d8bb636425 --- /dev/null +++ b/test/fixtures/esprima/es2015-array-pattern/elision/actual.js @@ -0,0 +1 @@ +let [a,] = 0; diff --git a/test/fixtures/esprima/es2015-array-pattern/elision/expected.json b/test/fixtures/esprima/es2015-array-pattern/elision/expected.json new file mode 100644 index 0000000000..f0c82eec3f --- /dev/null +++ b/test/fixtures/esprima/es2015-array-pattern/elision/expected.json @@ -0,0 +1,117 @@ +{ + "type": "File", + "start": 0, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "sourceType": "script", + "body": [ + { + "type": "VariableDeclaration", + "start": 0, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 4, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "id": { + "type": "ArrayPattern", + "start": 4, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "elements": [ + { + "type": "Identifier", + "start": 5, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "name": "a" + } + ] + }, + "init": { + "type": "Literal", + "start": 11, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 11 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "value": 0, + "rawValue": 0, + "raw": "0" + } + } + ], + "kind": "let" + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-array-pattern/empty-pattern-catch-param/actual.js b/test/fixtures/esprima/es2015-array-pattern/empty-pattern-catch-param/actual.js new file mode 100644 index 0000000000..5d4f5ddda4 --- /dev/null +++ b/test/fixtures/esprima/es2015-array-pattern/empty-pattern-catch-param/actual.js @@ -0,0 +1 @@ +try { } catch ([]) {} diff --git a/test/fixtures/esprima/es2015-array-pattern/empty-pattern-catch-param/expected.json b/test/fixtures/esprima/es2015-array-pattern/empty-pattern-catch-param/expected.json new file mode 100644 index 0000000000..85e1ffb837 --- /dev/null +++ b/test/fixtures/esprima/es2015-array-pattern/empty-pattern-catch-param/expected.json @@ -0,0 +1,113 @@ +{ + "type": "File", + "start": 0, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 21 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 21 + } + }, + "sourceType": "script", + "body": [ + { + "type": "TryStatement", + "start": 0, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 21 + } + }, + "block": { + "type": "BlockStatement", + "start": 4, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "body": [] + }, + "handler": { + "type": "CatchClause", + "start": 8, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 21 + } + }, + "param": { + "type": "ArrayPattern", + "start": 15, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "elements": [] + }, + "body": { + "type": "BlockStatement", + "start": 19, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 19 + }, + "end": { + "line": 1, + "column": 21 + } + }, + "body": [] + } + }, + "guardedHandlers": [], + "finalizer": null + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-array-pattern/empty-pattern-fn/actual.js b/test/fixtures/esprima/es2015-array-pattern/empty-pattern-fn/actual.js new file mode 100644 index 0000000000..61b45b94bc --- /dev/null +++ b/test/fixtures/esprima/es2015-array-pattern/empty-pattern-fn/actual.js @@ -0,0 +1 @@ +function a([]) {} diff --git a/test/fixtures/esprima/es2015-array-pattern/empty-pattern-fn/expected.json b/test/fixtures/esprima/es2015-array-pattern/empty-pattern-fn/expected.json new file mode 100644 index 0000000000..495f1eefe4 --- /dev/null +++ b/test/fixtures/esprima/es2015-array-pattern/empty-pattern-fn/expected.json @@ -0,0 +1,100 @@ +{ + "type": "File", + "start": 0, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "sourceType": "script", + "body": [ + { + "type": "FunctionDeclaration", + "start": 0, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "id": { + "type": "Identifier", + "start": 9, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "name": "a" + }, + "generator": false, + "expression": false, + "params": [ + { + "type": "ArrayPattern", + "start": 11, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 11 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "elements": [] + } + ], + "body": { + "type": "BlockStatement", + "start": 15, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "body": [] + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-array-pattern/empty-pattern-lexical/actual.js b/test/fixtures/esprima/es2015-array-pattern/empty-pattern-lexical/actual.js new file mode 100644 index 0000000000..62ca18957d --- /dev/null +++ b/test/fixtures/esprima/es2015-array-pattern/empty-pattern-lexical/actual.js @@ -0,0 +1 @@ +let [] = []; diff --git a/test/fixtures/esprima/es2015-array-pattern/empty-pattern-lexical/expected.json b/test/fixtures/esprima/es2015-array-pattern/empty-pattern-lexical/expected.json new file mode 100644 index 0000000000..969c550a6a --- /dev/null +++ b/test/fixtures/esprima/es2015-array-pattern/empty-pattern-lexical/expected.json @@ -0,0 +1,98 @@ +{ + "type": "File", + "start": 0, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "sourceType": "script", + "body": [ + { + "type": "VariableDeclaration", + "start": 0, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 4, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "id": { + "type": "ArrayPattern", + "start": 4, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "elements": [] + }, + "init": { + "type": "ArrayExpression", + "start": 9, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "elements": [] + } + } + ], + "kind": "let" + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-array-pattern/empty-pattern-var/actual.js b/test/fixtures/esprima/es2015-array-pattern/empty-pattern-var/actual.js new file mode 100644 index 0000000000..256529bc21 --- /dev/null +++ b/test/fixtures/esprima/es2015-array-pattern/empty-pattern-var/actual.js @@ -0,0 +1 @@ +var [] = 0; diff --git a/test/fixtures/esprima/es2015-array-pattern/empty-pattern-var/expected.json b/test/fixtures/esprima/es2015-array-pattern/empty-pattern-var/expected.json new file mode 100644 index 0000000000..536a85d158 --- /dev/null +++ b/test/fixtures/esprima/es2015-array-pattern/empty-pattern-var/expected.json @@ -0,0 +1,100 @@ +{ + "type": "File", + "start": 0, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "sourceType": "script", + "body": [ + { + "type": "VariableDeclaration", + "start": 0, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 4, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "id": { + "type": "ArrayPattern", + "start": 4, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "elements": [] + }, + "init": { + "type": "Literal", + "start": 9, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "value": 0, + "rawValue": 0, + "raw": "0" + } + } + ], + "kind": "var" + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-array-pattern/hole/actual.js b/test/fixtures/esprima/es2015-array-pattern/hole/actual.js new file mode 100644 index 0000000000..76fe814bc5 --- /dev/null +++ b/test/fixtures/esprima/es2015-array-pattern/hole/actual.js @@ -0,0 +1 @@ +let [a,,b]=0 diff --git a/test/fixtures/esprima/es2015-array-pattern/hole/expected.json b/test/fixtures/esprima/es2015-array-pattern/hole/expected.json new file mode 100644 index 0000000000..44ee381630 --- /dev/null +++ b/test/fixtures/esprima/es2015-array-pattern/hole/expected.json @@ -0,0 +1,134 @@ +{ + "type": "File", + "start": 0, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "sourceType": "script", + "body": [ + { + "type": "VariableDeclaration", + "start": 0, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 4, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "id": { + "type": "ArrayPattern", + "start": 4, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "elements": [ + { + "type": "Identifier", + "start": 5, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "name": "a" + }, + null, + { + "type": "Identifier", + "start": 8, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "name": "b" + } + ] + }, + "init": { + "type": "Literal", + "start": 11, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 11 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "value": 0, + "rawValue": 0, + "raw": "0" + } + } + ], + "kind": "let" + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-array-pattern/nested-pattern/actual.js b/test/fixtures/esprima/es2015-array-pattern/nested-pattern/actual.js new file mode 100644 index 0000000000..88a3177b3b --- /dev/null +++ b/test/fixtures/esprima/es2015-array-pattern/nested-pattern/actual.js @@ -0,0 +1 @@ +let [[]]=0 diff --git a/test/fixtures/esprima/es2015-array-pattern/nested-pattern/expected.json b/test/fixtures/esprima/es2015-array-pattern/nested-pattern/expected.json new file mode 100644 index 0000000000..5d80c8dd9c --- /dev/null +++ b/test/fixtures/esprima/es2015-array-pattern/nested-pattern/expected.json @@ -0,0 +1,117 @@ +{ + "type": "File", + "start": 0, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "sourceType": "script", + "body": [ + { + "type": "VariableDeclaration", + "start": 0, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 4, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "id": { + "type": "ArrayPattern", + "start": 4, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "elements": [ + { + "type": "ArrayPattern", + "start": 5, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "elements": [] + } + ] + }, + "init": { + "type": "Literal", + "start": 9, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "value": 0, + "rawValue": 0, + "raw": "0" + } + } + ], + "kind": "let" + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-array-pattern/patterned-catch-dupe/actual.js b/test/fixtures/esprima/es2015-array-pattern/patterned-catch-dupe/actual.js new file mode 100644 index 0000000000..417d6fc849 --- /dev/null +++ b/test/fixtures/esprima/es2015-array-pattern/patterned-catch-dupe/actual.js @@ -0,0 +1 @@ +try {} catch ([a,a]) {} diff --git a/test/fixtures/esprima/es2015-array-pattern/patterned-catch-dupe/expected.json b/test/fixtures/esprima/es2015-array-pattern/patterned-catch-dupe/expected.json new file mode 100644 index 0000000000..5752809413 --- /dev/null +++ b/test/fixtures/esprima/es2015-array-pattern/patterned-catch-dupe/expected.json @@ -0,0 +1,146 @@ +{ + "type": "File", + "start": 0, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "sourceType": "script", + "body": [ + { + "type": "TryStatement", + "start": 0, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "block": { + "type": "BlockStatement", + "start": 4, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "body": [] + }, + "handler": { + "type": "CatchClause", + "start": 7, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "param": { + "type": "ArrayPattern", + "start": 14, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 14 + }, + "end": { + "line": 1, + "column": 19 + } + }, + "elements": [ + { + "type": "Identifier", + "start": 15, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "name": "a" + }, + { + "type": "Identifier", + "start": 17, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 17 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "name": "a" + } + ] + }, + "body": { + "type": "BlockStatement", + "start": 21, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 21 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "body": [] + } + }, + "guardedHandlers": [], + "finalizer": null + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-array-pattern/patterned-catch-dupe/options.json b/test/fixtures/esprima/es2015-array-pattern/patterned-catch-dupe/options.json new file mode 100644 index 0000000000..aca079ee39 --- /dev/null +++ b/test/fixtures/esprima/es2015-array-pattern/patterned-catch-dupe/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Unexpected token (1:20)" +} \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-array-pattern/patterned-catch/actual.js b/test/fixtures/esprima/es2015-array-pattern/patterned-catch/actual.js new file mode 100644 index 0000000000..4197eb461e --- /dev/null +++ b/test/fixtures/esprima/es2015-array-pattern/patterned-catch/actual.js @@ -0,0 +1 @@ +try {} catch ([a,b, {c, d:e=0, [f]:g=0, h=i}]) {} diff --git a/test/fixtures/esprima/es2015-array-pattern/patterned-catch/expected.json b/test/fixtures/esprima/es2015-array-pattern/patterned-catch/expected.json new file mode 100644 index 0000000000..0a028a82f1 --- /dev/null +++ b/test/fixtures/esprima/es2015-array-pattern/patterned-catch/expected.json @@ -0,0 +1,464 @@ +{ + "type": "File", + "start": 0, + "end": 49, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 49 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 49, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 49 + } + }, + "sourceType": "script", + "body": [ + { + "type": "TryStatement", + "start": 0, + "end": 49, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 49 + } + }, + "block": { + "type": "BlockStatement", + "start": 4, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "body": [] + }, + "handler": { + "type": "CatchClause", + "start": 7, + "end": 49, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 49 + } + }, + "param": { + "type": "ArrayPattern", + "start": 14, + "end": 45, + "loc": { + "start": { + "line": 1, + "column": 14 + }, + "end": { + "line": 1, + "column": 45 + } + }, + "elements": [ + { + "type": "Identifier", + "start": 15, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "name": "a" + }, + { + "type": "Identifier", + "start": 17, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 17 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "name": "b" + }, + { + "type": "ObjectPattern", + "start": 20, + "end": 44, + "loc": { + "start": { + "line": 1, + "column": 20 + }, + "end": { + "line": 1, + "column": 44 + } + }, + "properties": [ + { + "type": "Property", + "start": 21, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 21 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "method": false, + "shorthand": true, + "computed": false, + "key": { + "type": "Identifier", + "start": 21, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 21 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "name": "c" + }, + "kind": "init", + "value": { + "type": "Identifier", + "start": 21, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 21 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "name": "c" + } + }, + { + "type": "Property", + "start": 24, + "end": 29, + "loc": { + "start": { + "line": 1, + "column": 24 + }, + "end": { + "line": 1, + "column": 29 + } + }, + "method": false, + "shorthand": false, + "computed": false, + "key": { + "type": "Identifier", + "start": 24, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 24 + }, + "end": { + "line": 1, + "column": 25 + } + }, + "name": "d" + }, + "value": { + "type": "AssignmentPattern", + "start": 26, + "end": 29, + "loc": { + "start": { + "line": 1, + "column": 26 + }, + "end": { + "line": 1, + "column": 29 + } + }, + "left": { + "type": "Identifier", + "start": 26, + "end": 27, + "loc": { + "start": { + "line": 1, + "column": 26 + }, + "end": { + "line": 1, + "column": 27 + } + }, + "name": "e" + }, + "right": { + "type": "Literal", + "start": 28, + "end": 29, + "loc": { + "start": { + "line": 1, + "column": 28 + }, + "end": { + "line": 1, + "column": 29 + } + }, + "value": 0, + "rawValue": 0, + "raw": "0" + } + }, + "kind": "init" + }, + { + "type": "Property", + "start": 31, + "end": 38, + "loc": { + "start": { + "line": 1, + "column": 31 + }, + "end": { + "line": 1, + "column": 38 + } + }, + "method": false, + "shorthand": false, + "computed": true, + "key": { + "type": "Identifier", + "start": 32, + "end": 33, + "loc": { + "start": { + "line": 1, + "column": 32 + }, + "end": { + "line": 1, + "column": 33 + } + }, + "name": "f" + }, + "value": { + "type": "AssignmentPattern", + "start": 35, + "end": 38, + "loc": { + "start": { + "line": 1, + "column": 35 + }, + "end": { + "line": 1, + "column": 38 + } + }, + "left": { + "type": "Identifier", + "start": 35, + "end": 36, + "loc": { + "start": { + "line": 1, + "column": 35 + }, + "end": { + "line": 1, + "column": 36 + } + }, + "name": "g" + }, + "right": { + "type": "Literal", + "start": 37, + "end": 38, + "loc": { + "start": { + "line": 1, + "column": 37 + }, + "end": { + "line": 1, + "column": 38 + } + }, + "value": 0, + "rawValue": 0, + "raw": "0" + } + }, + "kind": "init" + }, + { + "type": "Property", + "start": 40, + "end": 43, + "loc": { + "start": { + "line": 1, + "column": 40 + }, + "end": { + "line": 1, + "column": 43 + } + }, + "method": false, + "shorthand": true, + "computed": false, + "key": { + "type": "Identifier", + "start": 40, + "end": 41, + "loc": { + "start": { + "line": 1, + "column": 40 + }, + "end": { + "line": 1, + "column": 41 + } + }, + "name": "h" + }, + "kind": "init", + "value": { + "type": "AssignmentPattern", + "start": 40, + "end": 43, + "loc": { + "start": { + "line": 1, + "column": 40 + }, + "end": { + "line": 1, + "column": 43 + } + }, + "left": { + "type": "Identifier", + "start": 40, + "end": 41, + "loc": { + "start": { + "line": 1, + "column": 40 + }, + "end": { + "line": 1, + "column": 41 + } + }, + "name": "h" + }, + "right": { + "type": "Identifier", + "start": 42, + "end": 43, + "loc": { + "start": { + "line": 1, + "column": 42 + }, + "end": { + "line": 1, + "column": 43 + } + }, + "name": "i" + } + } + } + ] + } + ] + }, + "body": { + "type": "BlockStatement", + "start": 47, + "end": 49, + "loc": { + "start": { + "line": 1, + "column": 47 + }, + "end": { + "line": 1, + "column": 49 + } + }, + "body": [] + } + }, + "guardedHandlers": [], + "finalizer": null + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-array-pattern/rest/actual.js b/test/fixtures/esprima/es2015-array-pattern/rest/actual.js new file mode 100644 index 0000000000..3fd6f16faa --- /dev/null +++ b/test/fixtures/esprima/es2015-array-pattern/rest/actual.js @@ -0,0 +1 @@ +let [...a] = 0; diff --git a/test/fixtures/esprima/es2015-array-pattern/rest/expected.json b/test/fixtures/esprima/es2015-array-pattern/rest/expected.json new file mode 100644 index 0000000000..7118bc2683 --- /dev/null +++ b/test/fixtures/esprima/es2015-array-pattern/rest/expected.json @@ -0,0 +1,132 @@ +{ + "type": "File", + "start": 0, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "sourceType": "script", + "body": [ + { + "type": "VariableDeclaration", + "start": 0, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 4, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "id": { + "type": "ArrayPattern", + "start": 4, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "elements": [ + { + "type": "RestElement", + "start": 5, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "argument": { + "type": "Identifier", + "start": 8, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "name": "a" + } + } + ] + }, + "init": { + "type": "Literal", + "start": 13, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "value": 0, + "rawValue": 0, + "raw": "0" + } + } + ], + "kind": "let" + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-array-pattern/rest/options.json b/test/fixtures/esprima/es2015-array-pattern/rest/options.json new file mode 100644 index 0000000000..328b1ddde8 --- /dev/null +++ b/test/fixtures/esprima/es2015-array-pattern/rest/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Unexpected token (1:10)" +} \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-array-pattern/tailing-hold/actual.js b/test/fixtures/esprima/es2015-array-pattern/tailing-hold/actual.js new file mode 100644 index 0000000000..7e1ac75714 --- /dev/null +++ b/test/fixtures/esprima/es2015-array-pattern/tailing-hold/actual.js @@ -0,0 +1 @@ +let [a,,]=0 diff --git a/test/fixtures/esprima/es2015-array-pattern/tailing-hold/expected.json b/test/fixtures/esprima/es2015-array-pattern/tailing-hold/expected.json new file mode 100644 index 0000000000..695be41271 --- /dev/null +++ b/test/fixtures/esprima/es2015-array-pattern/tailing-hold/expected.json @@ -0,0 +1,118 @@ +{ + "type": "File", + "start": 0, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "sourceType": "script", + "body": [ + { + "type": "VariableDeclaration", + "start": 0, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 4, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "id": { + "type": "ArrayPattern", + "start": 4, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "elements": [ + { + "type": "Identifier", + "start": 5, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "name": "a" + }, + null + ] + }, + "init": { + "type": "Literal", + "start": 10, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "value": 0, + "rawValue": 0, + "raw": "0" + } + } + ], + "kind": "let" + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-array-pattern/with-default-catch-param-fail/actual.js b/test/fixtures/esprima/es2015-array-pattern/with-default-catch-param-fail/actual.js new file mode 100644 index 0000000000..ff120cf6cd --- /dev/null +++ b/test/fixtures/esprima/es2015-array-pattern/with-default-catch-param-fail/actual.js @@ -0,0 +1 @@ +try { } catch ([a] = []) { } diff --git a/test/fixtures/esprima/es2015-array-pattern/with-default-catch-param-fail/options.json b/test/fixtures/esprima/es2015-array-pattern/with-default-catch-param-fail/options.json new file mode 100644 index 0000000000..1e730e1707 --- /dev/null +++ b/test/fixtures/esprima/es2015-array-pattern/with-default-catch-param-fail/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Unexpected token (1:19)" +} \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-array-pattern/with-default-catch-param/actual.js b/test/fixtures/esprima/es2015-array-pattern/with-default-catch-param/actual.js new file mode 100644 index 0000000000..0b02d2f86c --- /dev/null +++ b/test/fixtures/esprima/es2015-array-pattern/with-default-catch-param/actual.js @@ -0,0 +1 @@ +try { } catch ([a = 0]) { } diff --git a/test/fixtures/esprima/es2015-array-pattern/with-default-catch-param/expected.json b/test/fixtures/esprima/es2015-array-pattern/with-default-catch-param/expected.json new file mode 100644 index 0000000000..b45bc367e9 --- /dev/null +++ b/test/fixtures/esprima/es2015-array-pattern/with-default-catch-param/expected.json @@ -0,0 +1,163 @@ +{ + "type": "File", + "start": 0, + "end": 27, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 27 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 27, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 27 + } + }, + "sourceType": "script", + "body": [ + { + "type": "TryStatement", + "start": 0, + "end": 27, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 27 + } + }, + "block": { + "type": "BlockStatement", + "start": 4, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "body": [] + }, + "handler": { + "type": "CatchClause", + "start": 8, + "end": 27, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 27 + } + }, + "param": { + "type": "ArrayPattern", + "start": 15, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "elements": [ + { + "type": "AssignmentPattern", + "start": 16, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 16 + }, + "end": { + "line": 1, + "column": 21 + } + }, + "left": { + "type": "Identifier", + "start": 16, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 16 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "name": "a" + }, + "right": { + "type": "Literal", + "start": 20, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 20 + }, + "end": { + "line": 1, + "column": 21 + } + }, + "value": 0, + "rawValue": 0, + "raw": "0" + } + } + ] + }, + "body": { + "type": "BlockStatement", + "start": 24, + "end": 27, + "loc": { + "start": { + "line": 1, + "column": 24 + }, + "end": { + "line": 1, + "column": 27 + } + }, + "body": [] + } + }, + "guardedHandlers": [], + "finalizer": null + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-array-pattern/with-default-fn/actual.js b/test/fixtures/esprima/es2015-array-pattern/with-default-fn/actual.js new file mode 100644 index 0000000000..e74ff47ece --- /dev/null +++ b/test/fixtures/esprima/es2015-array-pattern/with-default-fn/actual.js @@ -0,0 +1 @@ +function a([a=0]) {} diff --git a/test/fixtures/esprima/es2015-array-pattern/with-default-fn/expected.json b/test/fixtures/esprima/es2015-array-pattern/with-default-fn/expected.json new file mode 100644 index 0000000000..da1c0b9799 --- /dev/null +++ b/test/fixtures/esprima/es2015-array-pattern/with-default-fn/expected.json @@ -0,0 +1,150 @@ +{ + "type": "File", + "start": 0, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "sourceType": "script", + "body": [ + { + "type": "FunctionDeclaration", + "start": 0, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "id": { + "type": "Identifier", + "start": 9, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "name": "a" + }, + "generator": false, + "expression": false, + "params": [ + { + "type": "ArrayPattern", + "start": 11, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 11 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "elements": [ + { + "type": "AssignmentPattern", + "start": 12, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 12 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "left": { + "type": "Identifier", + "start": 12, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 12 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "name": "a" + }, + "right": { + "type": "Literal", + "start": 14, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 14 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "value": 0, + "rawValue": 0, + "raw": "0" + } + } + ] + } + ], + "body": { + "type": "BlockStatement", + "start": 18, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 18 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "body": [] + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-array-pattern/with-object-pattern/actual.js b/test/fixtures/esprima/es2015-array-pattern/with-object-pattern/actual.js new file mode 100644 index 0000000000..c20b838021 --- /dev/null +++ b/test/fixtures/esprima/es2015-array-pattern/with-object-pattern/actual.js @@ -0,0 +1 @@ +let [{a}] = 0 diff --git a/test/fixtures/esprima/es2015-array-pattern/with-object-pattern/expected.json b/test/fixtures/esprima/es2015-array-pattern/with-object-pattern/expected.json new file mode 100644 index 0000000000..d7d0077c3d --- /dev/null +++ b/test/fixtures/esprima/es2015-array-pattern/with-object-pattern/expected.json @@ -0,0 +1,169 @@ +{ + "type": "File", + "start": 0, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "sourceType": "script", + "body": [ + { + "type": "VariableDeclaration", + "start": 0, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 4, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "id": { + "type": "ArrayPattern", + "start": 4, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "elements": [ + { + "type": "ObjectPattern", + "start": 5, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "properties": [ + { + "type": "Property", + "start": 6, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "method": false, + "shorthand": true, + "computed": false, + "key": { + "type": "Identifier", + "start": 6, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "name": "a" + }, + "kind": "init", + "value": { + "type": "Identifier", + "start": 6, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "name": "a" + } + } + ] + } + ] + }, + "init": { + "type": "Literal", + "start": 12, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 12 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "value": 0, + "rawValue": 0, + "raw": "0" + } + } + ], + "kind": "let" + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-arrow-function/arrow-rest-forgetting-comma/actual.js b/test/fixtures/esprima/es2015-arrow-function/arrow-rest-forgetting-comma/actual.js new file mode 100644 index 0000000000..de1208284b --- /dev/null +++ b/test/fixtures/esprima/es2015-arrow-function/arrow-rest-forgetting-comma/actual.js @@ -0,0 +1 @@ +(a ...b) => 0 diff --git a/test/fixtures/esprima/es2015-arrow-function/arrow-rest-forgetting-comma/options.json b/test/fixtures/esprima/es2015-arrow-function/arrow-rest-forgetting-comma/options.json new file mode 100644 index 0000000000..3b5e811628 --- /dev/null +++ b/test/fixtures/esprima/es2015-arrow-function/arrow-rest-forgetting-comma/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Unexpected token (1:3)" +} \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-arrow-function/arrow-with-multiple-arg-and-rest/actual.js b/test/fixtures/esprima/es2015-arrow-function/arrow-with-multiple-arg-and-rest/actual.js new file mode 100644 index 0000000000..61d7f20525 --- /dev/null +++ b/test/fixtures/esprima/es2015-arrow-function/arrow-with-multiple-arg-and-rest/actual.js @@ -0,0 +1 @@ +(a,b,...c) => 0; diff --git a/test/fixtures/esprima/es2015-arrow-function/arrow-with-multiple-arg-and-rest/expected.json b/test/fixtures/esprima/es2015-arrow-function/arrow-with-multiple-arg-and-rest/expected.json new file mode 100644 index 0000000000..878f8d67a9 --- /dev/null +++ b/test/fixtures/esprima/es2015-arrow-function/arrow-with-multiple-arg-and-rest/expected.json @@ -0,0 +1,149 @@ +{ + "type": "File", + "start": 0, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "expression": { + "type": "ArrowFunctionExpression", + "start": 0, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "id": null, + "generator": false, + "expression": true, + "params": [ + { + "type": "Identifier", + "start": 1, + "end": 2, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 2 + } + }, + "name": "a" + }, + { + "type": "Identifier", + "start": 3, + "end": 4, + "loc": { + "start": { + "line": 1, + "column": 3 + }, + "end": { + "line": 1, + "column": 4 + } + }, + "name": "b" + }, + { + "type": "RestElement", + "start": 5, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "argument": { + "type": "Identifier", + "start": 8, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "name": "c" + } + } + ], + "body": { + "type": "Literal", + "start": 14, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 14 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "value": 0, + "rawValue": 0, + "raw": "0" + } + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-arrow-function/arrow-with-multiple-rest/actual.js b/test/fixtures/esprima/es2015-arrow-function/arrow-with-multiple-rest/actual.js new file mode 100644 index 0000000000..7d8f773fc2 --- /dev/null +++ b/test/fixtures/esprima/es2015-arrow-function/arrow-with-multiple-rest/actual.js @@ -0,0 +1 @@ +(...a, ...b) => 0 diff --git a/test/fixtures/esprima/es2015-arrow-function/arrow-with-multiple-rest/options.json b/test/fixtures/esprima/es2015-arrow-function/arrow-with-multiple-rest/options.json new file mode 100644 index 0000000000..0ab445fe47 --- /dev/null +++ b/test/fixtures/esprima/es2015-arrow-function/arrow-with-multiple-rest/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Unexpected token (1:5)" +} \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-arrow-function/arrow-with-only-rest/actual.js b/test/fixtures/esprima/es2015-arrow-function/arrow-with-only-rest/actual.js new file mode 100644 index 0000000000..db6e46e4e2 --- /dev/null +++ b/test/fixtures/esprima/es2015-arrow-function/arrow-with-only-rest/actual.js @@ -0,0 +1 @@ +(...a) => 0 diff --git a/test/fixtures/esprima/es2015-arrow-function/arrow-with-only-rest/expected.json b/test/fixtures/esprima/es2015-arrow-function/arrow-with-only-rest/expected.json new file mode 100644 index 0000000000..7528bfa144 --- /dev/null +++ b/test/fixtures/esprima/es2015-arrow-function/arrow-with-only-rest/expected.json @@ -0,0 +1,117 @@ +{ + "type": "File", + "start": 0, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "expression": { + "type": "ArrowFunctionExpression", + "start": 0, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "id": null, + "generator": false, + "expression": true, + "params": [ + { + "type": "RestElement", + "start": 1, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "argument": { + "type": "Identifier", + "start": 4, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "name": "a" + } + } + ], + "body": { + "type": "Literal", + "start": 10, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "value": 0, + "rawValue": 0, + "raw": "0" + } + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-arrow-function/complex-rest-in-arrow-not-allowed/actual.js b/test/fixtures/esprima/es2015-arrow-function/complex-rest-in-arrow-not-allowed/actual.js new file mode 100644 index 0000000000..ed8b57eb04 --- /dev/null +++ b/test/fixtures/esprima/es2015-arrow-function/complex-rest-in-arrow-not-allowed/actual.js @@ -0,0 +1 @@ +(a,...[a]) => 0; diff --git a/test/fixtures/esprima/es2015-arrow-function/complex-rest-in-arrow-not-allowed/options.json b/test/fixtures/esprima/es2015-arrow-function/complex-rest-in-arrow-not-allowed/options.json new file mode 100644 index 0000000000..4ebe77e8fc --- /dev/null +++ b/test/fixtures/esprima/es2015-arrow-function/complex-rest-in-arrow-not-allowed/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Argument name clash in strict mode (1:7)" +} diff --git a/test/fixtures/esprima/es2015-arrow-function/invalid-duplicated-params/actual.js b/test/fixtures/esprima/es2015-arrow-function/invalid-duplicated-params/actual.js new file mode 100644 index 0000000000..edd030d19c --- /dev/null +++ b/test/fixtures/esprima/es2015-arrow-function/invalid-duplicated-params/actual.js @@ -0,0 +1 @@ +(x, x) => y; diff --git a/test/fixtures/esprima/es2015-arrow-function/invalid-duplicated-params/options.json b/test/fixtures/esprima/es2015-arrow-function/invalid-duplicated-params/options.json new file mode 100644 index 0000000000..0590c2b7e6 --- /dev/null +++ b/test/fixtures/esprima/es2015-arrow-function/invalid-duplicated-params/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Argument name clash in strict mode (1:4)" +} diff --git a/test/fixtures/esprima/es2015-arrow-function/invalid-line-terminator-arrow/actual.js b/test/fixtures/esprima/es2015-arrow-function/invalid-line-terminator-arrow/actual.js new file mode 100644 index 0000000000..efc10aad8b --- /dev/null +++ b/test/fixtures/esprima/es2015-arrow-function/invalid-line-terminator-arrow/actual.js @@ -0,0 +1,2 @@ +() +=> 42 diff --git a/test/fixtures/esprima/es2015-arrow-function/invalid-line-terminator-arrow/options.json b/test/fixtures/esprima/es2015-arrow-function/invalid-line-terminator-arrow/options.json new file mode 100644 index 0000000000..04b967a2ee --- /dev/null +++ b/test/fixtures/esprima/es2015-arrow-function/invalid-line-terminator-arrow/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Unexpected token (1:1)" +} \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-arrow-function/invalid-param-strict-mode/actual.js b/test/fixtures/esprima/es2015-arrow-function/invalid-param-strict-mode/actual.js new file mode 100644 index 0000000000..5087dd1250 --- /dev/null +++ b/test/fixtures/esprima/es2015-arrow-function/invalid-param-strict-mode/actual.js @@ -0,0 +1 @@ +eval => {"use strict"}; diff --git a/test/fixtures/esprima/es2015-arrow-function/invalid-param-strict-mode/expected.json b/test/fixtures/esprima/es2015-arrow-function/invalid-param-strict-mode/expected.json new file mode 100644 index 0000000000..28f8776321 --- /dev/null +++ b/test/fixtures/esprima/es2015-arrow-function/invalid-param-strict-mode/expected.json @@ -0,0 +1,134 @@ +{ + "type": "File", + "start": 0, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "expression": { + "type": "ArrowFunctionExpression", + "start": 0, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "id": null, + "generator": false, + "expression": false, + "params": [ + { + "type": "Identifier", + "start": 0, + "end": 4, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 4 + } + }, + "name": "eval" + } + ], + "body": { + "type": "BlockStatement", + "start": 8, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "body": [ + { + "type": "ExpressionStatement", + "start": 9, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 21 + } + }, + "expression": { + "type": "Literal", + "start": 9, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 21 + } + }, + "value": "use strict", + "rawValue": "use strict", + "raw": "\"use strict\"" + } + } + ] + } + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-arrow-function/invalid-param-strict-mode/options.json b/test/fixtures/esprima/es2015-arrow-function/invalid-param-strict-mode/options.json new file mode 100644 index 0000000000..811d429e63 --- /dev/null +++ b/test/fixtures/esprima/es2015-arrow-function/invalid-param-strict-mode/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Binding eval in strict mode (1:0)" +} \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-arrow-function/migrated_0000/actual.js b/test/fixtures/esprima/es2015-arrow-function/migrated_0000/actual.js new file mode 100644 index 0000000000..9bd20e6306 --- /dev/null +++ b/test/fixtures/esprima/es2015-arrow-function/migrated_0000/actual.js @@ -0,0 +1 @@ +() => "test" diff --git a/test/fixtures/esprima/es2015-arrow-function/migrated_0000/expected.json b/test/fixtures/esprima/es2015-arrow-function/migrated_0000/expected.json new file mode 100644 index 0000000000..cdf259a636 --- /dev/null +++ b/test/fixtures/esprima/es2015-arrow-function/migrated_0000/expected.json @@ -0,0 +1,85 @@ +{ + "type": "File", + "start": 0, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "expression": { + "type": "ArrowFunctionExpression", + "start": 0, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "id": null, + "generator": false, + "expression": true, + "params": [], + "body": { + "type": "Literal", + "start": 6, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "value": "test", + "rawValue": "test", + "raw": "\"test\"" + } + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-arrow-function/migrated_0001/actual.js b/test/fixtures/esprima/es2015-arrow-function/migrated_0001/actual.js new file mode 100644 index 0000000000..66e7d77f82 --- /dev/null +++ b/test/fixtures/esprima/es2015-arrow-function/migrated_0001/actual.js @@ -0,0 +1 @@ +e => "test" diff --git a/test/fixtures/esprima/es2015-arrow-function/migrated_0001/expected.json b/test/fixtures/esprima/es2015-arrow-function/migrated_0001/expected.json new file mode 100644 index 0000000000..fd76eb8af9 --- /dev/null +++ b/test/fixtures/esprima/es2015-arrow-function/migrated_0001/expected.json @@ -0,0 +1,102 @@ +{ + "type": "File", + "start": 0, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "expression": { + "type": "ArrowFunctionExpression", + "start": 0, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "id": null, + "generator": false, + "expression": true, + "params": [ + { + "type": "Identifier", + "start": 0, + "end": 1, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + } + }, + "name": "e" + } + ], + "body": { + "type": "Literal", + "start": 5, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "value": "test", + "rawValue": "test", + "raw": "\"test\"" + } + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-arrow-function/migrated_0002/actual.js b/test/fixtures/esprima/es2015-arrow-function/migrated_0002/actual.js new file mode 100644 index 0000000000..492abecbb4 --- /dev/null +++ b/test/fixtures/esprima/es2015-arrow-function/migrated_0002/actual.js @@ -0,0 +1 @@ +(e) => "test" diff --git a/test/fixtures/esprima/es2015-arrow-function/migrated_0002/expected.json b/test/fixtures/esprima/es2015-arrow-function/migrated_0002/expected.json new file mode 100644 index 0000000000..1b9cab7e5c --- /dev/null +++ b/test/fixtures/esprima/es2015-arrow-function/migrated_0002/expected.json @@ -0,0 +1,102 @@ +{ + "type": "File", + "start": 0, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "expression": { + "type": "ArrowFunctionExpression", + "start": 0, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "id": null, + "generator": false, + "expression": true, + "params": [ + { + "type": "Identifier", + "start": 1, + "end": 2, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 2 + } + }, + "name": "e" + } + ], + "body": { + "type": "Literal", + "start": 7, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "value": "test", + "rawValue": "test", + "raw": "\"test\"" + } + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-arrow-function/migrated_0003/actual.js b/test/fixtures/esprima/es2015-arrow-function/migrated_0003/actual.js new file mode 100644 index 0000000000..fb2bcd3a3f --- /dev/null +++ b/test/fixtures/esprima/es2015-arrow-function/migrated_0003/actual.js @@ -0,0 +1 @@ +(a, b) => "test" diff --git a/test/fixtures/esprima/es2015-arrow-function/migrated_0003/expected.json b/test/fixtures/esprima/es2015-arrow-function/migrated_0003/expected.json new file mode 100644 index 0000000000..5a88aff7cb --- /dev/null +++ b/test/fixtures/esprima/es2015-arrow-function/migrated_0003/expected.json @@ -0,0 +1,118 @@ +{ + "type": "File", + "start": 0, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "expression": { + "type": "ArrowFunctionExpression", + "start": 0, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "id": null, + "generator": false, + "expression": true, + "params": [ + { + "type": "Identifier", + "start": 1, + "end": 2, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 2 + } + }, + "name": "a" + }, + { + "type": "Identifier", + "start": 4, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "name": "b" + } + ], + "body": { + "type": "Literal", + "start": 10, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "value": "test", + "rawValue": "test", + "raw": "\"test\"" + } + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-arrow-function/migrated_0004/actual.js b/test/fixtures/esprima/es2015-arrow-function/migrated_0004/actual.js new file mode 100644 index 0000000000..7832f00157 --- /dev/null +++ b/test/fixtures/esprima/es2015-arrow-function/migrated_0004/actual.js @@ -0,0 +1 @@ +e => { 42; } diff --git a/test/fixtures/esprima/es2015-arrow-function/migrated_0004/expected.json b/test/fixtures/esprima/es2015-arrow-function/migrated_0004/expected.json new file mode 100644 index 0000000000..a8c79cf5fc --- /dev/null +++ b/test/fixtures/esprima/es2015-arrow-function/migrated_0004/expected.json @@ -0,0 +1,134 @@ +{ + "type": "File", + "start": 0, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "expression": { + "type": "ArrowFunctionExpression", + "start": 0, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "id": null, + "generator": false, + "expression": false, + "params": [ + { + "type": "Identifier", + "start": 0, + "end": 1, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + } + }, + "name": "e" + } + ], + "body": { + "type": "BlockStatement", + "start": 5, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "body": [ + { + "type": "ExpressionStatement", + "start": 7, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "expression": { + "type": "Literal", + "start": 7, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "value": 42, + "rawValue": 42, + "raw": "42" + } + } + ] + } + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-arrow-function/migrated_0005/actual.js b/test/fixtures/esprima/es2015-arrow-function/migrated_0005/actual.js new file mode 100644 index 0000000000..8cae73b669 --- /dev/null +++ b/test/fixtures/esprima/es2015-arrow-function/migrated_0005/actual.js @@ -0,0 +1 @@ +e => ({ property: 42 }) diff --git a/test/fixtures/esprima/es2015-arrow-function/migrated_0005/expected.json b/test/fixtures/esprima/es2015-arrow-function/migrated_0005/expected.json new file mode 100644 index 0000000000..616b8e8a5b --- /dev/null +++ b/test/fixtures/esprima/es2015-arrow-function/migrated_0005/expected.json @@ -0,0 +1,155 @@ +{ + "type": "File", + "start": 0, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "expression": { + "type": "ArrowFunctionExpression", + "start": 0, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "id": null, + "generator": false, + "expression": true, + "params": [ + { + "type": "Identifier", + "start": 0, + "end": 1, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + } + }, + "name": "e" + } + ], + "body": { + "type": "ObjectExpression", + "start": 6, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "properties": [ + { + "type": "Property", + "start": 8, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "method": false, + "shorthand": false, + "computed": false, + "key": { + "type": "Identifier", + "start": 8, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "name": "property" + }, + "value": { + "type": "Literal", + "start": 18, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 18 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "value": 42, + "rawValue": 42, + "raw": "42" + }, + "kind": "init" + } + ], + "parenthesizedExpression": true + } + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-arrow-function/migrated_0006/actual.js b/test/fixtures/esprima/es2015-arrow-function/migrated_0006/actual.js new file mode 100644 index 0000000000..a315e257aa --- /dev/null +++ b/test/fixtures/esprima/es2015-arrow-function/migrated_0006/actual.js @@ -0,0 +1 @@ +e => { label: 42 } diff --git a/test/fixtures/esprima/es2015-arrow-function/migrated_0006/expected.json b/test/fixtures/esprima/es2015-arrow-function/migrated_0006/expected.json new file mode 100644 index 0000000000..be00941649 --- /dev/null +++ b/test/fixtures/esprima/es2015-arrow-function/migrated_0006/expected.json @@ -0,0 +1,165 @@ +{ + "type": "File", + "start": 0, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "expression": { + "type": "ArrowFunctionExpression", + "start": 0, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "id": null, + "generator": false, + "expression": false, + "params": [ + { + "type": "Identifier", + "start": 0, + "end": 1, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + } + }, + "name": "e" + } + ], + "body": { + "type": "BlockStatement", + "start": 5, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "body": [ + { + "type": "LabeledStatement", + "start": 7, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "body": { + "type": "ExpressionStatement", + "start": 14, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 14 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "expression": { + "type": "Literal", + "start": 14, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 14 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "value": 42, + "rawValue": 42, + "raw": "42" + } + }, + "label": { + "type": "Identifier", + "start": 7, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "name": "label" + } + } + ] + } + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-arrow-function/migrated_0007/actual.js b/test/fixtures/esprima/es2015-arrow-function/migrated_0007/actual.js new file mode 100644 index 0000000000..1de9f227d2 --- /dev/null +++ b/test/fixtures/esprima/es2015-arrow-function/migrated_0007/actual.js @@ -0,0 +1 @@ +(a, b) => { 42; } diff --git a/test/fixtures/esprima/es2015-arrow-function/migrated_0007/expected.json b/test/fixtures/esprima/es2015-arrow-function/migrated_0007/expected.json new file mode 100644 index 0000000000..f79a8f0276 --- /dev/null +++ b/test/fixtures/esprima/es2015-arrow-function/migrated_0007/expected.json @@ -0,0 +1,150 @@ +{ + "type": "File", + "start": 0, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "expression": { + "type": "ArrowFunctionExpression", + "start": 0, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "id": null, + "generator": false, + "expression": false, + "params": [ + { + "type": "Identifier", + "start": 1, + "end": 2, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 2 + } + }, + "name": "a" + }, + { + "type": "Identifier", + "start": 4, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "name": "b" + } + ], + "body": { + "type": "BlockStatement", + "start": 10, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "body": [ + { + "type": "ExpressionStatement", + "start": 12, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 12 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "expression": { + "type": "Literal", + "start": 12, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 12 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "value": 42, + "rawValue": 42, + "raw": "42" + } + } + ] + } + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-arrow-function/migrated_0008/actual.js b/test/fixtures/esprima/es2015-arrow-function/migrated_0008/actual.js new file mode 100644 index 0000000000..7d3f13df4b --- /dev/null +++ b/test/fixtures/esprima/es2015-arrow-function/migrated_0008/actual.js @@ -0,0 +1 @@ +(x=1) => x * x diff --git a/test/fixtures/esprima/es2015-arrow-function/migrated_0008/expected.json b/test/fixtures/esprima/es2015-arrow-function/migrated_0008/expected.json new file mode 100644 index 0000000000..7ad095e070 --- /dev/null +++ b/test/fixtures/esprima/es2015-arrow-function/migrated_0008/expected.json @@ -0,0 +1,165 @@ +{ + "type": "File", + "start": 0, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "expression": { + "type": "ArrowFunctionExpression", + "start": 0, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "id": null, + "generator": false, + "expression": true, + "params": [ + { + "type": "AssignmentPattern", + "start": 1, + "end": 4, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 4 + } + }, + "left": { + "type": "Identifier", + "start": 1, + "end": 2, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 2 + } + }, + "name": "x" + }, + "right": { + "type": "Literal", + "start": 3, + "end": 4, + "loc": { + "start": { + "line": 1, + "column": 3 + }, + "end": { + "line": 1, + "column": 4 + } + }, + "value": 1, + "rawValue": 1, + "raw": "1" + } + } + ], + "body": { + "type": "BinaryExpression", + "start": 9, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "left": { + "type": "Identifier", + "start": 9, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "name": "x" + }, + "operator": "*", + "right": { + "type": "Identifier", + "start": 13, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "name": "x" + } + } + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-arrow-function/migrated_0009/actual.js b/test/fixtures/esprima/es2015-arrow-function/migrated_0009/actual.js new file mode 100644 index 0000000000..d1cf60fd7e --- /dev/null +++ b/test/fixtures/esprima/es2015-arrow-function/migrated_0009/actual.js @@ -0,0 +1 @@ +eval => 42 diff --git a/test/fixtures/esprima/es2015-arrow-function/migrated_0009/expected.json b/test/fixtures/esprima/es2015-arrow-function/migrated_0009/expected.json new file mode 100644 index 0000000000..c45a0f326b --- /dev/null +++ b/test/fixtures/esprima/es2015-arrow-function/migrated_0009/expected.json @@ -0,0 +1,102 @@ +{ + "type": "File", + "start": 0, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "expression": { + "type": "ArrowFunctionExpression", + "start": 0, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "id": null, + "generator": false, + "expression": true, + "params": [ + { + "type": "Identifier", + "start": 0, + "end": 4, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 4 + } + }, + "name": "eval" + } + ], + "body": { + "type": "Literal", + "start": 8, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "value": 42, + "rawValue": 42, + "raw": "42" + } + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-arrow-function/migrated_0010/actual.js b/test/fixtures/esprima/es2015-arrow-function/migrated_0010/actual.js new file mode 100644 index 0000000000..c2c0225fe2 --- /dev/null +++ b/test/fixtures/esprima/es2015-arrow-function/migrated_0010/actual.js @@ -0,0 +1 @@ +arguments => 42 diff --git a/test/fixtures/esprima/es2015-arrow-function/migrated_0010/expected.json b/test/fixtures/esprima/es2015-arrow-function/migrated_0010/expected.json new file mode 100644 index 0000000000..6af42ac3f5 --- /dev/null +++ b/test/fixtures/esprima/es2015-arrow-function/migrated_0010/expected.json @@ -0,0 +1,102 @@ +{ + "type": "File", + "start": 0, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "expression": { + "type": "ArrowFunctionExpression", + "start": 0, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "id": null, + "generator": false, + "expression": true, + "params": [ + { + "type": "Identifier", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "name": "arguments" + } + ], + "body": { + "type": "Literal", + "start": 13, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "value": 42, + "rawValue": 42, + "raw": "42" + } + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-arrow-function/migrated_0011/actual.js b/test/fixtures/esprima/es2015-arrow-function/migrated_0011/actual.js new file mode 100644 index 0000000000..c8cc6f33f2 --- /dev/null +++ b/test/fixtures/esprima/es2015-arrow-function/migrated_0011/actual.js @@ -0,0 +1 @@ +(a) => 00 diff --git a/test/fixtures/esprima/es2015-arrow-function/migrated_0011/expected.json b/test/fixtures/esprima/es2015-arrow-function/migrated_0011/expected.json new file mode 100644 index 0000000000..79998f9b16 --- /dev/null +++ b/test/fixtures/esprima/es2015-arrow-function/migrated_0011/expected.json @@ -0,0 +1,102 @@ +{ + "type": "File", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "expression": { + "type": "ArrowFunctionExpression", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "id": null, + "generator": false, + "expression": true, + "params": [ + { + "type": "Identifier", + "start": 1, + "end": 2, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 2 + } + }, + "name": "a" + } + ], + "body": { + "type": "Literal", + "start": 7, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "value": 0, + "rawValue": 0, + "raw": "00" + } + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-arrow-function/migrated_0012/actual.js b/test/fixtures/esprima/es2015-arrow-function/migrated_0012/actual.js new file mode 100644 index 0000000000..2cd3cc4073 --- /dev/null +++ b/test/fixtures/esprima/es2015-arrow-function/migrated_0012/actual.js @@ -0,0 +1 @@ +(eval, a) => 42 diff --git a/test/fixtures/esprima/es2015-arrow-function/migrated_0012/expected.json b/test/fixtures/esprima/es2015-arrow-function/migrated_0012/expected.json new file mode 100644 index 0000000000..09c80c6f1e --- /dev/null +++ b/test/fixtures/esprima/es2015-arrow-function/migrated_0012/expected.json @@ -0,0 +1,118 @@ +{ + "type": "File", + "start": 0, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "expression": { + "type": "ArrowFunctionExpression", + "start": 0, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "id": null, + "generator": false, + "expression": true, + "params": [ + { + "type": "Identifier", + "start": 1, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "name": "eval" + }, + { + "type": "Identifier", + "start": 7, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "name": "a" + } + ], + "body": { + "type": "Literal", + "start": 13, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "value": 42, + "rawValue": 42, + "raw": "42" + } + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-arrow-function/migrated_0013/actual.js b/test/fixtures/esprima/es2015-arrow-function/migrated_0013/actual.js new file mode 100644 index 0000000000..8bfa1d67ec --- /dev/null +++ b/test/fixtures/esprima/es2015-arrow-function/migrated_0013/actual.js @@ -0,0 +1 @@ +(eval = 10) => 42 diff --git a/test/fixtures/esprima/es2015-arrow-function/migrated_0013/expected.json b/test/fixtures/esprima/es2015-arrow-function/migrated_0013/expected.json new file mode 100644 index 0000000000..7549259432 --- /dev/null +++ b/test/fixtures/esprima/es2015-arrow-function/migrated_0013/expected.json @@ -0,0 +1,135 @@ +{ + "type": "File", + "start": 0, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "expression": { + "type": "ArrowFunctionExpression", + "start": 0, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "id": null, + "generator": false, + "expression": true, + "params": [ + { + "type": "AssignmentPattern", + "start": 1, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "left": { + "type": "Identifier", + "start": 1, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "name": "eval" + }, + "right": { + "type": "Literal", + "start": 8, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "value": 10, + "rawValue": 10, + "raw": "10" + } + } + ], + "body": { + "type": "Literal", + "start": 15, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "value": 42, + "rawValue": 42, + "raw": "42" + } + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-arrow-function/migrated_0014/actual.js b/test/fixtures/esprima/es2015-arrow-function/migrated_0014/actual.js new file mode 100644 index 0000000000..1c47ed256a --- /dev/null +++ b/test/fixtures/esprima/es2015-arrow-function/migrated_0014/actual.js @@ -0,0 +1 @@ +(eval, a = 10) => 42 diff --git a/test/fixtures/esprima/es2015-arrow-function/migrated_0014/expected.json b/test/fixtures/esprima/es2015-arrow-function/migrated_0014/expected.json new file mode 100644 index 0000000000..6ea224db79 --- /dev/null +++ b/test/fixtures/esprima/es2015-arrow-function/migrated_0014/expected.json @@ -0,0 +1,151 @@ +{ + "type": "File", + "start": 0, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "expression": { + "type": "ArrowFunctionExpression", + "start": 0, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "id": null, + "generator": false, + "expression": true, + "params": [ + { + "type": "Identifier", + "start": 1, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "name": "eval" + }, + { + "type": "AssignmentPattern", + "start": 7, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "left": { + "type": "Identifier", + "start": 7, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "name": "a" + }, + "right": { + "type": "Literal", + "start": 11, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 11 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "value": 10, + "rawValue": 10, + "raw": "10" + } + } + ], + "body": { + "type": "Literal", + "start": 18, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 18 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "value": 42, + "rawValue": 42, + "raw": "42" + } + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-arrow-function/migrated_0015/actual.js b/test/fixtures/esprima/es2015-arrow-function/migrated_0015/actual.js new file mode 100644 index 0000000000..0d4a5ed958 --- /dev/null +++ b/test/fixtures/esprima/es2015-arrow-function/migrated_0015/actual.js @@ -0,0 +1 @@ +(x => x) diff --git a/test/fixtures/esprima/es2015-arrow-function/migrated_0015/expected.json b/test/fixtures/esprima/es2015-arrow-function/migrated_0015/expected.json new file mode 100644 index 0000000000..e81c37fc89 --- /dev/null +++ b/test/fixtures/esprima/es2015-arrow-function/migrated_0015/expected.json @@ -0,0 +1,101 @@ +{ + "type": "File", + "start": 0, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "expression": { + "type": "ArrowFunctionExpression", + "start": 1, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "id": null, + "generator": false, + "expression": true, + "params": [ + { + "type": "Identifier", + "start": 1, + "end": 2, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 2 + } + }, + "name": "x" + } + ], + "body": { + "type": "Identifier", + "start": 6, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "name": "x" + }, + "parenthesizedExpression": true + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-arrow-function/migrated_0016/actual.js b/test/fixtures/esprima/es2015-arrow-function/migrated_0016/actual.js new file mode 100644 index 0000000000..48deea86cf --- /dev/null +++ b/test/fixtures/esprima/es2015-arrow-function/migrated_0016/actual.js @@ -0,0 +1 @@ +x => y => 42 diff --git a/test/fixtures/esprima/es2015-arrow-function/migrated_0016/expected.json b/test/fixtures/esprima/es2015-arrow-function/migrated_0016/expected.json new file mode 100644 index 0000000000..8a76cf1c16 --- /dev/null +++ b/test/fixtures/esprima/es2015-arrow-function/migrated_0016/expected.json @@ -0,0 +1,138 @@ +{ + "type": "File", + "start": 0, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "expression": { + "type": "ArrowFunctionExpression", + "start": 0, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "id": null, + "generator": false, + "expression": true, + "params": [ + { + "type": "Identifier", + "start": 0, + "end": 1, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + } + }, + "name": "x" + } + ], + "body": { + "type": "ArrowFunctionExpression", + "start": 5, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "id": null, + "generator": false, + "expression": true, + "params": [ + { + "type": "Identifier", + "start": 5, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "name": "y" + } + ], + "body": { + "type": "Literal", + "start": 10, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "value": 42, + "rawValue": 42, + "raw": "42" + } + } + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-arrow-function/migrated_0017/actual.js b/test/fixtures/esprima/es2015-arrow-function/migrated_0017/actual.js new file mode 100644 index 0000000000..a243c8ba58 --- /dev/null +++ b/test/fixtures/esprima/es2015-arrow-function/migrated_0017/actual.js @@ -0,0 +1 @@ +(x) => ((y, z) => (x, y, z)) diff --git a/test/fixtures/esprima/es2015-arrow-function/migrated_0017/expected.json b/test/fixtures/esprima/es2015-arrow-function/migrated_0017/expected.json new file mode 100644 index 0000000000..8a2ef02d21 --- /dev/null +++ b/test/fixtures/esprima/es2015-arrow-function/migrated_0017/expected.json @@ -0,0 +1,203 @@ +{ + "type": "File", + "start": 0, + "end": 28, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 28 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 28, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 28 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 28, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 28 + } + }, + "expression": { + "type": "ArrowFunctionExpression", + "start": 0, + "end": 28, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 28 + } + }, + "id": null, + "generator": false, + "expression": true, + "params": [ + { + "type": "Identifier", + "start": 1, + "end": 2, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 2 + } + }, + "name": "x" + } + ], + "body": { + "type": "ArrowFunctionExpression", + "start": 8, + "end": 27, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 27 + } + }, + "id": null, + "generator": false, + "expression": true, + "params": [ + { + "type": "Identifier", + "start": 9, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "name": "y" + }, + { + "type": "Identifier", + "start": 12, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 12 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "name": "z" + } + ], + "body": { + "type": "SequenceExpression", + "start": 19, + "end": 26, + "loc": { + "start": { + "line": 1, + "column": 19 + }, + "end": { + "line": 1, + "column": 26 + } + }, + "expressions": [ + { + "type": "Identifier", + "start": 19, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 19 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "name": "x" + }, + { + "type": "Identifier", + "start": 22, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 22 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "name": "y" + }, + { + "type": "Identifier", + "start": 25, + "end": 26, + "loc": { + "start": { + "line": 1, + "column": 25 + }, + "end": { + "line": 1, + "column": 26 + } + }, + "name": "z" + } + ], + "parenthesizedExpression": true + }, + "parenthesizedExpression": true + } + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-arrow-function/migrated_0018/actual.js b/test/fixtures/esprima/es2015-arrow-function/migrated_0018/actual.js new file mode 100644 index 0000000000..62aef02bfd --- /dev/null +++ b/test/fixtures/esprima/es2015-arrow-function/migrated_0018/actual.js @@ -0,0 +1 @@ +foo(() => {}) diff --git a/test/fixtures/esprima/es2015-arrow-function/migrated_0018/expected.json b/test/fixtures/esprima/es2015-arrow-function/migrated_0018/expected.json new file mode 100644 index 0000000000..001ee4b78f --- /dev/null +++ b/test/fixtures/esprima/es2015-arrow-function/migrated_0018/expected.json @@ -0,0 +1,116 @@ +{ + "type": "File", + "start": 0, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "expression": { + "type": "CallExpression", + "start": 0, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "callee": { + "type": "Identifier", + "start": 0, + "end": 3, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 3 + } + }, + "name": "foo" + }, + "arguments": [ + { + "type": "ArrowFunctionExpression", + "start": 4, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "id": null, + "generator": false, + "expression": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 10, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "body": [] + } + } + ] + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-arrow-function/migrated_0019/actual.js b/test/fixtures/esprima/es2015-arrow-function/migrated_0019/actual.js new file mode 100644 index 0000000000..90023d1be8 --- /dev/null +++ b/test/fixtures/esprima/es2015-arrow-function/migrated_0019/actual.js @@ -0,0 +1 @@ +foo((x, y) => {}) diff --git a/test/fixtures/esprima/es2015-arrow-function/migrated_0019/expected.json b/test/fixtures/esprima/es2015-arrow-function/migrated_0019/expected.json new file mode 100644 index 0000000000..6abd542b88 --- /dev/null +++ b/test/fixtures/esprima/es2015-arrow-function/migrated_0019/expected.json @@ -0,0 +1,149 @@ +{ + "type": "File", + "start": 0, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "expression": { + "type": "CallExpression", + "start": 0, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "callee": { + "type": "Identifier", + "start": 0, + "end": 3, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 3 + } + }, + "name": "foo" + }, + "arguments": [ + { + "type": "ArrowFunctionExpression", + "start": 4, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "id": null, + "generator": false, + "expression": false, + "params": [ + { + "type": "Identifier", + "start": 5, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "name": "x" + }, + { + "type": "Identifier", + "start": 8, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "name": "y" + } + ], + "body": { + "type": "BlockStatement", + "start": 14, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 14 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "body": [] + } + } + ] + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-arrow-function/migrated_0020/actual.js b/test/fixtures/esprima/es2015-arrow-function/migrated_0020/actual.js new file mode 100644 index 0000000000..3222faced0 --- /dev/null +++ b/test/fixtures/esprima/es2015-arrow-function/migrated_0020/actual.js @@ -0,0 +1 @@ +(sun) => earth diff --git a/test/fixtures/esprima/es2015-arrow-function/migrated_0020/expected.json b/test/fixtures/esprima/es2015-arrow-function/migrated_0020/expected.json new file mode 100644 index 0000000000..c0edf43c28 --- /dev/null +++ b/test/fixtures/esprima/es2015-arrow-function/migrated_0020/expected.json @@ -0,0 +1,100 @@ +{ + "type": "File", + "start": 0, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "expression": { + "type": "ArrowFunctionExpression", + "start": 0, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "id": null, + "generator": false, + "expression": true, + "params": [ + { + "type": "Identifier", + "start": 1, + "end": 4, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 4 + } + }, + "name": "sun" + } + ], + "body": { + "type": "Identifier", + "start": 9, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "name": "earth" + } + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-arrow-function/non-arrow-param-followed-by-arrow/actual.js b/test/fixtures/esprima/es2015-arrow-function/non-arrow-param-followed-by-arrow/actual.js new file mode 100644 index 0000000000..487bb99ecf --- /dev/null +++ b/test/fixtures/esprima/es2015-arrow-function/non-arrow-param-followed-by-arrow/actual.js @@ -0,0 +1 @@ +((a)) => 0 diff --git a/test/fixtures/esprima/es2015-arrow-function/non-arrow-param-followed-by-arrow/options.json b/test/fixtures/esprima/es2015-arrow-function/non-arrow-param-followed-by-arrow/options.json new file mode 100644 index 0000000000..04b967a2ee --- /dev/null +++ b/test/fixtures/esprima/es2015-arrow-function/non-arrow-param-followed-by-arrow/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Unexpected token (1:1)" +} \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-arrow-function/non-arrow-param-followed-by-rest/actual.js b/test/fixtures/esprima/es2015-arrow-function/non-arrow-param-followed-by-rest/actual.js new file mode 100644 index 0000000000..df151fb1b2 --- /dev/null +++ b/test/fixtures/esprima/es2015-arrow-function/non-arrow-param-followed-by-rest/actual.js @@ -0,0 +1 @@ +((a),...b) => 0; diff --git a/test/fixtures/esprima/es2015-arrow-function/non-arrow-param-followed-by-rest/options.json b/test/fixtures/esprima/es2015-arrow-function/non-arrow-param-followed-by-rest/options.json new file mode 100644 index 0000000000..04b967a2ee --- /dev/null +++ b/test/fixtures/esprima/es2015-arrow-function/non-arrow-param-followed-by-rest/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Unexpected token (1:1)" +} \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-arrow-function/object-binding-pattern/expected.json b/test/fixtures/esprima/es2015-arrow-function/object-binding-pattern/expected.json new file mode 100644 index 0000000000..10130f3578 --- /dev/null +++ b/test/fixtures/esprima/es2015-arrow-function/object-binding-pattern/expected.json @@ -0,0 +1,32 @@ +{ + "type": "File", + "start": 0, + "end": 0, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 0 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 0, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 0 + } + }, + "sourceType": "script", + "body": [] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-arrow-function/object-binding-pattern/invalid-member-expr.failure.json b/test/fixtures/esprima/es2015-arrow-function/object-binding-pattern/invalid-member-expr.failure.json new file mode 100755 index 0000000000..8245542d3d --- /dev/null +++ b/test/fixtures/esprima/es2015-arrow-function/object-binding-pattern/invalid-member-expr.failure.json @@ -0,0 +1 @@ +{"index":10,"lineNumber":1,"column":11,"message":"Error: Line 1: Unexpected token =>","description":"Unexpected token =>"} \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-arrow-function/object-binding-pattern/invalid-member-expr.js b/test/fixtures/esprima/es2015-arrow-function/object-binding-pattern/invalid-member-expr.js new file mode 100755 index 0000000000..a5f4a07955 --- /dev/null +++ b/test/fixtures/esprima/es2015-arrow-function/object-binding-pattern/invalid-member-expr.js @@ -0,0 +1 @@ +({a:b[0]})=>0 diff --git a/test/fixtures/esprima/es2015-arrow-function/object-binding-pattern/invalid-method-in-pattern.failure.json b/test/fixtures/esprima/es2015-arrow-function/object-binding-pattern/invalid-method-in-pattern.failure.json new file mode 100755 index 0000000000..030f8f3752 --- /dev/null +++ b/test/fixtures/esprima/es2015-arrow-function/object-binding-pattern/invalid-method-in-pattern.failure.json @@ -0,0 +1 @@ +{"index":14,"lineNumber":1,"column":15,"message":"Error: Line 1: Unexpected token =>","description":"Unexpected token =>"} \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-arrow-function/object-binding-pattern/invalid-method-in-pattern.js b/test/fixtures/esprima/es2015-arrow-function/object-binding-pattern/invalid-method-in-pattern.js new file mode 100755 index 0000000000..79ff928dce --- /dev/null +++ b/test/fixtures/esprima/es2015-arrow-function/object-binding-pattern/invalid-method-in-pattern.js @@ -0,0 +1 @@ +({get a(){}}) => 0; diff --git a/test/fixtures/esprima/es2015-arrow-function/object-binding-pattern/invalid-nested-param.failure.json b/test/fixtures/esprima/es2015-arrow-function/object-binding-pattern/invalid-nested-param.failure.json new file mode 100755 index 0000000000..08ba5aca74 --- /dev/null +++ b/test/fixtures/esprima/es2015-arrow-function/object-binding-pattern/invalid-nested-param.failure.json @@ -0,0 +1 @@ +{"index":50,"lineNumber":1,"column":51,"message":"Error: Line 1: Unexpected token =>","description":"Unexpected token =>"} \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-arrow-function/object-binding-pattern/invalid-nested-param.js b/test/fixtures/esprima/es2015-arrow-function/object-binding-pattern/invalid-nested-param.js new file mode 100755 index 0000000000..a0f03b9660 --- /dev/null +++ b/test/fixtures/esprima/es2015-arrow-function/object-binding-pattern/invalid-nested-param.js @@ -0,0 +1 @@ +([[[[[[[[[[[[[[[[[[[[{a:b[0]}]]]]]]]]]]]]]]]]]]]])=>0; diff --git a/test/fixtures/esprima/es2015-arrow-function/object-binding-pattern/invalid-pattern-without-parenthesis.failure.json b/test/fixtures/esprima/es2015-arrow-function/object-binding-pattern/invalid-pattern-without-parenthesis.failure.json new file mode 100755 index 0000000000..b0c1b45f77 --- /dev/null +++ b/test/fixtures/esprima/es2015-arrow-function/object-binding-pattern/invalid-pattern-without-parenthesis.failure.json @@ -0,0 +1 @@ +{"index":3,"lineNumber":1,"column":4,"message":"Error: Line 1: Unexpected token =>","description":"Unexpected token =>"} \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-arrow-function/object-binding-pattern/invalid-pattern-without-parenthesis.js b/test/fixtures/esprima/es2015-arrow-function/object-binding-pattern/invalid-pattern-without-parenthesis.js new file mode 100755 index 0000000000..76fa79dbcd --- /dev/null +++ b/test/fixtures/esprima/es2015-arrow-function/object-binding-pattern/invalid-pattern-without-parenthesis.js @@ -0,0 +1 @@ +({}=>0) diff --git a/test/fixtures/esprima/es2015-arrow-function/object-binding-pattern/invalid-rest-in-object-pattern.failure.json b/test/fixtures/esprima/es2015-arrow-function/object-binding-pattern/invalid-rest-in-object-pattern.failure.json new file mode 100755 index 0000000000..6551a47579 --- /dev/null +++ b/test/fixtures/esprima/es2015-arrow-function/object-binding-pattern/invalid-rest-in-object-pattern.failure.json @@ -0,0 +1 @@ +{"index":4,"lineNumber":1,"column":5,"message":"Error: Line 1: Unexpected token ...","description":"Unexpected token ..."} \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-arrow-function/object-binding-pattern/invalid-rest-in-object-pattern.js b/test/fixtures/esprima/es2015-arrow-function/object-binding-pattern/invalid-rest-in-object-pattern.js new file mode 100755 index 0000000000..77352f8f88 --- /dev/null +++ b/test/fixtures/esprima/es2015-arrow-function/object-binding-pattern/invalid-rest-in-object-pattern.js @@ -0,0 +1 @@ +({a,...b}) => 0; diff --git a/test/fixtures/esprima/es2015-arrow-function/object-binding-pattern/nested-cover-grammar.js b/test/fixtures/esprima/es2015-arrow-function/object-binding-pattern/nested-cover-grammar.js new file mode 100755 index 0000000000..3481b6ca91 --- /dev/null +++ b/test/fixtures/esprima/es2015-arrow-function/object-binding-pattern/nested-cover-grammar.js @@ -0,0 +1 @@ +([[[[[[[[[[[[[[[[[[[[{a=b}]]]]]]]]]]]]]]]]]]]])=>0; diff --git a/test/fixtures/esprima/es2015-arrow-function/object-binding-pattern/object-binding-pattern-01.js b/test/fixtures/esprima/es2015-arrow-function/object-binding-pattern/object-binding-pattern-01.js new file mode 100755 index 0000000000..c50a2a757b --- /dev/null +++ b/test/fixtures/esprima/es2015-arrow-function/object-binding-pattern/object-binding-pattern-01.js @@ -0,0 +1 @@ +({a,b=b,a:c,[a]:[d]})=>0; diff --git a/test/fixtures/esprima/es2015-arrow-function/object-binding-pattern/object-binding-pattern-empty.js b/test/fixtures/esprima/es2015-arrow-function/object-binding-pattern/object-binding-pattern-empty.js new file mode 100755 index 0000000000..acfe22488e --- /dev/null +++ b/test/fixtures/esprima/es2015-arrow-function/object-binding-pattern/object-binding-pattern-empty.js @@ -0,0 +1 @@ +({})=>0; diff --git a/test/fixtures/esprima/es2015-arrow-function/param-with-rest-without-arrow/actual.js b/test/fixtures/esprima/es2015-arrow-function/param-with-rest-without-arrow/actual.js new file mode 100644 index 0000000000..65116d42d4 --- /dev/null +++ b/test/fixtures/esprima/es2015-arrow-function/param-with-rest-without-arrow/actual.js @@ -0,0 +1 @@ +(b, ...a) + 1 diff --git a/test/fixtures/esprima/es2015-arrow-function/param-with-rest-without-arrow/options.json b/test/fixtures/esprima/es2015-arrow-function/param-with-rest-without-arrow/options.json new file mode 100644 index 0000000000..9f7910a413 --- /dev/null +++ b/test/fixtures/esprima/es2015-arrow-function/param-with-rest-without-arrow/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Unexpected token (1:4)" +} \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-arrow-function/rest-without-arrow/actual.js b/test/fixtures/esprima/es2015-arrow-function/rest-without-arrow/actual.js new file mode 100644 index 0000000000..13d242d02f --- /dev/null +++ b/test/fixtures/esprima/es2015-arrow-function/rest-without-arrow/actual.js @@ -0,0 +1 @@ +(...a) + 1 diff --git a/test/fixtures/esprima/es2015-arrow-function/rest-without-arrow/options.json b/test/fixtures/esprima/es2015-arrow-function/rest-without-arrow/options.json new file mode 100644 index 0000000000..04b967a2ee --- /dev/null +++ b/test/fixtures/esprima/es2015-arrow-function/rest-without-arrow/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Unexpected token (1:1)" +} \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-binary-integer-literal/migrated_0000/actual.js b/test/fixtures/esprima/es2015-binary-integer-literal/migrated_0000/actual.js new file mode 100644 index 0000000000..315efbae83 --- /dev/null +++ b/test/fixtures/esprima/es2015-binary-integer-literal/migrated_0000/actual.js @@ -0,0 +1 @@ +0b0 diff --git a/test/fixtures/esprima/es2015-binary-integer-literal/migrated_0000/expected.json b/test/fixtures/esprima/es2015-binary-integer-literal/migrated_0000/expected.json new file mode 100644 index 0000000000..d75e50e145 --- /dev/null +++ b/test/fixtures/esprima/es2015-binary-integer-literal/migrated_0000/expected.json @@ -0,0 +1,66 @@ +{ + "type": "File", + "start": 0, + "end": 3, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 3 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 3, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 3 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 3, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 3 + } + }, + "expression": { + "type": "Literal", + "start": 0, + "end": 3, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 3 + } + }, + "value": 0, + "rawValue": 0, + "raw": "0b0" + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-binary-integer-literal/migrated_0001/actual.js b/test/fixtures/esprima/es2015-binary-integer-literal/migrated_0001/actual.js new file mode 100644 index 0000000000..d24eb0100a --- /dev/null +++ b/test/fixtures/esprima/es2015-binary-integer-literal/migrated_0001/actual.js @@ -0,0 +1 @@ +0b1 diff --git a/test/fixtures/esprima/es2015-binary-integer-literal/migrated_0001/expected.json b/test/fixtures/esprima/es2015-binary-integer-literal/migrated_0001/expected.json new file mode 100644 index 0000000000..87c4066eaf --- /dev/null +++ b/test/fixtures/esprima/es2015-binary-integer-literal/migrated_0001/expected.json @@ -0,0 +1,66 @@ +{ + "type": "File", + "start": 0, + "end": 3, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 3 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 3, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 3 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 3, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 3 + } + }, + "expression": { + "type": "Literal", + "start": 0, + "end": 3, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 3 + } + }, + "value": 1, + "rawValue": 1, + "raw": "0b1" + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-binary-integer-literal/migrated_0002/actual.js b/test/fixtures/esprima/es2015-binary-integer-literal/migrated_0002/actual.js new file mode 100644 index 0000000000..34eafb9e6d --- /dev/null +++ b/test/fixtures/esprima/es2015-binary-integer-literal/migrated_0002/actual.js @@ -0,0 +1 @@ +0b10 diff --git a/test/fixtures/esprima/es2015-binary-integer-literal/migrated_0002/expected.json b/test/fixtures/esprima/es2015-binary-integer-literal/migrated_0002/expected.json new file mode 100644 index 0000000000..15344e54fd --- /dev/null +++ b/test/fixtures/esprima/es2015-binary-integer-literal/migrated_0002/expected.json @@ -0,0 +1,66 @@ +{ + "type": "File", + "start": 0, + "end": 4, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 4 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 4, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 4 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 4, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 4 + } + }, + "expression": { + "type": "Literal", + "start": 0, + "end": 4, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 4 + } + }, + "value": 2, + "rawValue": 2, + "raw": "0b10" + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-binary-integer-literal/migrated_0003/actual.js b/test/fixtures/esprima/es2015-binary-integer-literal/migrated_0003/actual.js new file mode 100644 index 0000000000..1afe400c83 --- /dev/null +++ b/test/fixtures/esprima/es2015-binary-integer-literal/migrated_0003/actual.js @@ -0,0 +1 @@ +0B0 diff --git a/test/fixtures/esprima/es2015-binary-integer-literal/migrated_0003/expected.json b/test/fixtures/esprima/es2015-binary-integer-literal/migrated_0003/expected.json new file mode 100644 index 0000000000..25eeb9786f --- /dev/null +++ b/test/fixtures/esprima/es2015-binary-integer-literal/migrated_0003/expected.json @@ -0,0 +1,66 @@ +{ + "type": "File", + "start": 0, + "end": 3, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 3 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 3, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 3 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 3, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 3 + } + }, + "expression": { + "type": "Literal", + "start": 0, + "end": 3, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 3 + } + }, + "value": 0, + "rawValue": 0, + "raw": "0B0" + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-binary-integer-literal/migrated_0004/actual.js b/test/fixtures/esprima/es2015-binary-integer-literal/migrated_0004/actual.js new file mode 100644 index 0000000000..f75498de50 --- /dev/null +++ b/test/fixtures/esprima/es2015-binary-integer-literal/migrated_0004/actual.js @@ -0,0 +1 @@ +0B1 diff --git a/test/fixtures/esprima/es2015-binary-integer-literal/migrated_0004/expected.json b/test/fixtures/esprima/es2015-binary-integer-literal/migrated_0004/expected.json new file mode 100644 index 0000000000..d42f8407c2 --- /dev/null +++ b/test/fixtures/esprima/es2015-binary-integer-literal/migrated_0004/expected.json @@ -0,0 +1,66 @@ +{ + "type": "File", + "start": 0, + "end": 3, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 3 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 3, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 3 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 3, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 3 + } + }, + "expression": { + "type": "Literal", + "start": 0, + "end": 3, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 3 + } + }, + "value": 1, + "rawValue": 1, + "raw": "0B1" + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-binary-integer-literal/migrated_0005/actual.js b/test/fixtures/esprima/es2015-binary-integer-literal/migrated_0005/actual.js new file mode 100644 index 0000000000..3847e5c0d8 --- /dev/null +++ b/test/fixtures/esprima/es2015-binary-integer-literal/migrated_0005/actual.js @@ -0,0 +1 @@ +0B10 diff --git a/test/fixtures/esprima/es2015-binary-integer-literal/migrated_0005/expected.json b/test/fixtures/esprima/es2015-binary-integer-literal/migrated_0005/expected.json new file mode 100644 index 0000000000..6f8f49f4e1 --- /dev/null +++ b/test/fixtures/esprima/es2015-binary-integer-literal/migrated_0005/expected.json @@ -0,0 +1,66 @@ +{ + "type": "File", + "start": 0, + "end": 4, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 4 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 4, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 4 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 4, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 4 + } + }, + "expression": { + "type": "Literal", + "start": 0, + "end": 4, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 4 + } + }, + "value": 2, + "rawValue": 2, + "raw": "0B10" + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-class/migrated_0000/actual.js b/test/fixtures/esprima/es2015-class/migrated_0000/actual.js new file mode 100644 index 0000000000..a869c28495 --- /dev/null +++ b/test/fixtures/esprima/es2015-class/migrated_0000/actual.js @@ -0,0 +1 @@ +class A {} diff --git a/test/fixtures/esprima/es2015-class/migrated_0000/expected.json b/test/fixtures/esprima/es2015-class/migrated_0000/expected.json new file mode 100644 index 0000000000..9be73d0dda --- /dev/null +++ b/test/fixtures/esprima/es2015-class/migrated_0000/expected.json @@ -0,0 +1,81 @@ +{ + "type": "File", + "start": 0, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ClassDeclaration", + "start": 0, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "id": { + "type": "Identifier", + "start": 6, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "name": "A" + }, + "superClass": null, + "body": { + "type": "ClassBody", + "start": 8, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "body": [] + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-class/migrated_0001/actual.js b/test/fixtures/esprima/es2015-class/migrated_0001/actual.js new file mode 100644 index 0000000000..b8a3671ec0 --- /dev/null +++ b/test/fixtures/esprima/es2015-class/migrated_0001/actual.js @@ -0,0 +1 @@ +class A extends 0 {} diff --git a/test/fixtures/esprima/es2015-class/migrated_0001/expected.json b/test/fixtures/esprima/es2015-class/migrated_0001/expected.json new file mode 100644 index 0000000000..99cd27794e --- /dev/null +++ b/test/fixtures/esprima/es2015-class/migrated_0001/expected.json @@ -0,0 +1,98 @@ +{ + "type": "File", + "start": 0, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ClassDeclaration", + "start": 0, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "id": { + "type": "Identifier", + "start": 6, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "name": "A" + }, + "superClass": { + "type": "Literal", + "start": 16, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 16 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "value": 0, + "rawValue": 0, + "raw": "0" + }, + "body": { + "type": "ClassBody", + "start": 18, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 18 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "body": [] + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-class/migrated_0002/actual.js b/test/fixtures/esprima/es2015-class/migrated_0002/actual.js new file mode 100644 index 0000000000..38a97a0b1c --- /dev/null +++ b/test/fixtures/esprima/es2015-class/migrated_0002/actual.js @@ -0,0 +1 @@ +class A {;} diff --git a/test/fixtures/esprima/es2015-class/migrated_0002/expected.json b/test/fixtures/esprima/es2015-class/migrated_0002/expected.json new file mode 100644 index 0000000000..13ae4c94f1 --- /dev/null +++ b/test/fixtures/esprima/es2015-class/migrated_0002/expected.json @@ -0,0 +1,81 @@ +{ + "type": "File", + "start": 0, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ClassDeclaration", + "start": 0, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "id": { + "type": "Identifier", + "start": 6, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "name": "A" + }, + "superClass": null, + "body": { + "type": "ClassBody", + "start": 8, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "body": [] + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-class/migrated_0003/actual.js b/test/fixtures/esprima/es2015-class/migrated_0003/actual.js new file mode 100644 index 0000000000..3528a381c3 --- /dev/null +++ b/test/fixtures/esprima/es2015-class/migrated_0003/actual.js @@ -0,0 +1 @@ +class A {;;} diff --git a/test/fixtures/esprima/es2015-class/migrated_0003/expected.json b/test/fixtures/esprima/es2015-class/migrated_0003/expected.json new file mode 100644 index 0000000000..dbd2563e9f --- /dev/null +++ b/test/fixtures/esprima/es2015-class/migrated_0003/expected.json @@ -0,0 +1,81 @@ +{ + "type": "File", + "start": 0, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ClassDeclaration", + "start": 0, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "id": { + "type": "Identifier", + "start": 6, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "name": "A" + }, + "superClass": null, + "body": { + "type": "ClassBody", + "start": 8, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "body": [] + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-class/migrated_0004/actual.js b/test/fixtures/esprima/es2015-class/migrated_0004/actual.js new file mode 100644 index 0000000000..6c12735490 --- /dev/null +++ b/test/fixtures/esprima/es2015-class/migrated_0004/actual.js @@ -0,0 +1 @@ +class A {a(){}} diff --git a/test/fixtures/esprima/es2015-class/migrated_0004/expected.json b/test/fixtures/esprima/es2015-class/migrated_0004/expected.json new file mode 100644 index 0000000000..e60d7294c3 --- /dev/null +++ b/test/fixtures/esprima/es2015-class/migrated_0004/expected.json @@ -0,0 +1,151 @@ +{ + "type": "File", + "start": 0, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ClassDeclaration", + "start": 0, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "id": { + "type": "Identifier", + "start": 6, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "name": "A" + }, + "superClass": null, + "body": { + "type": "ClassBody", + "start": 8, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "body": [ + { + "type": "MethodDefinition", + "start": 9, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "computed": false, + "key": { + "type": "Identifier", + "start": 9, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "name": "a" + }, + "static": false, + "kind": "method", + "value": { + "type": "FunctionExpression", + "start": 10, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "id": null, + "generator": false, + "expression": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 12, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 12 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "body": [] + } + } + } + ] + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-class/migrated_0005/actual.js b/test/fixtures/esprima/es2015-class/migrated_0005/actual.js new file mode 100644 index 0000000000..225d0cc10d --- /dev/null +++ b/test/fixtures/esprima/es2015-class/migrated_0005/actual.js @@ -0,0 +1 @@ +class A {a(){}b(){}} diff --git a/test/fixtures/esprima/es2015-class/migrated_0005/expected.json b/test/fixtures/esprima/es2015-class/migrated_0005/expected.json new file mode 100644 index 0000000000..4ead53f755 --- /dev/null +++ b/test/fixtures/esprima/es2015-class/migrated_0005/expected.json @@ -0,0 +1,220 @@ +{ + "type": "File", + "start": 0, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ClassDeclaration", + "start": 0, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "id": { + "type": "Identifier", + "start": 6, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "name": "A" + }, + "superClass": null, + "body": { + "type": "ClassBody", + "start": 8, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "body": [ + { + "type": "MethodDefinition", + "start": 9, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "computed": false, + "key": { + "type": "Identifier", + "start": 9, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "name": "a" + }, + "static": false, + "kind": "method", + "value": { + "type": "FunctionExpression", + "start": 10, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "id": null, + "generator": false, + "expression": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 12, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 12 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "body": [] + } + } + }, + { + "type": "MethodDefinition", + "start": 14, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 14 + }, + "end": { + "line": 1, + "column": 19 + } + }, + "computed": false, + "key": { + "type": "Identifier", + "start": 14, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 14 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "name": "b" + }, + "static": false, + "kind": "method", + "value": { + "type": "FunctionExpression", + "start": 15, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 19 + } + }, + "id": null, + "generator": false, + "expression": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 17, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 17 + }, + "end": { + "line": 1, + "column": 19 + } + }, + "body": [] + } + } + } + ] + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-class/migrated_0006/actual.js b/test/fixtures/esprima/es2015-class/migrated_0006/actual.js new file mode 100644 index 0000000000..c71d0c48b4 --- /dev/null +++ b/test/fixtures/esprima/es2015-class/migrated_0006/actual.js @@ -0,0 +1 @@ +class A {a(){};b(){}} diff --git a/test/fixtures/esprima/es2015-class/migrated_0006/expected.json b/test/fixtures/esprima/es2015-class/migrated_0006/expected.json new file mode 100644 index 0000000000..a4bb492dbb --- /dev/null +++ b/test/fixtures/esprima/es2015-class/migrated_0006/expected.json @@ -0,0 +1,220 @@ +{ + "type": "File", + "start": 0, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 21 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 21 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ClassDeclaration", + "start": 0, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 21 + } + }, + "id": { + "type": "Identifier", + "start": 6, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "name": "A" + }, + "superClass": null, + "body": { + "type": "ClassBody", + "start": 8, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 21 + } + }, + "body": [ + { + "type": "MethodDefinition", + "start": 9, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "computed": false, + "key": { + "type": "Identifier", + "start": 9, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "name": "a" + }, + "static": false, + "kind": "method", + "value": { + "type": "FunctionExpression", + "start": 10, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "id": null, + "generator": false, + "expression": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 12, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 12 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "body": [] + } + } + }, + { + "type": "MethodDefinition", + "start": 15, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "computed": false, + "key": { + "type": "Identifier", + "start": 15, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "name": "b" + }, + "static": false, + "kind": "method", + "value": { + "type": "FunctionExpression", + "start": 16, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 16 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "id": null, + "generator": false, + "expression": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 18, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 18 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "body": [] + } + } + } + ] + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-class/migrated_0007/actual.js b/test/fixtures/esprima/es2015-class/migrated_0007/actual.js new file mode 100644 index 0000000000..28359eb659 --- /dev/null +++ b/test/fixtures/esprima/es2015-class/migrated_0007/actual.js @@ -0,0 +1 @@ +class A {a(){};b(){};} diff --git a/test/fixtures/esprima/es2015-class/migrated_0007/expected.json b/test/fixtures/esprima/es2015-class/migrated_0007/expected.json new file mode 100644 index 0000000000..77aa858ee4 --- /dev/null +++ b/test/fixtures/esprima/es2015-class/migrated_0007/expected.json @@ -0,0 +1,220 @@ +{ + "type": "File", + "start": 0, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ClassDeclaration", + "start": 0, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "id": { + "type": "Identifier", + "start": 6, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "name": "A" + }, + "superClass": null, + "body": { + "type": "ClassBody", + "start": 8, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "body": [ + { + "type": "MethodDefinition", + "start": 9, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "computed": false, + "key": { + "type": "Identifier", + "start": 9, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "name": "a" + }, + "static": false, + "kind": "method", + "value": { + "type": "FunctionExpression", + "start": 10, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "id": null, + "generator": false, + "expression": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 12, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 12 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "body": [] + } + } + }, + { + "type": "MethodDefinition", + "start": 15, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "computed": false, + "key": { + "type": "Identifier", + "start": 15, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "name": "b" + }, + "static": false, + "kind": "method", + "value": { + "type": "FunctionExpression", + "start": 16, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 16 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "id": null, + "generator": false, + "expression": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 18, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 18 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "body": [] + } + } + } + ] + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-class/migrated_0008/actual.js b/test/fixtures/esprima/es2015-class/migrated_0008/actual.js new file mode 100644 index 0000000000..21c95927e5 --- /dev/null +++ b/test/fixtures/esprima/es2015-class/migrated_0008/actual.js @@ -0,0 +1 @@ +class A {;a(){};b(){};} diff --git a/test/fixtures/esprima/es2015-class/migrated_0008/expected.json b/test/fixtures/esprima/es2015-class/migrated_0008/expected.json new file mode 100644 index 0000000000..f0da7ec99b --- /dev/null +++ b/test/fixtures/esprima/es2015-class/migrated_0008/expected.json @@ -0,0 +1,220 @@ +{ + "type": "File", + "start": 0, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ClassDeclaration", + "start": 0, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "id": { + "type": "Identifier", + "start": 6, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "name": "A" + }, + "superClass": null, + "body": { + "type": "ClassBody", + "start": 8, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "body": [ + { + "type": "MethodDefinition", + "start": 10, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "computed": false, + "key": { + "type": "Identifier", + "start": 10, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "name": "a" + }, + "static": false, + "kind": "method", + "value": { + "type": "FunctionExpression", + "start": 11, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 11 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "id": null, + "generator": false, + "expression": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 13, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "body": [] + } + } + }, + { + "type": "MethodDefinition", + "start": 16, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 16 + }, + "end": { + "line": 1, + "column": 21 + } + }, + "computed": false, + "key": { + "type": "Identifier", + "start": 16, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 16 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "name": "b" + }, + "static": false, + "kind": "method", + "value": { + "type": "FunctionExpression", + "start": 17, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 17 + }, + "end": { + "line": 1, + "column": 21 + } + }, + "id": null, + "generator": false, + "expression": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 19, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 19 + }, + "end": { + "line": 1, + "column": 21 + } + }, + "body": [] + } + } + } + ] + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-class/migrated_0009/actual.js b/test/fixtures/esprima/es2015-class/migrated_0009/actual.js new file mode 100644 index 0000000000..37ee444b36 --- /dev/null +++ b/test/fixtures/esprima/es2015-class/migrated_0009/actual.js @@ -0,0 +1 @@ +class A {static(){};} diff --git a/test/fixtures/esprima/es2015-class/migrated_0009/expected.json b/test/fixtures/esprima/es2015-class/migrated_0009/expected.json new file mode 100644 index 0000000000..0cd6f1a23f --- /dev/null +++ b/test/fixtures/esprima/es2015-class/migrated_0009/expected.json @@ -0,0 +1,151 @@ +{ + "type": "File", + "start": 0, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 21 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 21 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ClassDeclaration", + "start": 0, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 21 + } + }, + "id": { + "type": "Identifier", + "start": 6, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "name": "A" + }, + "superClass": null, + "body": { + "type": "ClassBody", + "start": 8, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 21 + } + }, + "body": [ + { + "type": "MethodDefinition", + "start": 9, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 19 + } + }, + "computed": false, + "key": { + "type": "Identifier", + "start": 9, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "name": "static" + }, + "static": false, + "kind": "method", + "value": { + "type": "FunctionExpression", + "start": 15, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 19 + } + }, + "id": null, + "generator": false, + "expression": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 17, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 17 + }, + "end": { + "line": 1, + "column": 19 + } + }, + "body": [] + } + } + } + ] + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-class/migrated_0010/actual.js b/test/fixtures/esprima/es2015-class/migrated_0010/actual.js new file mode 100644 index 0000000000..3522e47d56 --- /dev/null +++ b/test/fixtures/esprima/es2015-class/migrated_0010/actual.js @@ -0,0 +1 @@ +class A {get a(){} set b(c){};} diff --git a/test/fixtures/esprima/es2015-class/migrated_0010/expected.json b/test/fixtures/esprima/es2015-class/migrated_0010/expected.json new file mode 100644 index 0000000000..b2101dd75c --- /dev/null +++ b/test/fixtures/esprima/es2015-class/migrated_0010/expected.json @@ -0,0 +1,237 @@ +{ + "type": "File", + "start": 0, + "end": 31, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 31 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 31, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 31 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ClassDeclaration", + "start": 0, + "end": 31, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 31 + } + }, + "id": { + "type": "Identifier", + "start": 6, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "name": "A" + }, + "superClass": null, + "body": { + "type": "ClassBody", + "start": 8, + "end": 31, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 31 + } + }, + "body": [ + { + "type": "MethodDefinition", + "start": 9, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "computed": false, + "key": { + "type": "Identifier", + "start": 13, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "name": "a" + }, + "static": false, + "kind": "get", + "value": { + "type": "FunctionExpression", + "start": 14, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 14 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "id": null, + "generator": false, + "expression": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 16, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 16 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "body": [] + } + } + }, + { + "type": "MethodDefinition", + "start": 19, + "end": 29, + "loc": { + "start": { + "line": 1, + "column": 19 + }, + "end": { + "line": 1, + "column": 29 + } + }, + "computed": false, + "key": { + "type": "Identifier", + "start": 23, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 23 + }, + "end": { + "line": 1, + "column": 24 + } + }, + "name": "b" + }, + "static": false, + "kind": "set", + "value": { + "type": "FunctionExpression", + "start": 24, + "end": 29, + "loc": { + "start": { + "line": 1, + "column": 24 + }, + "end": { + "line": 1, + "column": 29 + } + }, + "id": null, + "generator": false, + "expression": false, + "params": [ + { + "type": "Identifier", + "start": 25, + "end": 26, + "loc": { + "start": { + "line": 1, + "column": 25 + }, + "end": { + "line": 1, + "column": 26 + } + }, + "name": "c" + } + ], + "body": { + "type": "BlockStatement", + "start": 27, + "end": 29, + "loc": { + "start": { + "line": 1, + "column": 27 + }, + "end": { + "line": 1, + "column": 29 + } + }, + "body": [] + } + } + } + ] + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-class/migrated_0011/actual.js b/test/fixtures/esprima/es2015-class/migrated_0011/actual.js new file mode 100644 index 0000000000..d51a855c19 --- /dev/null +++ b/test/fixtures/esprima/es2015-class/migrated_0011/actual.js @@ -0,0 +1 @@ +class A {static a(){} static get a(){} static set a(b){} } diff --git a/test/fixtures/esprima/es2015-class/migrated_0011/expected.json b/test/fixtures/esprima/es2015-class/migrated_0011/expected.json new file mode 100644 index 0000000000..1c0665ae72 --- /dev/null +++ b/test/fixtures/esprima/es2015-class/migrated_0011/expected.json @@ -0,0 +1,306 @@ +{ + "type": "File", + "start": 0, + "end": 58, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 58 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 58, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 58 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ClassDeclaration", + "start": 0, + "end": 58, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 58 + } + }, + "id": { + "type": "Identifier", + "start": 6, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "name": "A" + }, + "superClass": null, + "body": { + "type": "ClassBody", + "start": 8, + "end": 58, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 58 + } + }, + "body": [ + { + "type": "MethodDefinition", + "start": 9, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 21 + } + }, + "computed": false, + "key": { + "type": "Identifier", + "start": 16, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 16 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "name": "a" + }, + "static": true, + "kind": "method", + "value": { + "type": "FunctionExpression", + "start": 17, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 17 + }, + "end": { + "line": 1, + "column": 21 + } + }, + "id": null, + "generator": false, + "expression": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 19, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 19 + }, + "end": { + "line": 1, + "column": 21 + } + }, + "body": [] + } + } + }, + { + "type": "MethodDefinition", + "start": 22, + "end": 38, + "loc": { + "start": { + "line": 1, + "column": 22 + }, + "end": { + "line": 1, + "column": 38 + } + }, + "computed": false, + "key": { + "type": "Identifier", + "start": 33, + "end": 34, + "loc": { + "start": { + "line": 1, + "column": 33 + }, + "end": { + "line": 1, + "column": 34 + } + }, + "name": "a" + }, + "static": true, + "kind": "get", + "value": { + "type": "FunctionExpression", + "start": 34, + "end": 38, + "loc": { + "start": { + "line": 1, + "column": 34 + }, + "end": { + "line": 1, + "column": 38 + } + }, + "id": null, + "generator": false, + "expression": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 36, + "end": 38, + "loc": { + "start": { + "line": 1, + "column": 36 + }, + "end": { + "line": 1, + "column": 38 + } + }, + "body": [] + } + } + }, + { + "type": "MethodDefinition", + "start": 39, + "end": 56, + "loc": { + "start": { + "line": 1, + "column": 39 + }, + "end": { + "line": 1, + "column": 56 + } + }, + "computed": false, + "key": { + "type": "Identifier", + "start": 50, + "end": 51, + "loc": { + "start": { + "line": 1, + "column": 50 + }, + "end": { + "line": 1, + "column": 51 + } + }, + "name": "a" + }, + "static": true, + "kind": "set", + "value": { + "type": "FunctionExpression", + "start": 51, + "end": 56, + "loc": { + "start": { + "line": 1, + "column": 51 + }, + "end": { + "line": 1, + "column": 56 + } + }, + "id": null, + "generator": false, + "expression": false, + "params": [ + { + "type": "Identifier", + "start": 52, + "end": 53, + "loc": { + "start": { + "line": 1, + "column": 52 + }, + "end": { + "line": 1, + "column": 53 + } + }, + "name": "b" + } + ], + "body": { + "type": "BlockStatement", + "start": 54, + "end": 56, + "loc": { + "start": { + "line": 1, + "column": 54 + }, + "end": { + "line": 1, + "column": 56 + } + }, + "body": [] + } + } + } + ] + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-class/migrated_0012/actual.js b/test/fixtures/esprima/es2015-class/migrated_0012/actual.js new file mode 100644 index 0000000000..9e05866140 --- /dev/null +++ b/test/fixtures/esprima/es2015-class/migrated_0012/actual.js @@ -0,0 +1 @@ +class A {static a(){};} diff --git a/test/fixtures/esprima/es2015-class/migrated_0012/expected.json b/test/fixtures/esprima/es2015-class/migrated_0012/expected.json new file mode 100644 index 0000000000..b1acc4da5f --- /dev/null +++ b/test/fixtures/esprima/es2015-class/migrated_0012/expected.json @@ -0,0 +1,151 @@ +{ + "type": "File", + "start": 0, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ClassDeclaration", + "start": 0, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "id": { + "type": "Identifier", + "start": 6, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "name": "A" + }, + "superClass": null, + "body": { + "type": "ClassBody", + "start": 8, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "body": [ + { + "type": "MethodDefinition", + "start": 9, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 21 + } + }, + "computed": false, + "key": { + "type": "Identifier", + "start": 16, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 16 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "name": "a" + }, + "static": true, + "kind": "method", + "value": { + "type": "FunctionExpression", + "start": 17, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 17 + }, + "end": { + "line": 1, + "column": 21 + } + }, + "id": null, + "generator": false, + "expression": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 19, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 19 + }, + "end": { + "line": 1, + "column": 21 + } + }, + "body": [] + } + } + } + ] + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-class/migrated_0013/actual.js b/test/fixtures/esprima/es2015-class/migrated_0013/actual.js new file mode 100644 index 0000000000..3655b96640 --- /dev/null +++ b/test/fixtures/esprima/es2015-class/migrated_0013/actual.js @@ -0,0 +1 @@ +class A {static [a](){};} diff --git a/test/fixtures/esprima/es2015-class/migrated_0013/expected.json b/test/fixtures/esprima/es2015-class/migrated_0013/expected.json new file mode 100644 index 0000000000..a366c8ad3f --- /dev/null +++ b/test/fixtures/esprima/es2015-class/migrated_0013/expected.json @@ -0,0 +1,151 @@ +{ + "type": "File", + "start": 0, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 25 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 25 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ClassDeclaration", + "start": 0, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 25 + } + }, + "id": { + "type": "Identifier", + "start": 6, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "name": "A" + }, + "superClass": null, + "body": { + "type": "ClassBody", + "start": 8, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 25 + } + }, + "body": [ + { + "type": "MethodDefinition", + "start": 9, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "computed": true, + "key": { + "type": "Identifier", + "start": 17, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 17 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "name": "a" + }, + "static": true, + "kind": "method", + "value": { + "type": "FunctionExpression", + "start": 19, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 19 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "id": null, + "generator": false, + "expression": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 21, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 21 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "body": [] + } + } + } + ] + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-class/migrated_0014/actual.js b/test/fixtures/esprima/es2015-class/migrated_0014/actual.js new file mode 100644 index 0000000000..d7d015564b --- /dev/null +++ b/test/fixtures/esprima/es2015-class/migrated_0014/actual.js @@ -0,0 +1 @@ +class A {static[a](){}; static[b](){}} diff --git a/test/fixtures/esprima/es2015-class/migrated_0014/expected.json b/test/fixtures/esprima/es2015-class/migrated_0014/expected.json new file mode 100644 index 0000000000..b9887ebdf9 --- /dev/null +++ b/test/fixtures/esprima/es2015-class/migrated_0014/expected.json @@ -0,0 +1,220 @@ +{ + "type": "File", + "start": 0, + "end": 38, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 38 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 38, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 38 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ClassDeclaration", + "start": 0, + "end": 38, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 38 + } + }, + "id": { + "type": "Identifier", + "start": 6, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "name": "A" + }, + "superClass": null, + "body": { + "type": "ClassBody", + "start": 8, + "end": 38, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 38 + } + }, + "body": [ + { + "type": "MethodDefinition", + "start": 9, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "computed": true, + "key": { + "type": "Identifier", + "start": 16, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 16 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "name": "a" + }, + "static": true, + "kind": "method", + "value": { + "type": "FunctionExpression", + "start": 18, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 18 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "id": null, + "generator": false, + "expression": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 20, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 20 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "body": [] + } + } + }, + { + "type": "MethodDefinition", + "start": 24, + "end": 37, + "loc": { + "start": { + "line": 1, + "column": 24 + }, + "end": { + "line": 1, + "column": 37 + } + }, + "computed": true, + "key": { + "type": "Identifier", + "start": 31, + "end": 32, + "loc": { + "start": { + "line": 1, + "column": 31 + }, + "end": { + "line": 1, + "column": 32 + } + }, + "name": "b" + }, + "static": true, + "kind": "method", + "value": { + "type": "FunctionExpression", + "start": 33, + "end": 37, + "loc": { + "start": { + "line": 1, + "column": 33 + }, + "end": { + "line": 1, + "column": 37 + } + }, + "id": null, + "generator": false, + "expression": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 35, + "end": 37, + "loc": { + "start": { + "line": 1, + "column": 35 + }, + "end": { + "line": 1, + "column": 37 + } + }, + "body": [] + } + } + } + ] + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-class/migrated_0015/actual.js b/test/fixtures/esprima/es2015-class/migrated_0015/actual.js new file mode 100644 index 0000000000..ef28cd29d4 --- /dev/null +++ b/test/fixtures/esprima/es2015-class/migrated_0015/actual.js @@ -0,0 +1 @@ +class A {static static(){};} diff --git a/test/fixtures/esprima/es2015-class/migrated_0015/expected.json b/test/fixtures/esprima/es2015-class/migrated_0015/expected.json new file mode 100644 index 0000000000..7e151a458e --- /dev/null +++ b/test/fixtures/esprima/es2015-class/migrated_0015/expected.json @@ -0,0 +1,151 @@ +{ + "type": "File", + "start": 0, + "end": 28, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 28 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 28, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 28 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ClassDeclaration", + "start": 0, + "end": 28, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 28 + } + }, + "id": { + "type": "Identifier", + "start": 6, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "name": "A" + }, + "superClass": null, + "body": { + "type": "ClassBody", + "start": 8, + "end": 28, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 28 + } + }, + "body": [ + { + "type": "MethodDefinition", + "start": 9, + "end": 26, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 26 + } + }, + "computed": false, + "key": { + "type": "Identifier", + "start": 16, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 16 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "name": "static" + }, + "static": true, + "kind": "method", + "value": { + "type": "FunctionExpression", + "start": 22, + "end": 26, + "loc": { + "start": { + "line": 1, + "column": 22 + }, + "end": { + "line": 1, + "column": 26 + } + }, + "id": null, + "generator": false, + "expression": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 24, + "end": 26, + "loc": { + "start": { + "line": 1, + "column": 24 + }, + "end": { + "line": 1, + "column": 26 + } + }, + "body": [] + } + } + } + ] + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-class/migrated_0016/actual.js b/test/fixtures/esprima/es2015-class/migrated_0016/actual.js new file mode 100644 index 0000000000..9e20af5ce5 --- /dev/null +++ b/test/fixtures/esprima/es2015-class/migrated_0016/actual.js @@ -0,0 +1 @@ +var x = class A extends 0{} diff --git a/test/fixtures/esprima/es2015-class/migrated_0016/expected.json b/test/fixtures/esprima/es2015-class/migrated_0016/expected.json new file mode 100644 index 0000000000..150f14ca4c --- /dev/null +++ b/test/fixtures/esprima/es2015-class/migrated_0016/expected.json @@ -0,0 +1,147 @@ +{ + "type": "File", + "start": 0, + "end": 27, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 27 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 27, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 27 + } + }, + "sourceType": "script", + "body": [ + { + "type": "VariableDeclaration", + "start": 0, + "end": 27, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 27 + } + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 4, + "end": 27, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 27 + } + }, + "id": { + "type": "Identifier", + "start": 4, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "name": "x" + }, + "init": { + "type": "ClassExpression", + "start": 8, + "end": 27, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 27 + } + }, + "id": { + "type": "Identifier", + "start": 14, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 14 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "name": "A" + }, + "superClass": { + "type": "Literal", + "start": 24, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 24 + }, + "end": { + "line": 1, + "column": 25 + } + }, + "value": 0, + "rawValue": 0, + "raw": "0" + }, + "body": { + "type": "ClassBody", + "start": 25, + "end": 27, + "loc": { + "start": { + "line": 1, + "column": 25 + }, + "end": { + "line": 1, + "column": 27 + } + }, + "body": [] + } + } + } + ], + "kind": "var" + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-class/migrated_0017/actual.js b/test/fixtures/esprima/es2015-class/migrated_0017/actual.js new file mode 100644 index 0000000000..f99ff2f6ae --- /dev/null +++ b/test/fixtures/esprima/es2015-class/migrated_0017/actual.js @@ -0,0 +1 @@ +class A {prototype(){}} diff --git a/test/fixtures/esprima/es2015-class/migrated_0017/expected.json b/test/fixtures/esprima/es2015-class/migrated_0017/expected.json new file mode 100644 index 0000000000..a887878c99 --- /dev/null +++ b/test/fixtures/esprima/es2015-class/migrated_0017/expected.json @@ -0,0 +1,151 @@ +{ + "type": "File", + "start": 0, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ClassDeclaration", + "start": 0, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "id": { + "type": "Identifier", + "start": 6, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "name": "A" + }, + "superClass": null, + "body": { + "type": "ClassBody", + "start": 8, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "body": [ + { + "type": "MethodDefinition", + "start": 9, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "computed": false, + "key": { + "type": "Identifier", + "start": 9, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "name": "prototype" + }, + "static": false, + "kind": "method", + "value": { + "type": "FunctionExpression", + "start": 18, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 18 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "id": null, + "generator": false, + "expression": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 20, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 20 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "body": [] + } + } + } + ] + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-class/migrated_0018/actual.js b/test/fixtures/esprima/es2015-class/migrated_0018/actual.js new file mode 100644 index 0000000000..22b21f85a8 --- /dev/null +++ b/test/fixtures/esprima/es2015-class/migrated_0018/actual.js @@ -0,0 +1 @@ +class A {constructor(){}} diff --git a/test/fixtures/esprima/es2015-class/migrated_0018/expected.json b/test/fixtures/esprima/es2015-class/migrated_0018/expected.json new file mode 100644 index 0000000000..4ce9a1e28c --- /dev/null +++ b/test/fixtures/esprima/es2015-class/migrated_0018/expected.json @@ -0,0 +1,151 @@ +{ + "type": "File", + "start": 0, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 25 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 25 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ClassDeclaration", + "start": 0, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 25 + } + }, + "id": { + "type": "Identifier", + "start": 6, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "name": "A" + }, + "superClass": null, + "body": { + "type": "ClassBody", + "start": 8, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 25 + } + }, + "body": [ + { + "type": "MethodDefinition", + "start": 9, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 24 + } + }, + "computed": false, + "key": { + "type": "Identifier", + "start": 9, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "name": "constructor" + }, + "static": false, + "kind": "constructor", + "value": { + "type": "FunctionExpression", + "start": 20, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 20 + }, + "end": { + "line": 1, + "column": 24 + } + }, + "id": null, + "generator": false, + "expression": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 22, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 22 + }, + "end": { + "line": 1, + "column": 24 + } + }, + "body": [] + } + } + } + ] + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-class/migrated_0019/actual.js b/test/fixtures/esprima/es2015-class/migrated_0019/actual.js new file mode 100644 index 0000000000..4055effa37 --- /dev/null +++ b/test/fixtures/esprima/es2015-class/migrated_0019/actual.js @@ -0,0 +1 @@ +class A {"constructor"(){} ["constructor"](){}} diff --git a/test/fixtures/esprima/es2015-class/migrated_0019/expected.json b/test/fixtures/esprima/es2015-class/migrated_0019/expected.json new file mode 100644 index 0000000000..8b28390427 --- /dev/null +++ b/test/fixtures/esprima/es2015-class/migrated_0019/expected.json @@ -0,0 +1,224 @@ +{ + "type": "File", + "start": 0, + "end": 47, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 47 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 47, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 47 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ClassDeclaration", + "start": 0, + "end": 47, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 47 + } + }, + "id": { + "type": "Identifier", + "start": 6, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "name": "A" + }, + "superClass": null, + "body": { + "type": "ClassBody", + "start": 8, + "end": 47, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 47 + } + }, + "body": [ + { + "type": "MethodDefinition", + "start": 9, + "end": 26, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 26 + } + }, + "computed": false, + "key": { + "type": "Literal", + "start": 9, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "value": "constructor", + "rawValue": "constructor", + "raw": "\"constructor\"" + }, + "static": false, + "kind": "constructor", + "value": { + "type": "FunctionExpression", + "start": 22, + "end": 26, + "loc": { + "start": { + "line": 1, + "column": 22 + }, + "end": { + "line": 1, + "column": 26 + } + }, + "id": null, + "generator": false, + "expression": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 24, + "end": 26, + "loc": { + "start": { + "line": 1, + "column": 24 + }, + "end": { + "line": 1, + "column": 26 + } + }, + "body": [] + } + } + }, + { + "type": "MethodDefinition", + "start": 27, + "end": 46, + "loc": { + "start": { + "line": 1, + "column": 27 + }, + "end": { + "line": 1, + "column": 46 + } + }, + "computed": true, + "key": { + "type": "Literal", + "start": 28, + "end": 41, + "loc": { + "start": { + "line": 1, + "column": 28 + }, + "end": { + "line": 1, + "column": 41 + } + }, + "value": "constructor", + "rawValue": "constructor", + "raw": "\"constructor\"" + }, + "static": false, + "kind": "method", + "value": { + "type": "FunctionExpression", + "start": 42, + "end": 46, + "loc": { + "start": { + "line": 1, + "column": 42 + }, + "end": { + "line": 1, + "column": 46 + } + }, + "id": null, + "generator": false, + "expression": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 44, + "end": 46, + "loc": { + "start": { + "line": 1, + "column": 44 + }, + "end": { + "line": 1, + "column": 46 + } + }, + "body": [] + } + } + } + ] + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-class/migrated_0020/actual.js b/test/fixtures/esprima/es2015-class/migrated_0020/actual.js new file mode 100644 index 0000000000..2a91706210 --- /dev/null +++ b/test/fixtures/esprima/es2015-class/migrated_0020/actual.js @@ -0,0 +1 @@ +class A {static constructor(){} static constructor(){}} diff --git a/test/fixtures/esprima/es2015-class/migrated_0020/expected.json b/test/fixtures/esprima/es2015-class/migrated_0020/expected.json new file mode 100644 index 0000000000..0241df155f --- /dev/null +++ b/test/fixtures/esprima/es2015-class/migrated_0020/expected.json @@ -0,0 +1,220 @@ +{ + "type": "File", + "start": 0, + "end": 55, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 55 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 55, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 55 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ClassDeclaration", + "start": 0, + "end": 55, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 55 + } + }, + "id": { + "type": "Identifier", + "start": 6, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "name": "A" + }, + "superClass": null, + "body": { + "type": "ClassBody", + "start": 8, + "end": 55, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 55 + } + }, + "body": [ + { + "type": "MethodDefinition", + "start": 9, + "end": 31, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 31 + } + }, + "computed": false, + "key": { + "type": "Identifier", + "start": 16, + "end": 27, + "loc": { + "start": { + "line": 1, + "column": 16 + }, + "end": { + "line": 1, + "column": 27 + } + }, + "name": "constructor" + }, + "static": true, + "kind": "method", + "value": { + "type": "FunctionExpression", + "start": 27, + "end": 31, + "loc": { + "start": { + "line": 1, + "column": 27 + }, + "end": { + "line": 1, + "column": 31 + } + }, + "id": null, + "generator": false, + "expression": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 29, + "end": 31, + "loc": { + "start": { + "line": 1, + "column": 29 + }, + "end": { + "line": 1, + "column": 31 + } + }, + "body": [] + } + } + }, + { + "type": "MethodDefinition", + "start": 32, + "end": 54, + "loc": { + "start": { + "line": 1, + "column": 32 + }, + "end": { + "line": 1, + "column": 54 + } + }, + "computed": false, + "key": { + "type": "Identifier", + "start": 39, + "end": 50, + "loc": { + "start": { + "line": 1, + "column": 39 + }, + "end": { + "line": 1, + "column": 50 + } + }, + "name": "constructor" + }, + "static": true, + "kind": "method", + "value": { + "type": "FunctionExpression", + "start": 50, + "end": 54, + "loc": { + "start": { + "line": 1, + "column": 50 + }, + "end": { + "line": 1, + "column": 54 + } + }, + "id": null, + "generator": false, + "expression": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 52, + "end": 54, + "loc": { + "start": { + "line": 1, + "column": 52 + }, + "end": { + "line": 1, + "column": 54 + } + }, + "body": [] + } + } + } + ] + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-class/migrated_0021/actual.js b/test/fixtures/esprima/es2015-class/migrated_0021/actual.js new file mode 100644 index 0000000000..f67a12b369 --- /dev/null +++ b/test/fixtures/esprima/es2015-class/migrated_0021/actual.js @@ -0,0 +1 @@ +class A {static ["prototype"](){}} diff --git a/test/fixtures/esprima/es2015-class/migrated_0021/expected.json b/test/fixtures/esprima/es2015-class/migrated_0021/expected.json new file mode 100644 index 0000000000..0d65fe2441 --- /dev/null +++ b/test/fixtures/esprima/es2015-class/migrated_0021/expected.json @@ -0,0 +1,153 @@ +{ + "type": "File", + "start": 0, + "end": 34, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 34 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 34, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 34 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ClassDeclaration", + "start": 0, + "end": 34, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 34 + } + }, + "id": { + "type": "Identifier", + "start": 6, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "name": "A" + }, + "superClass": null, + "body": { + "type": "ClassBody", + "start": 8, + "end": 34, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 34 + } + }, + "body": [ + { + "type": "MethodDefinition", + "start": 9, + "end": 33, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 33 + } + }, + "computed": true, + "key": { + "type": "Literal", + "start": 17, + "end": 28, + "loc": { + "start": { + "line": 1, + "column": 17 + }, + "end": { + "line": 1, + "column": 28 + } + }, + "value": "prototype", + "rawValue": "prototype", + "raw": "\"prototype\"" + }, + "static": true, + "kind": "method", + "value": { + "type": "FunctionExpression", + "start": 29, + "end": 33, + "loc": { + "start": { + "line": 1, + "column": 29 + }, + "end": { + "line": 1, + "column": 33 + } + }, + "id": null, + "generator": false, + "expression": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 31, + "end": 33, + "loc": { + "start": { + "line": 1, + "column": 31 + }, + "end": { + "line": 1, + "column": 33 + } + }, + "body": [] + } + } + } + ] + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-class/migrated_0022/actual.js b/test/fixtures/esprima/es2015-class/migrated_0022/actual.js new file mode 100644 index 0000000000..cfc53f66a8 --- /dev/null +++ b/test/fixtures/esprima/es2015-class/migrated_0022/actual.js @@ -0,0 +1 @@ +(class {}) diff --git a/test/fixtures/esprima/es2015-class/migrated_0022/expected.json b/test/fixtures/esprima/es2015-class/migrated_0022/expected.json new file mode 100644 index 0000000000..5a08887ae2 --- /dev/null +++ b/test/fixtures/esprima/es2015-class/migrated_0022/expected.json @@ -0,0 +1,82 @@ +{ + "type": "File", + "start": 0, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "expression": { + "type": "ClassExpression", + "start": 1, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "id": null, + "superClass": null, + "body": { + "type": "ClassBody", + "start": 7, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "body": [] + }, + "parenthesizedExpression": true + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-class/migrated_0023/actual.js b/test/fixtures/esprima/es2015-class/migrated_0023/actual.js new file mode 100644 index 0000000000..156703052c --- /dev/null +++ b/test/fixtures/esprima/es2015-class/migrated_0023/actual.js @@ -0,0 +1 @@ +(class A {}) diff --git a/test/fixtures/esprima/es2015-class/migrated_0023/expected.json b/test/fixtures/esprima/es2015-class/migrated_0023/expected.json new file mode 100644 index 0000000000..daf97fa8cc --- /dev/null +++ b/test/fixtures/esprima/es2015-class/migrated_0023/expected.json @@ -0,0 +1,97 @@ +{ + "type": "File", + "start": 0, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "expression": { + "type": "ClassExpression", + "start": 1, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "id": { + "type": "Identifier", + "start": 7, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "name": "A" + }, + "superClass": null, + "body": { + "type": "ClassBody", + "start": 9, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "body": [] + }, + "parenthesizedExpression": true + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-class/migrated_0024/actual.js b/test/fixtures/esprima/es2015-class/migrated_0024/actual.js new file mode 100644 index 0000000000..d4d239c25b --- /dev/null +++ b/test/fixtures/esprima/es2015-class/migrated_0024/actual.js @@ -0,0 +1 @@ +(class extends 0{}) diff --git a/test/fixtures/esprima/es2015-class/migrated_0024/expected.json b/test/fixtures/esprima/es2015-class/migrated_0024/expected.json new file mode 100644 index 0000000000..897b90b1c4 --- /dev/null +++ b/test/fixtures/esprima/es2015-class/migrated_0024/expected.json @@ -0,0 +1,99 @@ +{ + "type": "File", + "start": 0, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 19 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 19 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 19 + } + }, + "expression": { + "type": "ClassExpression", + "start": 1, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "id": null, + "superClass": { + "type": "Literal", + "start": 15, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "value": 0, + "rawValue": 0, + "raw": "0" + }, + "body": { + "type": "ClassBody", + "start": 16, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 16 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "body": [] + }, + "parenthesizedExpression": true + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-class/migrated_0025/actual.js b/test/fixtures/esprima/es2015-class/migrated_0025/actual.js new file mode 100644 index 0000000000..3aad971839 --- /dev/null +++ b/test/fixtures/esprima/es2015-class/migrated_0025/actual.js @@ -0,0 +1 @@ +(class A extends 0{}) diff --git a/test/fixtures/esprima/es2015-class/migrated_0025/expected.json b/test/fixtures/esprima/es2015-class/migrated_0025/expected.json new file mode 100644 index 0000000000..80a74cd675 --- /dev/null +++ b/test/fixtures/esprima/es2015-class/migrated_0025/expected.json @@ -0,0 +1,114 @@ +{ + "type": "File", + "start": 0, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 21 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 21 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 21 + } + }, + "expression": { + "type": "ClassExpression", + "start": 1, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "id": { + "type": "Identifier", + "start": 7, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "name": "A" + }, + "superClass": { + "type": "Literal", + "start": 17, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 17 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "value": 0, + "rawValue": 0, + "raw": "0" + }, + "body": { + "type": "ClassBody", + "start": 18, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 18 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "body": [] + }, + "parenthesizedExpression": true + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-class/migrated_0026/actual.js b/test/fixtures/esprima/es2015-class/migrated_0026/actual.js new file mode 100644 index 0000000000..ecb24de6d9 --- /dev/null +++ b/test/fixtures/esprima/es2015-class/migrated_0026/actual.js @@ -0,0 +1 @@ +class A {a(eval){}} diff --git a/test/fixtures/esprima/es2015-class/migrated_0026/expected.json b/test/fixtures/esprima/es2015-class/migrated_0026/expected.json new file mode 100644 index 0000000000..7354aa5050 --- /dev/null +++ b/test/fixtures/esprima/es2015-class/migrated_0026/expected.json @@ -0,0 +1,168 @@ +{ + "type": "File", + "start": 0, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 19 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 19 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ClassDeclaration", + "start": 0, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 19 + } + }, + "id": { + "type": "Identifier", + "start": 6, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "name": "A" + }, + "superClass": null, + "body": { + "type": "ClassBody", + "start": 8, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 19 + } + }, + "body": [ + { + "type": "MethodDefinition", + "start": 9, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "computed": false, + "key": { + "type": "Identifier", + "start": 9, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "name": "a" + }, + "static": false, + "kind": "method", + "value": { + "type": "FunctionExpression", + "start": 10, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "id": null, + "generator": false, + "expression": false, + "params": [ + { + "type": "Identifier", + "start": 11, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 11 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "name": "eval" + } + ], + "body": { + "type": "BlockStatement", + "start": 16, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 16 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "body": [] + } + } + } + ] + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-default-parameter-value/migrated_0000/actual.js b/test/fixtures/esprima/es2015-default-parameter-value/migrated_0000/actual.js new file mode 100644 index 0000000000..8031dd7db9 --- /dev/null +++ b/test/fixtures/esprima/es2015-default-parameter-value/migrated_0000/actual.js @@ -0,0 +1 @@ +x = function(y = 1) {} diff --git a/test/fixtures/esprima/es2015-default-parameter-value/migrated_0000/expected.json b/test/fixtures/esprima/es2015-default-parameter-value/migrated_0000/expected.json new file mode 100644 index 0000000000..8b22c0b26b --- /dev/null +++ b/test/fixtures/esprima/es2015-default-parameter-value/migrated_0000/expected.json @@ -0,0 +1,165 @@ +{ + "type": "File", + "start": 0, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "expression": { + "type": "AssignmentExpression", + "start": 0, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "operator": "=", + "left": { + "type": "Identifier", + "start": 0, + "end": 1, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + } + }, + "name": "x" + }, + "right": { + "type": "FunctionExpression", + "start": 4, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "id": null, + "generator": false, + "expression": false, + "params": [ + { + "type": "AssignmentPattern", + "start": 13, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "left": { + "type": "Identifier", + "start": 13, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "name": "y" + }, + "right": { + "type": "Literal", + "start": 17, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 17 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "value": 1, + "rawValue": 1, + "raw": "1" + } + } + ], + "body": { + "type": "BlockStatement", + "start": 20, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 20 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "body": [] + } + } + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-default-parameter-value/migrated_0001/actual.js b/test/fixtures/esprima/es2015-default-parameter-value/migrated_0001/actual.js new file mode 100644 index 0000000000..25e4a13a7a --- /dev/null +++ b/test/fixtures/esprima/es2015-default-parameter-value/migrated_0001/actual.js @@ -0,0 +1 @@ +function f(a = 1) {} diff --git a/test/fixtures/esprima/es2015-default-parameter-value/migrated_0001/expected.json b/test/fixtures/esprima/es2015-default-parameter-value/migrated_0001/expected.json new file mode 100644 index 0000000000..8cbbeeddbb --- /dev/null +++ b/test/fixtures/esprima/es2015-default-parameter-value/migrated_0001/expected.json @@ -0,0 +1,133 @@ +{ + "type": "File", + "start": 0, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "sourceType": "script", + "body": [ + { + "type": "FunctionDeclaration", + "start": 0, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "id": { + "type": "Identifier", + "start": 9, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "name": "f" + }, + "generator": false, + "expression": false, + "params": [ + { + "type": "AssignmentPattern", + "start": 11, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 11 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "left": { + "type": "Identifier", + "start": 11, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 11 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "name": "a" + }, + "right": { + "type": "Literal", + "start": 15, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "value": 1, + "rawValue": 1, + "raw": "1" + } + } + ], + "body": { + "type": "BlockStatement", + "start": 18, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 18 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "body": [] + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-default-parameter-value/migrated_0002/actual.js b/test/fixtures/esprima/es2015-default-parameter-value/migrated_0002/actual.js new file mode 100644 index 0000000000..e6afbda892 --- /dev/null +++ b/test/fixtures/esprima/es2015-default-parameter-value/migrated_0002/actual.js @@ -0,0 +1 @@ +x = { f: function(a=1) {} } diff --git a/test/fixtures/esprima/es2015-default-parameter-value/migrated_0002/expected.json b/test/fixtures/esprima/es2015-default-parameter-value/migrated_0002/expected.json new file mode 100644 index 0000000000..4f349927b9 --- /dev/null +++ b/test/fixtures/esprima/es2015-default-parameter-value/migrated_0002/expected.json @@ -0,0 +1,217 @@ +{ + "type": "File", + "start": 0, + "end": 27, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 27 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 27, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 27 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 27, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 27 + } + }, + "expression": { + "type": "AssignmentExpression", + "start": 0, + "end": 27, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 27 + } + }, + "operator": "=", + "left": { + "type": "Identifier", + "start": 0, + "end": 1, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + } + }, + "name": "x" + }, + "right": { + "type": "ObjectExpression", + "start": 4, + "end": 27, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 27 + } + }, + "properties": [ + { + "type": "Property", + "start": 6, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 25 + } + }, + "method": false, + "shorthand": false, + "computed": false, + "key": { + "type": "Identifier", + "start": 6, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "name": "f" + }, + "value": { + "type": "FunctionExpression", + "start": 9, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 25 + } + }, + "id": null, + "generator": false, + "expression": false, + "params": [ + { + "type": "AssignmentPattern", + "start": 18, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 18 + }, + "end": { + "line": 1, + "column": 21 + } + }, + "left": { + "type": "Identifier", + "start": 18, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 18 + }, + "end": { + "line": 1, + "column": 19 + } + }, + "name": "a" + }, + "right": { + "type": "Literal", + "start": 20, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 20 + }, + "end": { + "line": 1, + "column": 21 + } + }, + "value": 1, + "rawValue": 1, + "raw": "1" + } + } + ], + "body": { + "type": "BlockStatement", + "start": 23, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 23 + }, + "end": { + "line": 1, + "column": 25 + } + }, + "body": [] + } + }, + "kind": "init" + } + ] + } + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-destructuring-assignment-array-pattern/dup-assignment/actual.js b/test/fixtures/esprima/es2015-destructuring-assignment-array-pattern/dup-assignment/actual.js new file mode 100644 index 0000000000..32ca5172db --- /dev/null +++ b/test/fixtures/esprima/es2015-destructuring-assignment-array-pattern/dup-assignment/actual.js @@ -0,0 +1 @@ +[a,a,,...a]=0; diff --git a/test/fixtures/esprima/es2015-destructuring-assignment-array-pattern/dup-assignment/expected.json b/test/fixtures/esprima/es2015-destructuring-assignment-array-pattern/dup-assignment/expected.json new file mode 100644 index 0000000000..574f634dc3 --- /dev/null +++ b/test/fixtures/esprima/es2015-destructuring-assignment-array-pattern/dup-assignment/expected.json @@ -0,0 +1,163 @@ +{ + "type": "File", + "start": 0, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "expression": { + "type": "AssignmentExpression", + "start": 0, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "operator": "=", + "left": { + "type": "ArrayPattern", + "start": 0, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "elements": [ + { + "type": "Identifier", + "start": 1, + "end": 2, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 2 + } + }, + "name": "a" + }, + { + "type": "Identifier", + "start": 3, + "end": 4, + "loc": { + "start": { + "line": 1, + "column": 3 + }, + "end": { + "line": 1, + "column": 4 + } + }, + "name": "a" + }, + null, + { + "type": "RestElement", + "start": 6, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "argument": { + "type": "Identifier", + "start": 9, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "name": "a" + } + } + ] + }, + "right": { + "type": "Literal", + "start": 12, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 12 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "value": 0, + "rawValue": 0, + "raw": "0" + } + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-destructuring-assignment-array-pattern/elision/actual.js b/test/fixtures/esprima/es2015-destructuring-assignment-array-pattern/elision/actual.js new file mode 100644 index 0000000000..1819baf74d --- /dev/null +++ b/test/fixtures/esprima/es2015-destructuring-assignment-array-pattern/elision/actual.js @@ -0,0 +1 @@ +[,,]=0 diff --git a/test/fixtures/esprima/es2015-destructuring-assignment-array-pattern/elision/expected.json b/test/fixtures/esprima/es2015-destructuring-assignment-array-pattern/elision/expected.json new file mode 100644 index 0000000000..e56c4d8f57 --- /dev/null +++ b/test/fixtures/esprima/es2015-destructuring-assignment-array-pattern/elision/expected.json @@ -0,0 +1,101 @@ +{ + "type": "File", + "start": 0, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "expression": { + "type": "AssignmentExpression", + "start": 0, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "operator": "=", + "left": { + "type": "ArrayPattern", + "start": 0, + "end": 4, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 4 + } + }, + "elements": [ + null, + null + ] + }, + "right": { + "type": "Literal", + "start": 5, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "value": 0, + "rawValue": 0, + "raw": "0" + } + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-destructuring-assignment-array-pattern/member-expr-in-rest/actual.js b/test/fixtures/esprima/es2015-destructuring-assignment-array-pattern/member-expr-in-rest/actual.js new file mode 100644 index 0000000000..f09a194748 --- /dev/null +++ b/test/fixtures/esprima/es2015-destructuring-assignment-array-pattern/member-expr-in-rest/actual.js @@ -0,0 +1 @@ +[...a[0]] = 0; diff --git a/test/fixtures/esprima/es2015-destructuring-assignment-array-pattern/member-expr-in-rest/expected.json b/test/fixtures/esprima/es2015-destructuring-assignment-array-pattern/member-expr-in-rest/expected.json new file mode 100644 index 0000000000..80579906b4 --- /dev/null +++ b/test/fixtures/esprima/es2015-destructuring-assignment-array-pattern/member-expr-in-rest/expected.json @@ -0,0 +1,164 @@ +{ + "type": "File", + "start": 0, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "expression": { + "type": "AssignmentExpression", + "start": 0, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "operator": "=", + "left": { + "type": "ArrayPattern", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "elements": [ + { + "type": "RestElement", + "start": 1, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "argument": { + "type": "MemberExpression", + "start": 4, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "object": { + "type": "Identifier", + "start": 4, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "name": "a" + }, + "property": { + "type": "Literal", + "start": 6, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "value": 0, + "rawValue": 0, + "raw": "0" + }, + "computed": true + } + } + ] + }, + "right": { + "type": "Literal", + "start": 12, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 12 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "value": 0, + "rawValue": 0, + "raw": "0" + } + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-destructuring-assignment-array-pattern/nested-assignment/actual.js b/test/fixtures/esprima/es2015-destructuring-assignment-array-pattern/nested-assignment/actual.js new file mode 100644 index 0000000000..4bb7333964 --- /dev/null +++ b/test/fixtures/esprima/es2015-destructuring-assignment-array-pattern/nested-assignment/actual.js @@ -0,0 +1 @@ +[a,b=0,[c,...a[0]]={}]=0; diff --git a/test/fixtures/esprima/es2015-destructuring-assignment-array-pattern/nested-assignment/expected.json b/test/fixtures/esprima/es2015-destructuring-assignment-array-pattern/nested-assignment/expected.json new file mode 100644 index 0000000000..b274610e61 --- /dev/null +++ b/test/fixtures/esprima/es2015-destructuring-assignment-array-pattern/nested-assignment/expected.json @@ -0,0 +1,293 @@ +{ + "type": "File", + "start": 0, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 25 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 25 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 25 + } + }, + "expression": { + "type": "AssignmentExpression", + "start": 0, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 24 + } + }, + "operator": "=", + "left": { + "type": "ArrayPattern", + "start": 0, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "elements": [ + { + "type": "Identifier", + "start": 1, + "end": 2, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 2 + } + }, + "name": "a" + }, + { + "type": "AssignmentPattern", + "start": 3, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 3 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "left": { + "type": "Identifier", + "start": 3, + "end": 4, + "loc": { + "start": { + "line": 1, + "column": 3 + }, + "end": { + "line": 1, + "column": 4 + } + }, + "name": "b" + }, + "right": { + "type": "Literal", + "start": 5, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "value": 0, + "rawValue": 0, + "raw": "0" + } + }, + { + "type": "AssignmentPattern", + "start": 7, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 21 + } + }, + "left": { + "type": "ArrayPattern", + "start": 7, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "elements": [ + { + "type": "Identifier", + "start": 8, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "name": "c" + }, + { + "type": "RestElement", + "start": 10, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "argument": { + "type": "MemberExpression", + "start": 13, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "object": { + "type": "Identifier", + "start": 13, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "name": "a" + }, + "property": { + "type": "Literal", + "start": 15, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "value": 0, + "rawValue": 0, + "raw": "0" + }, + "computed": true + } + } + ] + }, + "right": { + "type": "ObjectExpression", + "start": 19, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 19 + }, + "end": { + "line": 1, + "column": 21 + } + }, + "properties": [] + } + } + ] + }, + "right": { + "type": "Literal", + "start": 23, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 23 + }, + "end": { + "line": 1, + "column": 24 + } + }, + "value": 0, + "rawValue": 0, + "raw": "0" + } + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-destructuring-assignment-array-pattern/nested-cover-grammar/actual.js b/test/fixtures/esprima/es2015-destructuring-assignment-array-pattern/nested-cover-grammar/actual.js new file mode 100644 index 0000000000..4b9a5e317b --- /dev/null +++ b/test/fixtures/esprima/es2015-destructuring-assignment-array-pattern/nested-cover-grammar/actual.js @@ -0,0 +1 @@ +[{a=b}=0] diff --git a/test/fixtures/esprima/es2015-destructuring-assignment-array-pattern/nested-cover-grammar/expected.json b/test/fixtures/esprima/es2015-destructuring-assignment-array-pattern/nested-cover-grammar/expected.json new file mode 100644 index 0000000000..335b17c62c --- /dev/null +++ b/test/fixtures/esprima/es2015-destructuring-assignment-array-pattern/nested-cover-grammar/expected.json @@ -0,0 +1,198 @@ +{ + "type": "File", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "expression": { + "type": "ArrayExpression", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "elements": [ + { + "type": "AssignmentExpression", + "start": 1, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "operator": "=", + "left": { + "type": "ObjectPattern", + "start": 1, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "properties": [ + { + "type": "Property", + "start": 2, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 2 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "method": false, + "shorthand": true, + "computed": false, + "key": { + "type": "Identifier", + "start": 2, + "end": 3, + "loc": { + "start": { + "line": 1, + "column": 2 + }, + "end": { + "line": 1, + "column": 3 + } + }, + "name": "a" + }, + "kind": "init", + "value": { + "type": "AssignmentPattern", + "start": 2, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 2 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "left": { + "type": "Identifier", + "start": 2, + "end": 3, + "loc": { + "start": { + "line": 1, + "column": 2 + }, + "end": { + "line": 1, + "column": 3 + } + }, + "name": "a" + }, + "right": { + "type": "Identifier", + "start": 4, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "name": "b" + } + } + } + ] + }, + "right": { + "type": "Literal", + "start": 7, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "value": 0, + "rawValue": 0, + "raw": "0" + } + } + ] + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-destructuring-assignment-array-pattern/simple-assignment/actual.js b/test/fixtures/esprima/es2015-destructuring-assignment-array-pattern/simple-assignment/actual.js new file mode 100644 index 0000000000..7cfd69bb5f --- /dev/null +++ b/test/fixtures/esprima/es2015-destructuring-assignment-array-pattern/simple-assignment/actual.js @@ -0,0 +1 @@ +[a] = 0; diff --git a/test/fixtures/esprima/es2015-destructuring-assignment-array-pattern/simple-assignment/expected.json b/test/fixtures/esprima/es2015-destructuring-assignment-array-pattern/simple-assignment/expected.json new file mode 100644 index 0000000000..04a63a3079 --- /dev/null +++ b/test/fixtures/esprima/es2015-destructuring-assignment-array-pattern/simple-assignment/expected.json @@ -0,0 +1,115 @@ +{ + "type": "File", + "start": 0, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "expression": { + "type": "AssignmentExpression", + "start": 0, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "operator": "=", + "left": { + "type": "ArrayPattern", + "start": 0, + "end": 3, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 3 + } + }, + "elements": [ + { + "type": "Identifier", + "start": 1, + "end": 2, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 2 + } + }, + "name": "a" + } + ] + }, + "right": { + "type": "Literal", + "start": 6, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "value": 0, + "rawValue": 0, + "raw": "0" + } + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-destructuring-assignment-object-pattern/empty-object-pattern-assignment/actual.js b/test/fixtures/esprima/es2015-destructuring-assignment-object-pattern/empty-object-pattern-assignment/actual.js new file mode 100644 index 0000000000..90c7f79b8c --- /dev/null +++ b/test/fixtures/esprima/es2015-destructuring-assignment-object-pattern/empty-object-pattern-assignment/actual.js @@ -0,0 +1 @@ +({} = 0); diff --git a/test/fixtures/esprima/es2015-destructuring-assignment-object-pattern/empty-object-pattern-assignment/expected.json b/test/fixtures/esprima/es2015-destructuring-assignment-object-pattern/empty-object-pattern-assignment/expected.json new file mode 100644 index 0000000000..71ff2e0702 --- /dev/null +++ b/test/fixtures/esprima/es2015-destructuring-assignment-object-pattern/empty-object-pattern-assignment/expected.json @@ -0,0 +1,99 @@ +{ + "type": "File", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "expression": { + "type": "AssignmentExpression", + "start": 1, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "operator": "=", + "left": { + "type": "ObjectPattern", + "start": 1, + "end": 3, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 3 + } + }, + "properties": [] + }, + "right": { + "type": "Literal", + "start": 6, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "value": 0, + "rawValue": 0, + "raw": "0" + }, + "parenthesizedExpression": true + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-destructuring-assignment-object-pattern/invalid-lhs-01/actual.js b/test/fixtures/esprima/es2015-destructuring-assignment-object-pattern/invalid-lhs-01/actual.js new file mode 100644 index 0000000000..e4587fbdf2 --- /dev/null +++ b/test/fixtures/esprima/es2015-destructuring-assignment-object-pattern/invalid-lhs-01/actual.js @@ -0,0 +1 @@ +({a:this}=0) diff --git a/test/fixtures/esprima/es2015-destructuring-assignment-object-pattern/invalid-lhs-01/options.json b/test/fixtures/esprima/es2015-destructuring-assignment-object-pattern/invalid-lhs-01/options.json new file mode 100644 index 0000000000..f940813b9f --- /dev/null +++ b/test/fixtures/esprima/es2015-destructuring-assignment-object-pattern/invalid-lhs-01/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Assigning to rvalue (1:4)" +} \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-destructuring-assignment-object-pattern/invalid-lhs-02/actual.js b/test/fixtures/esprima/es2015-destructuring-assignment-object-pattern/invalid-lhs-02/actual.js new file mode 100644 index 0000000000..d6169342ed --- /dev/null +++ b/test/fixtures/esprima/es2015-destructuring-assignment-object-pattern/invalid-lhs-02/actual.js @@ -0,0 +1 @@ +({a: this} = 0); diff --git a/test/fixtures/esprima/es2015-destructuring-assignment-object-pattern/invalid-lhs-02/options.json b/test/fixtures/esprima/es2015-destructuring-assignment-object-pattern/invalid-lhs-02/options.json new file mode 100644 index 0000000000..85f6f01102 --- /dev/null +++ b/test/fixtures/esprima/es2015-destructuring-assignment-object-pattern/invalid-lhs-02/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Assigning to rvalue (1:5)" +} \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-destructuring-assignment-object-pattern/invalid-pattern-with-method/actual.js b/test/fixtures/esprima/es2015-destructuring-assignment-object-pattern/invalid-pattern-with-method/actual.js new file mode 100644 index 0000000000..4dc400f18b --- /dev/null +++ b/test/fixtures/esprima/es2015-destructuring-assignment-object-pattern/invalid-pattern-with-method/actual.js @@ -0,0 +1 @@ +({get a(){}})=0 diff --git a/test/fixtures/esprima/es2015-destructuring-assignment-object-pattern/invalid-pattern-with-method/options.json b/test/fixtures/esprima/es2015-destructuring-assignment-object-pattern/invalid-pattern-with-method/options.json new file mode 100644 index 0000000000..359d73aba0 --- /dev/null +++ b/test/fixtures/esprima/es2015-destructuring-assignment-object-pattern/invalid-pattern-with-method/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Object pattern can't contain getter or setter (1:6)" +} \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-destructuring-assignment-object-pattern/nested-cover-grammar/actual.js b/test/fixtures/esprima/es2015-destructuring-assignment-object-pattern/nested-cover-grammar/actual.js new file mode 100644 index 0000000000..eafafc8751 --- /dev/null +++ b/test/fixtures/esprima/es2015-destructuring-assignment-object-pattern/nested-cover-grammar/actual.js @@ -0,0 +1 @@ +[[[[[[[[[[[[[[[[[[[[{a=b[0]}]]]]]]]]]]]]]]]]]]]]=0; diff --git a/test/fixtures/esprima/es2015-destructuring-assignment-object-pattern/nested-cover-grammar/expected.json b/test/fixtures/esprima/es2015-destructuring-assignment-object-pattern/nested-cover-grammar/expected.json new file mode 100644 index 0000000000..65409260c0 --- /dev/null +++ b/test/fixtures/esprima/es2015-destructuring-assignment-object-pattern/nested-cover-grammar/expected.json @@ -0,0 +1,555 @@ +{ + "type": "File", + "start": 0, + "end": 51, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 51 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 51, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 51 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 51, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 51 + } + }, + "expression": { + "type": "AssignmentExpression", + "start": 0, + "end": 50, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 50 + } + }, + "operator": "=", + "left": { + "type": "ArrayPattern", + "start": 0, + "end": 48, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 48 + } + }, + "elements": [ + { + "type": "ArrayPattern", + "start": 1, + "end": 47, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 47 + } + }, + "elements": [ + { + "type": "ArrayPattern", + "start": 2, + "end": 46, + "loc": { + "start": { + "line": 1, + "column": 2 + }, + "end": { + "line": 1, + "column": 46 + } + }, + "elements": [ + { + "type": "ArrayPattern", + "start": 3, + "end": 45, + "loc": { + "start": { + "line": 1, + "column": 3 + }, + "end": { + "line": 1, + "column": 45 + } + }, + "elements": [ + { + "type": "ArrayPattern", + "start": 4, + "end": 44, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 44 + } + }, + "elements": [ + { + "type": "ArrayPattern", + "start": 5, + "end": 43, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 43 + } + }, + "elements": [ + { + "type": "ArrayPattern", + "start": 6, + "end": 42, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 42 + } + }, + "elements": [ + { + "type": "ArrayPattern", + "start": 7, + "end": 41, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 41 + } + }, + "elements": [ + { + "type": "ArrayPattern", + "start": 8, + "end": 40, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 40 + } + }, + "elements": [ + { + "type": "ArrayPattern", + "start": 9, + "end": 39, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 39 + } + }, + "elements": [ + { + "type": "ArrayPattern", + "start": 10, + "end": 38, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 38 + } + }, + "elements": [ + { + "type": "ArrayPattern", + "start": 11, + "end": 37, + "loc": { + "start": { + "line": 1, + "column": 11 + }, + "end": { + "line": 1, + "column": 37 + } + }, + "elements": [ + { + "type": "ArrayPattern", + "start": 12, + "end": 36, + "loc": { + "start": { + "line": 1, + "column": 12 + }, + "end": { + "line": 1, + "column": 36 + } + }, + "elements": [ + { + "type": "ArrayPattern", + "start": 13, + "end": 35, + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 1, + "column": 35 + } + }, + "elements": [ + { + "type": "ArrayPattern", + "start": 14, + "end": 34, + "loc": { + "start": { + "line": 1, + "column": 14 + }, + "end": { + "line": 1, + "column": 34 + } + }, + "elements": [ + { + "type": "ArrayPattern", + "start": 15, + "end": 33, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 33 + } + }, + "elements": [ + { + "type": "ArrayPattern", + "start": 16, + "end": 32, + "loc": { + "start": { + "line": 1, + "column": 16 + }, + "end": { + "line": 1, + "column": 32 + } + }, + "elements": [ + { + "type": "ArrayPattern", + "start": 17, + "end": 31, + "loc": { + "start": { + "line": 1, + "column": 17 + }, + "end": { + "line": 1, + "column": 31 + } + }, + "elements": [ + { + "type": "ArrayPattern", + "start": 18, + "end": 30, + "loc": { + "start": { + "line": 1, + "column": 18 + }, + "end": { + "line": 1, + "column": 30 + } + }, + "elements": [ + { + "type": "ArrayPattern", + "start": 19, + "end": 29, + "loc": { + "start": { + "line": 1, + "column": 19 + }, + "end": { + "line": 1, + "column": 29 + } + }, + "elements": [ + { + "type": "ObjectPattern", + "start": 20, + "end": 28, + "loc": { + "start": { + "line": 1, + "column": 20 + }, + "end": { + "line": 1, + "column": 28 + } + }, + "properties": [ + { + "type": "Property", + "start": 21, + "end": 27, + "loc": { + "start": { + "line": 1, + "column": 21 + }, + "end": { + "line": 1, + "column": 27 + } + }, + "method": false, + "shorthand": true, + "computed": false, + "key": { + "type": "Identifier", + "start": 21, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 21 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "name": "a" + }, + "kind": "init", + "value": { + "type": "AssignmentPattern", + "start": 21, + "end": 27, + "loc": { + "start": { + "line": 1, + "column": 21 + }, + "end": { + "line": 1, + "column": 27 + } + }, + "left": { + "type": "Identifier", + "start": 21, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 21 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "name": "a" + }, + "right": { + "type": "MemberExpression", + "start": 23, + "end": 27, + "loc": { + "start": { + "line": 1, + "column": 23 + }, + "end": { + "line": 1, + "column": 27 + } + }, + "object": { + "type": "Identifier", + "start": 23, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 23 + }, + "end": { + "line": 1, + "column": 24 + } + }, + "name": "b" + }, + "property": { + "type": "Literal", + "start": 25, + "end": 26, + "loc": { + "start": { + "line": 1, + "column": 25 + }, + "end": { + "line": 1, + "column": 26 + } + }, + "value": 0, + "rawValue": 0, + "raw": "0" + }, + "computed": true + } + } + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + "right": { + "type": "Literal", + "start": 49, + "end": 50, + "loc": { + "start": { + "line": 1, + "column": 49 + }, + "end": { + "line": 1, + "column": 50 + } + }, + "value": 0, + "rawValue": 0, + "raw": "0" + } + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-destructuring-assignment-object-pattern/object-pattern-assignment/actual.js b/test/fixtures/esprima/es2015-destructuring-assignment-object-pattern/object-pattern-assignment/actual.js new file mode 100644 index 0000000000..c24458998d --- /dev/null +++ b/test/fixtures/esprima/es2015-destructuring-assignment-object-pattern/object-pattern-assignment/actual.js @@ -0,0 +1,8 @@ +({ + a, + a:a, + a:a=a, + [a]:{a}, + a:some_call()[a], + a:this.a +} = 0); diff --git a/test/fixtures/esprima/es2015-destructuring-assignment-object-pattern/object-pattern-assignment/expected.json b/test/fixtures/esprima/es2015-destructuring-assignment-object-pattern/object-pattern-assignment/expected.json new file mode 100644 index 0000000000..1689a3fe18 --- /dev/null +++ b/test/fixtures/esprima/es2015-destructuring-assignment-object-pattern/object-pattern-assignment/expected.json @@ -0,0 +1,568 @@ +{ + "type": "File", + "start": 0, + "end": 85, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 8, + "column": 7 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 85, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 8, + "column": 7 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 85, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 8, + "column": 7 + } + }, + "expression": { + "type": "AssignmentExpression", + "start": 1, + "end": 83, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 8, + "column": 5 + } + }, + "operator": "=", + "left": { + "type": "ObjectPattern", + "start": 1, + "end": 79, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 8, + "column": 1 + } + }, + "properties": [ + { + "type": "Property", + "start": 7, + "end": 8, + "loc": { + "start": { + "line": 2, + "column": 4 + }, + "end": { + "line": 2, + "column": 5 + } + }, + "method": false, + "shorthand": true, + "computed": false, + "key": { + "type": "Identifier", + "start": 7, + "end": 8, + "loc": { + "start": { + "line": 2, + "column": 4 + }, + "end": { + "line": 2, + "column": 5 + } + }, + "name": "a" + }, + "kind": "init", + "value": { + "type": "Identifier", + "start": 7, + "end": 8, + "loc": { + "start": { + "line": 2, + "column": 4 + }, + "end": { + "line": 2, + "column": 5 + } + }, + "name": "a" + } + }, + { + "type": "Property", + "start": 14, + "end": 17, + "loc": { + "start": { + "line": 3, + "column": 4 + }, + "end": { + "line": 3, + "column": 7 + } + }, + "method": false, + "shorthand": false, + "computed": false, + "key": { + "type": "Identifier", + "start": 14, + "end": 15, + "loc": { + "start": { + "line": 3, + "column": 4 + }, + "end": { + "line": 3, + "column": 5 + } + }, + "name": "a" + }, + "value": { + "type": "Identifier", + "start": 16, + "end": 17, + "loc": { + "start": { + "line": 3, + "column": 6 + }, + "end": { + "line": 3, + "column": 7 + } + }, + "name": "a" + }, + "kind": "init" + }, + { + "type": "Property", + "start": 23, + "end": 28, + "loc": { + "start": { + "line": 4, + "column": 4 + }, + "end": { + "line": 4, + "column": 9 + } + }, + "method": false, + "shorthand": false, + "computed": false, + "key": { + "type": "Identifier", + "start": 23, + "end": 24, + "loc": { + "start": { + "line": 4, + "column": 4 + }, + "end": { + "line": 4, + "column": 5 + } + }, + "name": "a" + }, + "value": { + "type": "AssignmentPattern", + "start": 25, + "end": 28, + "loc": { + "start": { + "line": 4, + "column": 6 + }, + "end": { + "line": 4, + "column": 9 + } + }, + "left": { + "type": "Identifier", + "start": 25, + "end": 26, + "loc": { + "start": { + "line": 4, + "column": 6 + }, + "end": { + "line": 4, + "column": 7 + } + }, + "name": "a" + }, + "right": { + "type": "Identifier", + "start": 27, + "end": 28, + "loc": { + "start": { + "line": 4, + "column": 8 + }, + "end": { + "line": 4, + "column": 9 + } + }, + "name": "a" + } + }, + "kind": "init" + }, + { + "type": "Property", + "start": 34, + "end": 41, + "loc": { + "start": { + "line": 5, + "column": 4 + }, + "end": { + "line": 5, + "column": 11 + } + }, + "method": false, + "shorthand": false, + "computed": true, + "key": { + "type": "Identifier", + "start": 35, + "end": 36, + "loc": { + "start": { + "line": 5, + "column": 5 + }, + "end": { + "line": 5, + "column": 6 + } + }, + "name": "a" + }, + "value": { + "type": "ObjectPattern", + "start": 38, + "end": 41, + "loc": { + "start": { + "line": 5, + "column": 8 + }, + "end": { + "line": 5, + "column": 11 + } + }, + "properties": [ + { + "type": "Property", + "start": 39, + "end": 40, + "loc": { + "start": { + "line": 5, + "column": 9 + }, + "end": { + "line": 5, + "column": 10 + } + }, + "method": false, + "shorthand": true, + "computed": false, + "key": { + "type": "Identifier", + "start": 39, + "end": 40, + "loc": { + "start": { + "line": 5, + "column": 9 + }, + "end": { + "line": 5, + "column": 10 + } + }, + "name": "a" + }, + "kind": "init", + "value": { + "type": "Identifier", + "start": 39, + "end": 40, + "loc": { + "start": { + "line": 5, + "column": 9 + }, + "end": { + "line": 5, + "column": 10 + } + }, + "name": "a" + } + } + ] + }, + "kind": "init" + }, + { + "type": "Property", + "start": 47, + "end": 63, + "loc": { + "start": { + "line": 6, + "column": 4 + }, + "end": { + "line": 6, + "column": 20 + } + }, + "method": false, + "shorthand": false, + "computed": false, + "key": { + "type": "Identifier", + "start": 47, + "end": 48, + "loc": { + "start": { + "line": 6, + "column": 4 + }, + "end": { + "line": 6, + "column": 5 + } + }, + "name": "a" + }, + "value": { + "type": "MemberExpression", + "start": 49, + "end": 63, + "loc": { + "start": { + "line": 6, + "column": 6 + }, + "end": { + "line": 6, + "column": 20 + } + }, + "object": { + "type": "CallExpression", + "start": 49, + "end": 60, + "loc": { + "start": { + "line": 6, + "column": 6 + }, + "end": { + "line": 6, + "column": 17 + } + }, + "callee": { + "type": "Identifier", + "start": 49, + "end": 58, + "loc": { + "start": { + "line": 6, + "column": 6 + }, + "end": { + "line": 6, + "column": 15 + } + }, + "name": "some_call" + }, + "arguments": [] + }, + "property": { + "type": "Identifier", + "start": 61, + "end": 62, + "loc": { + "start": { + "line": 6, + "column": 18 + }, + "end": { + "line": 6, + "column": 19 + } + }, + "name": "a" + }, + "computed": true + }, + "kind": "init" + }, + { + "type": "Property", + "start": 69, + "end": 77, + "loc": { + "start": { + "line": 7, + "column": 4 + }, + "end": { + "line": 7, + "column": 12 + } + }, + "method": false, + "shorthand": false, + "computed": false, + "key": { + "type": "Identifier", + "start": 69, + "end": 70, + "loc": { + "start": { + "line": 7, + "column": 4 + }, + "end": { + "line": 7, + "column": 5 + } + }, + "name": "a" + }, + "value": { + "type": "MemberExpression", + "start": 71, + "end": 77, + "loc": { + "start": { + "line": 7, + "column": 6 + }, + "end": { + "line": 7, + "column": 12 + } + }, + "object": { + "type": "ThisExpression", + "start": 71, + "end": 75, + "loc": { + "start": { + "line": 7, + "column": 6 + }, + "end": { + "line": 7, + "column": 10 + } + } + }, + "property": { + "type": "Identifier", + "start": 76, + "end": 77, + "loc": { + "start": { + "line": 7, + "column": 11 + }, + "end": { + "line": 7, + "column": 12 + } + }, + "name": "a" + }, + "computed": false + }, + "kind": "init" + } + ] + }, + "right": { + "type": "Literal", + "start": 82, + "end": 83, + "loc": { + "start": { + "line": 8, + "column": 4 + }, + "end": { + "line": 8, + "column": 5 + } + }, + "value": 0, + "rawValue": 0, + "raw": "0" + }, + "parenthesizedExpression": true + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-destructuring-assignment/invalid-cover-grammar/actual.js b/test/fixtures/esprima/es2015-destructuring-assignment/invalid-cover-grammar/actual.js new file mode 100644 index 0000000000..0b41490405 --- /dev/null +++ b/test/fixtures/esprima/es2015-destructuring-assignment/invalid-cover-grammar/actual.js @@ -0,0 +1 @@ +[[[[[[[[[[[[[[[[[[[[{a=b}]]]]]]]]]]]]]]]]]]]] diff --git a/test/fixtures/esprima/es2015-destructuring-assignment/invalid-cover-grammar/options.json b/test/fixtures/esprima/es2015-destructuring-assignment/invalid-cover-grammar/options.json new file mode 100644 index 0000000000..b23f881870 --- /dev/null +++ b/test/fixtures/esprima/es2015-destructuring-assignment/invalid-cover-grammar/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Unexpected token (1:22)" +} \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-destructuring-assignment/invalid-group-assignment/actual.js b/test/fixtures/esprima/es2015-destructuring-assignment/invalid-group-assignment/actual.js new file mode 100644 index 0000000000..edb5ea6143 --- /dev/null +++ b/test/fixtures/esprima/es2015-destructuring-assignment/invalid-group-assignment/actual.js @@ -0,0 +1 @@ +(a,b)=(c,d); diff --git a/test/fixtures/esprima/es2015-destructuring-assignment/invalid-group-assignment/options.json b/test/fixtures/esprima/es2015-destructuring-assignment/invalid-group-assignment/options.json new file mode 100644 index 0000000000..4d699b8b0c --- /dev/null +++ b/test/fixtures/esprima/es2015-destructuring-assignment/invalid-group-assignment/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Assigning to rvalue (1:1)" +} \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-export-declaration/export-const-number/actual.js b/test/fixtures/esprima/es2015-export-declaration/export-const-number/actual.js new file mode 100644 index 0000000000..bb1843d113 --- /dev/null +++ b/test/fixtures/esprima/es2015-export-declaration/export-const-number/actual.js @@ -0,0 +1 @@ +export const foo = 1; diff --git a/test/fixtures/esprima/es2015-export-declaration/export-const-number/expected.json b/test/fixtures/esprima/es2015-export-declaration/export-const-number/expected.json new file mode 100644 index 0000000000..3291034455 --- /dev/null +++ b/test/fixtures/esprima/es2015-export-declaration/export-const-number/expected.json @@ -0,0 +1,117 @@ +{ + "type": "File", + "start": 0, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 21 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 21 + } + }, + "sourceType": "module", + "body": [ + { + "type": "ExportNamedDeclaration", + "start": 0, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 21 + } + }, + "specifiers": [], + "source": null, + "declaration": { + "type": "VariableDeclaration", + "start": 7, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 21 + } + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 13, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "id": { + "type": "Identifier", + "start": 13, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "name": "foo" + }, + "init": { + "type": "Literal", + "start": 19, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 19 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "value": 1, + "rawValue": 1, + "raw": "1" + } + } + ], + "kind": "const" + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-export-declaration/export-default-array/actual.js b/test/fixtures/esprima/es2015-export-declaration/export-default-array/actual.js new file mode 100644 index 0000000000..d6d1738de6 --- /dev/null +++ b/test/fixtures/esprima/es2015-export-declaration/export-default-array/actual.js @@ -0,0 +1 @@ +export default []; diff --git a/test/fixtures/esprima/es2015-export-declaration/export-default-array/expected.json b/test/fixtures/esprima/es2015-export-declaration/export-default-array/expected.json new file mode 100644 index 0000000000..50cc489ebb --- /dev/null +++ b/test/fixtures/esprima/es2015-export-declaration/export-default-array/expected.json @@ -0,0 +1,64 @@ +{ + "type": "File", + "start": 0, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "sourceType": "module", + "body": [ + { + "type": "ExportDefaultDeclaration", + "start": 0, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "declaration": { + "type": "ArrayExpression", + "start": 15, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "elements": [] + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-export-declaration/export-default-class/actual.js b/test/fixtures/esprima/es2015-export-declaration/export-default-class/actual.js new file mode 100644 index 0000000000..a6e68e9838 --- /dev/null +++ b/test/fixtures/esprima/es2015-export-declaration/export-default-class/actual.js @@ -0,0 +1 @@ +export default class {} diff --git a/test/fixtures/esprima/es2015-export-declaration/export-default-class/expected.json b/test/fixtures/esprima/es2015-export-declaration/export-default-class/expected.json new file mode 100644 index 0000000000..0d4410ae2e --- /dev/null +++ b/test/fixtures/esprima/es2015-export-declaration/export-default-class/expected.json @@ -0,0 +1,81 @@ +{ + "type": "File", + "start": 0, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "sourceType": "module", + "body": [ + { + "type": "ExportDefaultDeclaration", + "start": 0, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "declaration": { + "type": "ClassExpression", + "start": 15, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "id": null, + "superClass": null, + "body": { + "type": "ClassBody", + "start": 21, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 21 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "body": [] + } + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-export-declaration/export-default-expression/actual.js b/test/fixtures/esprima/es2015-export-declaration/export-default-expression/actual.js new file mode 100644 index 0000000000..f30c184a1a --- /dev/null +++ b/test/fixtures/esprima/es2015-export-declaration/export-default-expression/actual.js @@ -0,0 +1 @@ +export default (1 + 2); diff --git a/test/fixtures/esprima/es2015-export-declaration/export-default-expression/expected.json b/test/fixtures/esprima/es2015-export-declaration/export-default-expression/expected.json new file mode 100644 index 0000000000..81384a8a1d --- /dev/null +++ b/test/fixtures/esprima/es2015-export-declaration/export-default-expression/expected.json @@ -0,0 +1,101 @@ +{ + "type": "File", + "start": 0, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "sourceType": "module", + "body": [ + { + "type": "ExportDefaultDeclaration", + "start": 0, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "declaration": { + "type": "BinaryExpression", + "start": 16, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 16 + }, + "end": { + "line": 1, + "column": 21 + } + }, + "left": { + "type": "Literal", + "start": 16, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 16 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "value": 1, + "rawValue": 1, + "raw": "1" + }, + "operator": "+", + "right": { + "type": "Literal", + "start": 20, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 20 + }, + "end": { + "line": 1, + "column": 21 + } + }, + "value": 2, + "rawValue": 2, + "raw": "2" + }, + "parenthesizedExpression": true + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-export-declaration/export-default-function/actual.js b/test/fixtures/esprima/es2015-export-declaration/export-default-function/actual.js new file mode 100644 index 0000000000..ea9b101e1c --- /dev/null +++ b/test/fixtures/esprima/es2015-export-declaration/export-default-function/actual.js @@ -0,0 +1 @@ +export default function () {} diff --git a/test/fixtures/esprima/es2015-export-declaration/export-default-function/expected.json b/test/fixtures/esprima/es2015-export-declaration/export-default-function/expected.json new file mode 100644 index 0000000000..be8795503e --- /dev/null +++ b/test/fixtures/esprima/es2015-export-declaration/export-default-function/expected.json @@ -0,0 +1,83 @@ +{ + "type": "File", + "start": 0, + "end": 29, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 29 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 29, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 29 + } + }, + "sourceType": "module", + "body": [ + { + "type": "ExportDefaultDeclaration", + "start": 0, + "end": 29, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 29 + } + }, + "declaration": { + "type": "FunctionExpression", + "start": 15, + "end": 29, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 29 + } + }, + "id": null, + "generator": false, + "expression": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 27, + "end": 29, + "loc": { + "start": { + "line": 1, + "column": 27 + }, + "end": { + "line": 1, + "column": 29 + } + }, + "body": [] + } + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-export-declaration/export-default-named-function/actual.js b/test/fixtures/esprima/es2015-export-declaration/export-default-named-function/actual.js new file mode 100644 index 0000000000..386baca173 --- /dev/null +++ b/test/fixtures/esprima/es2015-export-declaration/export-default-named-function/actual.js @@ -0,0 +1 @@ +export default function foo() {} diff --git a/test/fixtures/esprima/es2015-export-declaration/export-default-named-function/expected.json b/test/fixtures/esprima/es2015-export-declaration/export-default-named-function/expected.json new file mode 100644 index 0000000000..904f0ed8d9 --- /dev/null +++ b/test/fixtures/esprima/es2015-export-declaration/export-default-named-function/expected.json @@ -0,0 +1,98 @@ +{ + "type": "File", + "start": 0, + "end": 32, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 32 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 32, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 32 + } + }, + "sourceType": "module", + "body": [ + { + "type": "ExportDefaultDeclaration", + "start": 0, + "end": 32, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 32 + } + }, + "declaration": { + "type": "FunctionDeclaration", + "start": 15, + "end": 32, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 32 + } + }, + "id": { + "type": "Identifier", + "start": 24, + "end": 27, + "loc": { + "start": { + "line": 1, + "column": 24 + }, + "end": { + "line": 1, + "column": 27 + } + }, + "name": "foo" + }, + "generator": false, + "expression": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 30, + "end": 32, + "loc": { + "start": { + "line": 1, + "column": 30 + }, + "end": { + "line": 1, + "column": 32 + } + }, + "body": [] + } + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-export-declaration/export-default-number/actual.js b/test/fixtures/esprima/es2015-export-declaration/export-default-number/actual.js new file mode 100644 index 0000000000..7a4e8a723a --- /dev/null +++ b/test/fixtures/esprima/es2015-export-declaration/export-default-number/actual.js @@ -0,0 +1 @@ +export default 42; diff --git a/test/fixtures/esprima/es2015-export-declaration/export-default-number/expected.json b/test/fixtures/esprima/es2015-export-declaration/export-default-number/expected.json new file mode 100644 index 0000000000..b0579df273 --- /dev/null +++ b/test/fixtures/esprima/es2015-export-declaration/export-default-number/expected.json @@ -0,0 +1,66 @@ +{ + "type": "File", + "start": 0, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "sourceType": "module", + "body": [ + { + "type": "ExportDefaultDeclaration", + "start": 0, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "declaration": { + "type": "Literal", + "start": 15, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "value": 42, + "rawValue": 42, + "raw": "42" + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-export-declaration/export-default-object/actual.js b/test/fixtures/esprima/es2015-export-declaration/export-default-object/actual.js new file mode 100644 index 0000000000..f8266ca25f --- /dev/null +++ b/test/fixtures/esprima/es2015-export-declaration/export-default-object/actual.js @@ -0,0 +1 @@ +export default { foo: 1 }; diff --git a/test/fixtures/esprima/es2015-export-declaration/export-default-object/expected.json b/test/fixtures/esprima/es2015-export-declaration/export-default-object/expected.json new file mode 100644 index 0000000000..3881690753 --- /dev/null +++ b/test/fixtures/esprima/es2015-export-declaration/export-default-object/expected.json @@ -0,0 +1,118 @@ +{ + "type": "File", + "start": 0, + "end": 26, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 26 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 26, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 26 + } + }, + "sourceType": "module", + "body": [ + { + "type": "ExportDefaultDeclaration", + "start": 0, + "end": 26, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 26 + } + }, + "declaration": { + "type": "ObjectExpression", + "start": 15, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 25 + } + }, + "properties": [ + { + "type": "Property", + "start": 17, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 17 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "method": false, + "shorthand": false, + "computed": false, + "key": { + "type": "Identifier", + "start": 17, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 17 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "name": "foo" + }, + "value": { + "type": "Literal", + "start": 22, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 22 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "value": 1, + "rawValue": 1, + "raw": "1" + }, + "kind": "init" + } + ] + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-export-declaration/export-default-value/actual.js b/test/fixtures/esprima/es2015-export-declaration/export-default-value/actual.js new file mode 100644 index 0000000000..f7b318b3f6 --- /dev/null +++ b/test/fixtures/esprima/es2015-export-declaration/export-default-value/actual.js @@ -0,0 +1 @@ +export default foo; diff --git a/test/fixtures/esprima/es2015-export-declaration/export-default-value/expected.json b/test/fixtures/esprima/es2015-export-declaration/export-default-value/expected.json new file mode 100644 index 0000000000..7425436e1f --- /dev/null +++ b/test/fixtures/esprima/es2015-export-declaration/export-default-value/expected.json @@ -0,0 +1,64 @@ +{ + "type": "File", + "start": 0, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 19 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 19 + } + }, + "sourceType": "module", + "body": [ + { + "type": "ExportDefaultDeclaration", + "start": 0, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 19 + } + }, + "declaration": { + "type": "Identifier", + "start": 15, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "name": "foo" + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-export-declaration/export-from-batch/actual.js b/test/fixtures/esprima/es2015-export-declaration/export-from-batch/actual.js new file mode 100644 index 0000000000..9ec8f63ab2 --- /dev/null +++ b/test/fixtures/esprima/es2015-export-declaration/export-from-batch/actual.js @@ -0,0 +1 @@ +export * from "foo"; diff --git a/test/fixtures/esprima/es2015-export-declaration/export-from-batch/expected.json b/test/fixtures/esprima/es2015-export-declaration/export-from-batch/expected.json new file mode 100644 index 0000000000..c23e216897 --- /dev/null +++ b/test/fixtures/esprima/es2015-export-declaration/export-from-batch/expected.json @@ -0,0 +1,66 @@ +{ + "type": "File", + "start": 0, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "sourceType": "module", + "body": [ + { + "type": "ExportAllDeclaration", + "start": 0, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "source": { + "type": "Literal", + "start": 14, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 14 + }, + "end": { + "line": 1, + "column": 19 + } + }, + "value": "foo", + "rawValue": "foo", + "raw": "\"foo\"" + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-export-declaration/export-from-default/actual.js b/test/fixtures/esprima/es2015-export-declaration/export-from-default/actual.js new file mode 100644 index 0000000000..2c7930d925 --- /dev/null +++ b/test/fixtures/esprima/es2015-export-declaration/export-from-default/actual.js @@ -0,0 +1 @@ +export {default} from "foo"; diff --git a/test/fixtures/esprima/es2015-export-declaration/export-from-default/expected.json b/test/fixtures/esprima/es2015-export-declaration/export-from-default/expected.json new file mode 100644 index 0000000000..9b94e4de83 --- /dev/null +++ b/test/fixtures/esprima/es2015-export-declaration/export-from-default/expected.json @@ -0,0 +1,116 @@ +{ + "type": "File", + "start": 0, + "end": 28, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 28 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 28, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 28 + } + }, + "sourceType": "module", + "body": [ + { + "type": "ExportNamedDeclaration", + "start": 0, + "end": 28, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 28 + } + }, + "declaration": null, + "specifiers": [ + { + "type": "ExportSpecifier", + "start": 8, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "local": { + "type": "Identifier", + "start": 8, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "name": "default" + }, + "exported": { + "type": "Identifier", + "start": 8, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "name": "default" + } + } + ], + "source": { + "type": "Literal", + "start": 22, + "end": 27, + "loc": { + "start": { + "line": 1, + "column": 22 + }, + "end": { + "line": 1, + "column": 27 + } + }, + "value": "foo", + "rawValue": "foo", + "raw": "\"foo\"" + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-export-declaration/export-from-named-as-default/actual.js b/test/fixtures/esprima/es2015-export-declaration/export-from-named-as-default/actual.js new file mode 100644 index 0000000000..5be9a685aa --- /dev/null +++ b/test/fixtures/esprima/es2015-export-declaration/export-from-named-as-default/actual.js @@ -0,0 +1 @@ +export {foo as default} from "foo"; diff --git a/test/fixtures/esprima/es2015-export-declaration/export-from-named-as-default/expected.json b/test/fixtures/esprima/es2015-export-declaration/export-from-named-as-default/expected.json new file mode 100644 index 0000000000..1f80e99f3b --- /dev/null +++ b/test/fixtures/esprima/es2015-export-declaration/export-from-named-as-default/expected.json @@ -0,0 +1,116 @@ +{ + "type": "File", + "start": 0, + "end": 35, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 35 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 35, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 35 + } + }, + "sourceType": "module", + "body": [ + { + "type": "ExportNamedDeclaration", + "start": 0, + "end": 35, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 35 + } + }, + "declaration": null, + "specifiers": [ + { + "type": "ExportSpecifier", + "start": 8, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "local": { + "type": "Identifier", + "start": 8, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "name": "foo" + }, + "exported": { + "type": "Identifier", + "start": 15, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "name": "default" + } + } + ], + "source": { + "type": "Literal", + "start": 29, + "end": 34, + "loc": { + "start": { + "line": 1, + "column": 29 + }, + "end": { + "line": 1, + "column": 34 + } + }, + "value": "foo", + "rawValue": "foo", + "raw": "\"foo\"" + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-export-declaration/export-from-named-as-specifier/actual.js b/test/fixtures/esprima/es2015-export-declaration/export-from-named-as-specifier/actual.js new file mode 100644 index 0000000000..9fff903bd9 --- /dev/null +++ b/test/fixtures/esprima/es2015-export-declaration/export-from-named-as-specifier/actual.js @@ -0,0 +1 @@ +export {foo as bar} from "foo"; diff --git a/test/fixtures/esprima/es2015-export-declaration/export-from-named-as-specifier/expected.json b/test/fixtures/esprima/es2015-export-declaration/export-from-named-as-specifier/expected.json new file mode 100644 index 0000000000..263e8769d4 --- /dev/null +++ b/test/fixtures/esprima/es2015-export-declaration/export-from-named-as-specifier/expected.json @@ -0,0 +1,116 @@ +{ + "type": "File", + "start": 0, + "end": 31, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 31 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 31, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 31 + } + }, + "sourceType": "module", + "body": [ + { + "type": "ExportNamedDeclaration", + "start": 0, + "end": 31, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 31 + } + }, + "declaration": null, + "specifiers": [ + { + "type": "ExportSpecifier", + "start": 8, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "local": { + "type": "Identifier", + "start": 8, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "name": "foo" + }, + "exported": { + "type": "Identifier", + "start": 15, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "name": "bar" + } + } + ], + "source": { + "type": "Literal", + "start": 25, + "end": 30, + "loc": { + "start": { + "line": 1, + "column": 25 + }, + "end": { + "line": 1, + "column": 30 + } + }, + "value": "foo", + "rawValue": "foo", + "raw": "\"foo\"" + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-export-declaration/export-from-named-as-specifiers/actual.js b/test/fixtures/esprima/es2015-export-declaration/export-from-named-as-specifiers/actual.js new file mode 100644 index 0000000000..4461d79e3b --- /dev/null +++ b/test/fixtures/esprima/es2015-export-declaration/export-from-named-as-specifiers/actual.js @@ -0,0 +1 @@ +export {foo as default, bar} from "foo"; diff --git a/test/fixtures/esprima/es2015-export-declaration/export-from-named-as-specifiers/expected.json b/test/fixtures/esprima/es2015-export-declaration/export-from-named-as-specifiers/expected.json new file mode 100644 index 0000000000..39ad36c9ac --- /dev/null +++ b/test/fixtures/esprima/es2015-export-declaration/export-from-named-as-specifiers/expected.json @@ -0,0 +1,163 @@ +{ + "type": "File", + "start": 0, + "end": 40, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 40 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 40, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 40 + } + }, + "sourceType": "module", + "body": [ + { + "type": "ExportNamedDeclaration", + "start": 0, + "end": 40, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 40 + } + }, + "declaration": null, + "specifiers": [ + { + "type": "ExportSpecifier", + "start": 8, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "local": { + "type": "Identifier", + "start": 8, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "name": "foo" + }, + "exported": { + "type": "Identifier", + "start": 15, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "name": "default" + } + }, + { + "type": "ExportSpecifier", + "start": 24, + "end": 27, + "loc": { + "start": { + "line": 1, + "column": 24 + }, + "end": { + "line": 1, + "column": 27 + } + }, + "local": { + "type": "Identifier", + "start": 24, + "end": 27, + "loc": { + "start": { + "line": 1, + "column": 24 + }, + "end": { + "line": 1, + "column": 27 + } + }, + "name": "bar" + }, + "exported": { + "type": "Identifier", + "start": 24, + "end": 27, + "loc": { + "start": { + "line": 1, + "column": 24 + }, + "end": { + "line": 1, + "column": 27 + } + }, + "name": "bar" + } + } + ], + "source": { + "type": "Literal", + "start": 34, + "end": 39, + "loc": { + "start": { + "line": 1, + "column": 34 + }, + "end": { + "line": 1, + "column": 39 + } + }, + "value": "foo", + "rawValue": "foo", + "raw": "\"foo\"" + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-export-declaration/export-from-specifier/actual.js b/test/fixtures/esprima/es2015-export-declaration/export-from-specifier/actual.js new file mode 100644 index 0000000000..83b7b67c51 --- /dev/null +++ b/test/fixtures/esprima/es2015-export-declaration/export-from-specifier/actual.js @@ -0,0 +1 @@ +export {foo} from "foo"; diff --git a/test/fixtures/esprima/es2015-export-declaration/export-from-specifier/expected.json b/test/fixtures/esprima/es2015-export-declaration/export-from-specifier/expected.json new file mode 100644 index 0000000000..37e27ba6b1 --- /dev/null +++ b/test/fixtures/esprima/es2015-export-declaration/export-from-specifier/expected.json @@ -0,0 +1,116 @@ +{ + "type": "File", + "start": 0, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 24 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 24 + } + }, + "sourceType": "module", + "body": [ + { + "type": "ExportNamedDeclaration", + "start": 0, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 24 + } + }, + "declaration": null, + "specifiers": [ + { + "type": "ExportSpecifier", + "start": 8, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "local": { + "type": "Identifier", + "start": 8, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "name": "foo" + }, + "exported": { + "type": "Identifier", + "start": 8, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "name": "foo" + } + } + ], + "source": { + "type": "Literal", + "start": 18, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 18 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "value": "foo", + "rawValue": "foo", + "raw": "\"foo\"" + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-export-declaration/export-from-specifiers/actual.js b/test/fixtures/esprima/es2015-export-declaration/export-from-specifiers/actual.js new file mode 100644 index 0000000000..35c2762a29 --- /dev/null +++ b/test/fixtures/esprima/es2015-export-declaration/export-from-specifiers/actual.js @@ -0,0 +1 @@ +export {foo, bar} from "foo"; diff --git a/test/fixtures/esprima/es2015-export-declaration/export-from-specifiers/expected.json b/test/fixtures/esprima/es2015-export-declaration/export-from-specifiers/expected.json new file mode 100644 index 0000000000..90f8b953b5 --- /dev/null +++ b/test/fixtures/esprima/es2015-export-declaration/export-from-specifiers/expected.json @@ -0,0 +1,163 @@ +{ + "type": "File", + "start": 0, + "end": 29, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 29 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 29, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 29 + } + }, + "sourceType": "module", + "body": [ + { + "type": "ExportNamedDeclaration", + "start": 0, + "end": 29, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 29 + } + }, + "declaration": null, + "specifiers": [ + { + "type": "ExportSpecifier", + "start": 8, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "local": { + "type": "Identifier", + "start": 8, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "name": "foo" + }, + "exported": { + "type": "Identifier", + "start": 8, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "name": "foo" + } + }, + { + "type": "ExportSpecifier", + "start": 13, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "local": { + "type": "Identifier", + "start": 13, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "name": "bar" + }, + "exported": { + "type": "Identifier", + "start": 13, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "name": "bar" + } + } + ], + "source": { + "type": "Literal", + "start": 23, + "end": 28, + "loc": { + "start": { + "line": 1, + "column": 23 + }, + "end": { + "line": 1, + "column": 28 + } + }, + "value": "foo", + "rawValue": "foo", + "raw": "\"foo\"" + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-export-declaration/export-function-declaration/actual.js b/test/fixtures/esprima/es2015-export-declaration/export-function-declaration/actual.js new file mode 100644 index 0000000000..003d71f6ae --- /dev/null +++ b/test/fixtures/esprima/es2015-export-declaration/export-function-declaration/actual.js @@ -0,0 +1 @@ +export function foo () {} false diff --git a/test/fixtures/esprima/es2015-export-declaration/export-function-declaration/expected.json b/test/fixtures/esprima/es2015-export-declaration/export-function-declaration/expected.json new file mode 100644 index 0000000000..a3474dbd50 --- /dev/null +++ b/test/fixtures/esprima/es2015-export-declaration/export-function-declaration/expected.json @@ -0,0 +1,133 @@ +{ + "type": "File", + "start": 0, + "end": 31, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 31 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 31, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 31 + } + }, + "sourceType": "module", + "body": [ + { + "type": "ExportNamedDeclaration", + "start": 0, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 25 + } + }, + "specifiers": [], + "source": null, + "declaration": { + "type": "FunctionDeclaration", + "start": 7, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 25 + } + }, + "id": { + "type": "Identifier", + "start": 16, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 16 + }, + "end": { + "line": 1, + "column": 19 + } + }, + "name": "foo" + }, + "generator": false, + "expression": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 23, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 23 + }, + "end": { + "line": 1, + "column": 25 + } + }, + "body": [] + } + } + }, + { + "type": "ExpressionStatement", + "start": 26, + "end": 31, + "loc": { + "start": { + "line": 1, + "column": 26 + }, + "end": { + "line": 1, + "column": 31 + } + }, + "expression": { + "type": "Literal", + "start": 26, + "end": 31, + "loc": { + "start": { + "line": 1, + "column": 26 + }, + "end": { + "line": 1, + "column": 31 + } + }, + "value": false, + "rawValue": false, + "raw": "false" + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-export-declaration/export-function/actual.js b/test/fixtures/esprima/es2015-export-declaration/export-function/actual.js new file mode 100644 index 0000000000..768586d72c --- /dev/null +++ b/test/fixtures/esprima/es2015-export-declaration/export-function/actual.js @@ -0,0 +1 @@ +export function foo () {} diff --git a/test/fixtures/esprima/es2015-export-declaration/export-function/expected.json b/test/fixtures/esprima/es2015-export-declaration/export-function/expected.json new file mode 100644 index 0000000000..88b3e7b5b3 --- /dev/null +++ b/test/fixtures/esprima/es2015-export-declaration/export-function/expected.json @@ -0,0 +1,100 @@ +{ + "type": "File", + "start": 0, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 25 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 25 + } + }, + "sourceType": "module", + "body": [ + { + "type": "ExportNamedDeclaration", + "start": 0, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 25 + } + }, + "specifiers": [], + "source": null, + "declaration": { + "type": "FunctionDeclaration", + "start": 7, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 25 + } + }, + "id": { + "type": "Identifier", + "start": 16, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 16 + }, + "end": { + "line": 1, + "column": 19 + } + }, + "name": "foo" + }, + "generator": false, + "expression": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 23, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 23 + }, + "end": { + "line": 1, + "column": 25 + } + }, + "body": [] + } + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-export-declaration/export-let-number/actual.js b/test/fixtures/esprima/es2015-export-declaration/export-let-number/actual.js new file mode 100644 index 0000000000..9d2b01ce65 --- /dev/null +++ b/test/fixtures/esprima/es2015-export-declaration/export-let-number/actual.js @@ -0,0 +1 @@ +export let foo = 1; diff --git a/test/fixtures/esprima/es2015-export-declaration/export-let-number/expected.json b/test/fixtures/esprima/es2015-export-declaration/export-let-number/expected.json new file mode 100644 index 0000000000..63b6fdfeec --- /dev/null +++ b/test/fixtures/esprima/es2015-export-declaration/export-let-number/expected.json @@ -0,0 +1,117 @@ +{ + "type": "File", + "start": 0, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 19 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 19 + } + }, + "sourceType": "module", + "body": [ + { + "type": "ExportNamedDeclaration", + "start": 0, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 19 + } + }, + "specifiers": [], + "source": null, + "declaration": { + "type": "VariableDeclaration", + "start": 7, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 19 + } + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 11, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 11 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "id": { + "type": "Identifier", + "start": 11, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 11 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "name": "foo" + }, + "init": { + "type": "Literal", + "start": 17, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 17 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "value": 1, + "rawValue": 1, + "raw": "1" + } + } + ], + "kind": "let" + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-export-declaration/export-named-as-default/actual.js b/test/fixtures/esprima/es2015-export-declaration/export-named-as-default/actual.js new file mode 100644 index 0000000000..5d32a24de0 --- /dev/null +++ b/test/fixtures/esprima/es2015-export-declaration/export-named-as-default/actual.js @@ -0,0 +1 @@ +export {foo as default}; diff --git a/test/fixtures/esprima/es2015-export-declaration/export-named-as-default/expected.json b/test/fixtures/esprima/es2015-export-declaration/export-named-as-default/expected.json new file mode 100644 index 0000000000..9c84a45187 --- /dev/null +++ b/test/fixtures/esprima/es2015-export-declaration/export-named-as-default/expected.json @@ -0,0 +1,99 @@ +{ + "type": "File", + "start": 0, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 24 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 24 + } + }, + "sourceType": "module", + "body": [ + { + "type": "ExportNamedDeclaration", + "start": 0, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 24 + } + }, + "declaration": null, + "specifiers": [ + { + "type": "ExportSpecifier", + "start": 8, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "local": { + "type": "Identifier", + "start": 8, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "name": "foo" + }, + "exported": { + "type": "Identifier", + "start": 15, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "name": "default" + } + } + ], + "source": null + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-export-declaration/export-named-as-specifier/actual.js b/test/fixtures/esprima/es2015-export-declaration/export-named-as-specifier/actual.js new file mode 100644 index 0000000000..e7820a6f02 --- /dev/null +++ b/test/fixtures/esprima/es2015-export-declaration/export-named-as-specifier/actual.js @@ -0,0 +1 @@ +export {foo as bar}; diff --git a/test/fixtures/esprima/es2015-export-declaration/export-named-as-specifier/expected.json b/test/fixtures/esprima/es2015-export-declaration/export-named-as-specifier/expected.json new file mode 100644 index 0000000000..0b4b274d42 --- /dev/null +++ b/test/fixtures/esprima/es2015-export-declaration/export-named-as-specifier/expected.json @@ -0,0 +1,99 @@ +{ + "type": "File", + "start": 0, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "sourceType": "module", + "body": [ + { + "type": "ExportNamedDeclaration", + "start": 0, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "declaration": null, + "specifiers": [ + { + "type": "ExportSpecifier", + "start": 8, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "local": { + "type": "Identifier", + "start": 8, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "name": "foo" + }, + "exported": { + "type": "Identifier", + "start": 15, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "name": "bar" + } + } + ], + "source": null + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-export-declaration/export-named-as-specifiers/actual.js b/test/fixtures/esprima/es2015-export-declaration/export-named-as-specifiers/actual.js new file mode 100644 index 0000000000..ff57927839 --- /dev/null +++ b/test/fixtures/esprima/es2015-export-declaration/export-named-as-specifiers/actual.js @@ -0,0 +1 @@ +export {foo as default, bar}; diff --git a/test/fixtures/esprima/es2015-export-declaration/export-named-as-specifiers/expected.json b/test/fixtures/esprima/es2015-export-declaration/export-named-as-specifiers/expected.json new file mode 100644 index 0000000000..35d224c0d9 --- /dev/null +++ b/test/fixtures/esprima/es2015-export-declaration/export-named-as-specifiers/expected.json @@ -0,0 +1,146 @@ +{ + "type": "File", + "start": 0, + "end": 29, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 29 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 29, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 29 + } + }, + "sourceType": "module", + "body": [ + { + "type": "ExportNamedDeclaration", + "start": 0, + "end": 29, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 29 + } + }, + "declaration": null, + "specifiers": [ + { + "type": "ExportSpecifier", + "start": 8, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "local": { + "type": "Identifier", + "start": 8, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "name": "foo" + }, + "exported": { + "type": "Identifier", + "start": 15, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "name": "default" + } + }, + { + "type": "ExportSpecifier", + "start": 24, + "end": 27, + "loc": { + "start": { + "line": 1, + "column": 24 + }, + "end": { + "line": 1, + "column": 27 + } + }, + "local": { + "type": "Identifier", + "start": 24, + "end": 27, + "loc": { + "start": { + "line": 1, + "column": 24 + }, + "end": { + "line": 1, + "column": 27 + } + }, + "name": "bar" + }, + "exported": { + "type": "Identifier", + "start": 24, + "end": 27, + "loc": { + "start": { + "line": 1, + "column": 24 + }, + "end": { + "line": 1, + "column": 27 + } + }, + "name": "bar" + } + } + ], + "source": null + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-export-declaration/export-named-empty/actual.js b/test/fixtures/esprima/es2015-export-declaration/export-named-empty/actual.js new file mode 100644 index 0000000000..cb0ff5c3b5 --- /dev/null +++ b/test/fixtures/esprima/es2015-export-declaration/export-named-empty/actual.js @@ -0,0 +1 @@ +export {}; diff --git a/test/fixtures/esprima/es2015-export-declaration/export-named-empty/expected.json b/test/fixtures/esprima/es2015-export-declaration/export-named-empty/expected.json new file mode 100644 index 0000000000..7c7d2cfb8b --- /dev/null +++ b/test/fixtures/esprima/es2015-export-declaration/export-named-empty/expected.json @@ -0,0 +1,51 @@ +{ + "type": "File", + "start": 0, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "sourceType": "module", + "body": [ + { + "type": "ExportNamedDeclaration", + "start": 0, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "declaration": null, + "specifiers": [], + "source": null + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-export-declaration/export-named-specifier/actual.js b/test/fixtures/esprima/es2015-export-declaration/export-named-specifier/actual.js new file mode 100644 index 0000000000..df5f5e609e --- /dev/null +++ b/test/fixtures/esprima/es2015-export-declaration/export-named-specifier/actual.js @@ -0,0 +1 @@ +export {foo}; diff --git a/test/fixtures/esprima/es2015-export-declaration/export-named-specifier/expected.json b/test/fixtures/esprima/es2015-export-declaration/export-named-specifier/expected.json new file mode 100644 index 0000000000..923c934a26 --- /dev/null +++ b/test/fixtures/esprima/es2015-export-declaration/export-named-specifier/expected.json @@ -0,0 +1,99 @@ +{ + "type": "File", + "start": 0, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "sourceType": "module", + "body": [ + { + "type": "ExportNamedDeclaration", + "start": 0, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "declaration": null, + "specifiers": [ + { + "type": "ExportSpecifier", + "start": 8, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "local": { + "type": "Identifier", + "start": 8, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "name": "foo" + }, + "exported": { + "type": "Identifier", + "start": 8, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "name": "foo" + } + } + ], + "source": null + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-export-declaration/export-named-specifiers-comma/actual.js b/test/fixtures/esprima/es2015-export-declaration/export-named-specifiers-comma/actual.js new file mode 100644 index 0000000000..61bc40fd77 --- /dev/null +++ b/test/fixtures/esprima/es2015-export-declaration/export-named-specifiers-comma/actual.js @@ -0,0 +1 @@ +export {foo, bar,}; diff --git a/test/fixtures/esprima/es2015-export-declaration/export-named-specifiers-comma/expected.json b/test/fixtures/esprima/es2015-export-declaration/export-named-specifiers-comma/expected.json new file mode 100644 index 0000000000..0694002dce --- /dev/null +++ b/test/fixtures/esprima/es2015-export-declaration/export-named-specifiers-comma/expected.json @@ -0,0 +1,146 @@ +{ + "type": "File", + "start": 0, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 19 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 19 + } + }, + "sourceType": "module", + "body": [ + { + "type": "ExportNamedDeclaration", + "start": 0, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 19 + } + }, + "declaration": null, + "specifiers": [ + { + "type": "ExportSpecifier", + "start": 8, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "local": { + "type": "Identifier", + "start": 8, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "name": "foo" + }, + "exported": { + "type": "Identifier", + "start": 8, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "name": "foo" + } + }, + { + "type": "ExportSpecifier", + "start": 13, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "local": { + "type": "Identifier", + "start": 13, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "name": "bar" + }, + "exported": { + "type": "Identifier", + "start": 13, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "name": "bar" + } + } + ], + "source": null + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-export-declaration/export-named-specifiers/actual.js b/test/fixtures/esprima/es2015-export-declaration/export-named-specifiers/actual.js new file mode 100644 index 0000000000..fdbc942750 --- /dev/null +++ b/test/fixtures/esprima/es2015-export-declaration/export-named-specifiers/actual.js @@ -0,0 +1 @@ +export {foo, bar}; diff --git a/test/fixtures/esprima/es2015-export-declaration/export-named-specifiers/expected.json b/test/fixtures/esprima/es2015-export-declaration/export-named-specifiers/expected.json new file mode 100644 index 0000000000..745d2e9d0b --- /dev/null +++ b/test/fixtures/esprima/es2015-export-declaration/export-named-specifiers/expected.json @@ -0,0 +1,146 @@ +{ + "type": "File", + "start": 0, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "sourceType": "module", + "body": [ + { + "type": "ExportNamedDeclaration", + "start": 0, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "declaration": null, + "specifiers": [ + { + "type": "ExportSpecifier", + "start": 8, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "local": { + "type": "Identifier", + "start": 8, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "name": "foo" + }, + "exported": { + "type": "Identifier", + "start": 8, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "name": "foo" + } + }, + { + "type": "ExportSpecifier", + "start": 13, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "local": { + "type": "Identifier", + "start": 13, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "name": "bar" + }, + "exported": { + "type": "Identifier", + "start": 13, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "name": "bar" + } + } + ], + "source": null + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-export-declaration/export-var-anonymous-function/actual.js b/test/fixtures/esprima/es2015-export-declaration/export-var-anonymous-function/actual.js new file mode 100644 index 0000000000..f8af288212 --- /dev/null +++ b/test/fixtures/esprima/es2015-export-declaration/export-var-anonymous-function/actual.js @@ -0,0 +1 @@ +export var foo = function () {}; diff --git a/test/fixtures/esprima/es2015-export-declaration/export-var-anonymous-function/expected.json b/test/fixtures/esprima/es2015-export-declaration/export-var-anonymous-function/expected.json new file mode 100644 index 0000000000..130b99c96e --- /dev/null +++ b/test/fixtures/esprima/es2015-export-declaration/export-var-anonymous-function/expected.json @@ -0,0 +1,134 @@ +{ + "type": "File", + "start": 0, + "end": 32, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 32 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 32, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 32 + } + }, + "sourceType": "module", + "body": [ + { + "type": "ExportNamedDeclaration", + "start": 0, + "end": 32, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 32 + } + }, + "specifiers": [], + "source": null, + "declaration": { + "type": "VariableDeclaration", + "start": 7, + "end": 32, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 32 + } + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 11, + "end": 31, + "loc": { + "start": { + "line": 1, + "column": 11 + }, + "end": { + "line": 1, + "column": 31 + } + }, + "id": { + "type": "Identifier", + "start": 11, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 11 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "name": "foo" + }, + "init": { + "type": "FunctionExpression", + "start": 17, + "end": 31, + "loc": { + "start": { + "line": 1, + "column": 17 + }, + "end": { + "line": 1, + "column": 31 + } + }, + "id": null, + "generator": false, + "expression": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 29, + "end": 31, + "loc": { + "start": { + "line": 1, + "column": 29 + }, + "end": { + "line": 1, + "column": 31 + } + }, + "body": [] + } + } + } + ], + "kind": "var" + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-export-declaration/export-var-number/actual.js b/test/fixtures/esprima/es2015-export-declaration/export-var-number/actual.js new file mode 100644 index 0000000000..e2e71aa4fc --- /dev/null +++ b/test/fixtures/esprima/es2015-export-declaration/export-var-number/actual.js @@ -0,0 +1 @@ +export var foo = 1; diff --git a/test/fixtures/esprima/es2015-export-declaration/export-var-number/expected.json b/test/fixtures/esprima/es2015-export-declaration/export-var-number/expected.json new file mode 100644 index 0000000000..af2ce633cb --- /dev/null +++ b/test/fixtures/esprima/es2015-export-declaration/export-var-number/expected.json @@ -0,0 +1,117 @@ +{ + "type": "File", + "start": 0, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 19 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 19 + } + }, + "sourceType": "module", + "body": [ + { + "type": "ExportNamedDeclaration", + "start": 0, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 19 + } + }, + "specifiers": [], + "source": null, + "declaration": { + "type": "VariableDeclaration", + "start": 7, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 19 + } + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 11, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 11 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "id": { + "type": "Identifier", + "start": 11, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 11 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "name": "foo" + }, + "init": { + "type": "Literal", + "start": 17, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 17 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "value": 1, + "rawValue": 1, + "raw": "1" + } + } + ], + "kind": "var" + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-export-declaration/export-var/actual.js b/test/fixtures/esprima/es2015-export-declaration/export-var/actual.js new file mode 100644 index 0000000000..62da3e6018 --- /dev/null +++ b/test/fixtures/esprima/es2015-export-declaration/export-var/actual.js @@ -0,0 +1 @@ +export var bar; diff --git a/test/fixtures/esprima/es2015-export-declaration/export-var/expected.json b/test/fixtures/esprima/es2015-export-declaration/export-var/expected.json new file mode 100644 index 0000000000..22ba6ec97b --- /dev/null +++ b/test/fixtures/esprima/es2015-export-declaration/export-var/expected.json @@ -0,0 +1,100 @@ +{ + "type": "File", + "start": 0, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "sourceType": "module", + "body": [ + { + "type": "ExportNamedDeclaration", + "start": 0, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "specifiers": [], + "source": null, + "declaration": { + "type": "VariableDeclaration", + "start": 7, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 11, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 11 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "id": { + "type": "Identifier", + "start": 11, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 11 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "name": "bar" + }, + "init": null + } + ], + "kind": "var" + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-export-declaration/invalid-export-batch-missing-from-clause/actual.js b/test/fixtures/esprima/es2015-export-declaration/invalid-export-batch-missing-from-clause/actual.js new file mode 100644 index 0000000000..3f576881e6 --- /dev/null +++ b/test/fixtures/esprima/es2015-export-declaration/invalid-export-batch-missing-from-clause/actual.js @@ -0,0 +1 @@ +export * diff --git a/test/fixtures/esprima/es2015-export-declaration/invalid-export-batch-missing-from-clause/options.json b/test/fixtures/esprima/es2015-export-declaration/invalid-export-batch-missing-from-clause/options.json new file mode 100644 index 0000000000..65ef4a184a --- /dev/null +++ b/test/fixtures/esprima/es2015-export-declaration/invalid-export-batch-missing-from-clause/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Unexpected token (1:8)" +} \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-export-declaration/invalid-export-batch-token/actual.js b/test/fixtures/esprima/es2015-export-declaration/invalid-export-batch-token/actual.js new file mode 100644 index 0000000000..32cb28ea92 --- /dev/null +++ b/test/fixtures/esprima/es2015-export-declaration/invalid-export-batch-token/actual.js @@ -0,0 +1 @@ +export * + diff --git a/test/fixtures/esprima/es2015-export-declaration/invalid-export-batch-token/options.json b/test/fixtures/esprima/es2015-export-declaration/invalid-export-batch-token/options.json new file mode 100644 index 0000000000..93db7641c7 --- /dev/null +++ b/test/fixtures/esprima/es2015-export-declaration/invalid-export-batch-token/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Unexpected token (1:9)" +} \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-export-declaration/invalid-export-default-equal/actual.js b/test/fixtures/esprima/es2015-export-declaration/invalid-export-default-equal/actual.js new file mode 100644 index 0000000000..0dfb038eb5 --- /dev/null +++ b/test/fixtures/esprima/es2015-export-declaration/invalid-export-default-equal/actual.js @@ -0,0 +1 @@ +export default = 42 diff --git a/test/fixtures/esprima/es2015-export-declaration/invalid-export-default-equal/options.json b/test/fixtures/esprima/es2015-export-declaration/invalid-export-default-equal/options.json new file mode 100644 index 0000000000..7ca1e1ffbb --- /dev/null +++ b/test/fixtures/esprima/es2015-export-declaration/invalid-export-default-equal/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Unexpected token (1:15)" +} \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-export-declaration/invalid-export-default-token/actual.js b/test/fixtures/esprima/es2015-export-declaration/invalid-export-default-token/actual.js new file mode 100644 index 0000000000..a0af03d2e6 --- /dev/null +++ b/test/fixtures/esprima/es2015-export-declaration/invalid-export-default-token/actual.js @@ -0,0 +1 @@ +export {default} + diff --git a/test/fixtures/esprima/es2015-export-declaration/invalid-export-default-token/options.json b/test/fixtures/esprima/es2015-export-declaration/invalid-export-default-token/options.json new file mode 100644 index 0000000000..8bb9a5f99b --- /dev/null +++ b/test/fixtures/esprima/es2015-export-declaration/invalid-export-default-token/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Unexpected token (1:17)" +} \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-export-declaration/invalid-export-default/actual.js b/test/fixtures/esprima/es2015-export-declaration/invalid-export-default/actual.js new file mode 100644 index 0000000000..8dfa0a19a9 --- /dev/null +++ b/test/fixtures/esprima/es2015-export-declaration/invalid-export-default/actual.js @@ -0,0 +1 @@ +export default from "foo" diff --git a/test/fixtures/esprima/es2015-export-declaration/invalid-export-default/options.json b/test/fixtures/esprima/es2015-export-declaration/invalid-export-default/options.json new file mode 100644 index 0000000000..aca079ee39 --- /dev/null +++ b/test/fixtures/esprima/es2015-export-declaration/invalid-export-default/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Unexpected token (1:20)" +} \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-export-declaration/invalid-export-named-default/actual.js b/test/fixtures/esprima/es2015-export-declaration/invalid-export-named-default/actual.js new file mode 100644 index 0000000000..8f3cde5c96 --- /dev/null +++ b/test/fixtures/esprima/es2015-export-declaration/invalid-export-named-default/actual.js @@ -0,0 +1 @@ +export {default} diff --git a/test/fixtures/esprima/es2015-export-declaration/invalid-export-named-default/options.json b/test/fixtures/esprima/es2015-export-declaration/invalid-export-named-default/options.json new file mode 100644 index 0000000000..4c07f39d17 --- /dev/null +++ b/test/fixtures/esprima/es2015-export-declaration/invalid-export-named-default/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Unexpected token (1:16)" +} diff --git a/test/fixtures/esprima/es2015-export-declaration/options.json b/test/fixtures/esprima/es2015-export-declaration/options.json new file mode 100644 index 0000000000..2104ca4328 --- /dev/null +++ b/test/fixtures/esprima/es2015-export-declaration/options.json @@ -0,0 +1,3 @@ +{ + "sourceType": "module" +} diff --git a/test/fixtures/esprima/es2015-for-of/for-of-array-pattern-let/actual.js b/test/fixtures/esprima/es2015-for-of/for-of-array-pattern-let/actual.js new file mode 100644 index 0000000000..a8c67fc5f7 --- /dev/null +++ b/test/fixtures/esprima/es2015-for-of/for-of-array-pattern-let/actual.js @@ -0,0 +1 @@ +for (let [p, q] of r); diff --git a/test/fixtures/esprima/es2015-for-of/for-of-array-pattern-let/expected.json b/test/fixtures/esprima/es2015-for-of/for-of-array-pattern-let/expected.json new file mode 100644 index 0000000000..f81b113841 --- /dev/null +++ b/test/fixtures/esprima/es2015-for-of/for-of-array-pattern-let/expected.json @@ -0,0 +1,162 @@ +{ + "type": "File", + "start": 0, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ForOfStatement", + "start": 0, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "left": { + "type": "VariableDeclaration", + "start": 5, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 9, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "id": { + "type": "ArrayPattern", + "start": 9, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "elements": [ + { + "type": "Identifier", + "start": 10, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "name": "p" + }, + { + "type": "Identifier", + "start": 13, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "name": "q" + } + ] + }, + "init": null + } + ], + "kind": "let" + }, + "right": { + "type": "Identifier", + "start": 19, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 19 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "name": "r" + }, + "body": { + "type": "EmptyStatement", + "start": 21, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 21 + }, + "end": { + "line": 1, + "column": 22 + } + } + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-for-of/for-of-array-pattern/actual.js b/test/fixtures/esprima/es2015-for-of/for-of-array-pattern/actual.js new file mode 100644 index 0000000000..9d98abad0c --- /dev/null +++ b/test/fixtures/esprima/es2015-for-of/for-of-array-pattern/actual.js @@ -0,0 +1 @@ +for ([p, q] of r); diff --git a/test/fixtures/esprima/es2015-for-of/for-of-array-pattern/expected.json b/test/fixtures/esprima/es2015-for-of/for-of-array-pattern/expected.json new file mode 100644 index 0000000000..c174207c6b --- /dev/null +++ b/test/fixtures/esprima/es2015-for-of/for-of-array-pattern/expected.json @@ -0,0 +1,128 @@ +{ + "type": "File", + "start": 0, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ForOfStatement", + "start": 0, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "left": { + "type": "ArrayPattern", + "start": 5, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "elements": [ + { + "type": "Identifier", + "start": 6, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "name": "p" + }, + { + "type": "Identifier", + "start": 9, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "name": "q" + } + ] + }, + "right": { + "type": "Identifier", + "start": 15, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "name": "r" + }, + "body": { + "type": "EmptyStatement", + "start": 17, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 17 + }, + "end": { + "line": 1, + "column": 18 + } + } + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-for-of/for-of-object-pattern-const/actual.js b/test/fixtures/esprima/es2015-for-of/for-of-object-pattern-const/actual.js new file mode 100644 index 0000000000..05db80eefc --- /dev/null +++ b/test/fixtures/esprima/es2015-for-of/for-of-object-pattern-const/actual.js @@ -0,0 +1 @@ +for (const {x, y} of z); diff --git a/test/fixtures/esprima/es2015-for-of/for-of-object-pattern-const/expected.json b/test/fixtures/esprima/es2015-for-of/for-of-object-pattern-const/expected.json new file mode 100644 index 0000000000..2fcb51b5b1 --- /dev/null +++ b/test/fixtures/esprima/es2015-for-of/for-of-object-pattern-const/expected.json @@ -0,0 +1,232 @@ +{ + "type": "File", + "start": 0, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 24 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 24 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ForOfStatement", + "start": 0, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 24 + } + }, + "left": { + "type": "VariableDeclaration", + "start": 5, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 11, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 11 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "id": { + "type": "ObjectPattern", + "start": 11, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 11 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "properties": [ + { + "type": "Property", + "start": 12, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 12 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "method": false, + "shorthand": true, + "computed": false, + "key": { + "type": "Identifier", + "start": 12, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 12 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "name": "x" + }, + "kind": "init", + "value": { + "type": "Identifier", + "start": 12, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 12 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "name": "x" + } + }, + { + "type": "Property", + "start": 15, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "method": false, + "shorthand": true, + "computed": false, + "key": { + "type": "Identifier", + "start": 15, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "name": "y" + }, + "kind": "init", + "value": { + "type": "Identifier", + "start": 15, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "name": "y" + } + } + ] + }, + "init": null + } + ], + "kind": "const" + }, + "right": { + "type": "Identifier", + "start": 21, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 21 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "name": "z" + }, + "body": { + "type": "EmptyStatement", + "start": 23, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 23 + }, + "end": { + "line": 1, + "column": 24 + } + } + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-for-of/for-of-object-pattern/actual.js b/test/fixtures/esprima/es2015-for-of/for-of-object-pattern/actual.js new file mode 100644 index 0000000000..a96674542a --- /dev/null +++ b/test/fixtures/esprima/es2015-for-of/for-of-object-pattern/actual.js @@ -0,0 +1 @@ +for ({x, y} of z); diff --git a/test/fixtures/esprima/es2015-for-of/for-of-object-pattern/expected.json b/test/fixtures/esprima/es2015-for-of/for-of-object-pattern/expected.json new file mode 100644 index 0000000000..9cfd59a3ab --- /dev/null +++ b/test/fixtures/esprima/es2015-for-of/for-of-object-pattern/expected.json @@ -0,0 +1,198 @@ +{ + "type": "File", + "start": 0, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ForOfStatement", + "start": 0, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "left": { + "type": "ObjectPattern", + "start": 5, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "properties": [ + { + "type": "Property", + "start": 6, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "method": false, + "shorthand": true, + "computed": false, + "key": { + "type": "Identifier", + "start": 6, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "name": "x" + }, + "kind": "init", + "value": { + "type": "Identifier", + "start": 6, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "name": "x" + } + }, + { + "type": "Property", + "start": 9, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "method": false, + "shorthand": true, + "computed": false, + "key": { + "type": "Identifier", + "start": 9, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "name": "y" + }, + "kind": "init", + "value": { + "type": "Identifier", + "start": 9, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "name": "y" + } + } + ] + }, + "right": { + "type": "Identifier", + "start": 15, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "name": "z" + }, + "body": { + "type": "EmptyStatement", + "start": 17, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 17 + }, + "end": { + "line": 1, + "column": 18 + } + } + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-for-of/for-of-with-const/actual.js b/test/fixtures/esprima/es2015-for-of/for-of-with-const/actual.js new file mode 100644 index 0000000000..3cb53e5e6e --- /dev/null +++ b/test/fixtures/esprima/es2015-for-of/for-of-with-const/actual.js @@ -0,0 +1 @@ +for (const y of list); diff --git a/test/fixtures/esprima/es2015-for-of/for-of-with-const/expected.json b/test/fixtures/esprima/es2015-for-of/for-of-with-const/expected.json new file mode 100644 index 0000000000..7608d6e366 --- /dev/null +++ b/test/fixtures/esprima/es2015-for-of/for-of-with-const/expected.json @@ -0,0 +1,129 @@ +{ + "type": "File", + "start": 0, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ForOfStatement", + "start": 0, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "left": { + "type": "VariableDeclaration", + "start": 5, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 11, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 11 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "id": { + "type": "Identifier", + "start": 11, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 11 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "name": "y" + }, + "init": null + } + ], + "kind": "const" + }, + "right": { + "type": "Identifier", + "start": 16, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 16 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "name": "list" + }, + "body": { + "type": "EmptyStatement", + "start": 21, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 21 + }, + "end": { + "line": 1, + "column": 22 + } + } + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-for-of/for-of-with-let/actual.js b/test/fixtures/esprima/es2015-for-of/for-of-with-let/actual.js new file mode 100644 index 0000000000..4596dd4be2 --- /dev/null +++ b/test/fixtures/esprima/es2015-for-of/for-of-with-let/actual.js @@ -0,0 +1 @@ +for (let z of list); diff --git a/test/fixtures/esprima/es2015-for-of/for-of-with-let/expected.json b/test/fixtures/esprima/es2015-for-of/for-of-with-let/expected.json new file mode 100644 index 0000000000..f48045b006 --- /dev/null +++ b/test/fixtures/esprima/es2015-for-of/for-of-with-let/expected.json @@ -0,0 +1,129 @@ +{ + "type": "File", + "start": 0, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ForOfStatement", + "start": 0, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "left": { + "type": "VariableDeclaration", + "start": 5, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 9, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "id": { + "type": "Identifier", + "start": 9, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "name": "z" + }, + "init": null + } + ], + "kind": "let" + }, + "right": { + "type": "Identifier", + "start": 14, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 14 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "name": "list" + }, + "body": { + "type": "EmptyStatement", + "start": 19, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 19 + }, + "end": { + "line": 1, + "column": 20 + } + } + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-for-of/for-of-with-var/actual.js b/test/fixtures/esprima/es2015-for-of/for-of-with-var/actual.js new file mode 100644 index 0000000000..1bd32300f2 --- /dev/null +++ b/test/fixtures/esprima/es2015-for-of/for-of-with-var/actual.js @@ -0,0 +1 @@ +for (var x of list); diff --git a/test/fixtures/esprima/es2015-for-of/for-of-with-var/expected.json b/test/fixtures/esprima/es2015-for-of/for-of-with-var/expected.json new file mode 100644 index 0000000000..75eaef11cf --- /dev/null +++ b/test/fixtures/esprima/es2015-for-of/for-of-with-var/expected.json @@ -0,0 +1,129 @@ +{ + "type": "File", + "start": 0, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ForOfStatement", + "start": 0, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "left": { + "type": "VariableDeclaration", + "start": 5, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 9, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "id": { + "type": "Identifier", + "start": 9, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "name": "x" + }, + "init": null + } + ], + "kind": "var" + }, + "right": { + "type": "Identifier", + "start": 14, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 14 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "name": "list" + }, + "body": { + "type": "EmptyStatement", + "start": 19, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 19 + }, + "end": { + "line": 1, + "column": 20 + } + } + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-for-of/for-of/actual.js b/test/fixtures/esprima/es2015-for-of/for-of/actual.js new file mode 100644 index 0000000000..61d83114bd --- /dev/null +++ b/test/fixtures/esprima/es2015-for-of/for-of/actual.js @@ -0,0 +1 @@ +for (p of q); diff --git a/test/fixtures/esprima/es2015-for-of/for-of/expected.json b/test/fixtures/esprima/es2015-for-of/for-of/expected.json new file mode 100644 index 0000000000..32de26d7ac --- /dev/null +++ b/test/fixtures/esprima/es2015-for-of/for-of/expected.json @@ -0,0 +1,95 @@ +{ + "type": "File", + "start": 0, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ForOfStatement", + "start": 0, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "left": { + "type": "Identifier", + "start": 5, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "name": "p" + }, + "right": { + "type": "Identifier", + "start": 10, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "name": "q" + }, + "body": { + "type": "EmptyStatement", + "start": 12, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 12 + }, + "end": { + "line": 1, + "column": 13 + } + } + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-for-of/invalid-const-init/actual.js b/test/fixtures/esprima/es2015-for-of/invalid-const-init/actual.js new file mode 100644 index 0000000000..802142b398 --- /dev/null +++ b/test/fixtures/esprima/es2015-for-of/invalid-const-init/actual.js @@ -0,0 +1 @@ +for (const x = 1 of y); diff --git a/test/fixtures/esprima/es2015-for-of/invalid-const-init/options.json b/test/fixtures/esprima/es2015-for-of/invalid-const-init/options.json new file mode 100644 index 0000000000..8bb9a5f99b --- /dev/null +++ b/test/fixtures/esprima/es2015-for-of/invalid-const-init/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Unexpected token (1:17)" +} \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-for-of/invalid-let-init/actual.js b/test/fixtures/esprima/es2015-for-of/invalid-let-init/actual.js new file mode 100644 index 0000000000..16c9d38843 --- /dev/null +++ b/test/fixtures/esprima/es2015-for-of/invalid-let-init/actual.js @@ -0,0 +1 @@ +for (let x = 1 of y); diff --git a/test/fixtures/esprima/es2015-for-of/invalid-let-init/options.json b/test/fixtures/esprima/es2015-for-of/invalid-let-init/options.json new file mode 100644 index 0000000000..7ca1e1ffbb --- /dev/null +++ b/test/fixtures/esprima/es2015-for-of/invalid-let-init/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Unexpected token (1:15)" +} \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-for-of/invalid-lhs-init/actual.js b/test/fixtures/esprima/es2015-for-of/invalid-lhs-init/actual.js new file mode 100644 index 0000000000..9150592412 --- /dev/null +++ b/test/fixtures/esprima/es2015-for-of/invalid-lhs-init/actual.js @@ -0,0 +1 @@ +for (this of that); diff --git a/test/fixtures/esprima/es2015-for-of/invalid-lhs-init/options.json b/test/fixtures/esprima/es2015-for-of/invalid-lhs-init/options.json new file mode 100644 index 0000000000..85f6f01102 --- /dev/null +++ b/test/fixtures/esprima/es2015-for-of/invalid-lhs-init/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Assigning to rvalue (1:5)" +} \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-for-of/invalid-var-init/actual.js b/test/fixtures/esprima/es2015-for-of/invalid-var-init/actual.js new file mode 100644 index 0000000000..2b5eb5d3df --- /dev/null +++ b/test/fixtures/esprima/es2015-for-of/invalid-var-init/actual.js @@ -0,0 +1 @@ +for (var x = 1 of y); diff --git a/test/fixtures/esprima/es2015-for-of/invalid-var-init/expected.json b/test/fixtures/esprima/es2015-for-of/invalid-var-init/expected.json new file mode 100644 index 0000000000..eec137e3bc --- /dev/null +++ b/test/fixtures/esprima/es2015-for-of/invalid-var-init/expected.json @@ -0,0 +1,146 @@ +{ + "type": "File", + "start": 0, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 21 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 21 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ForOfStatement", + "start": 0, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 21 + } + }, + "left": { + "type": "VariableDeclaration", + "start": 5, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 9, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "id": { + "type": "Identifier", + "start": 9, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "name": "x" + }, + "init": { + "type": "Literal", + "start": 13, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "value": 1, + "rawValue": 1, + "raw": "1" + } + } + ], + "kind": "var" + }, + "right": { + "type": "Identifier", + "start": 18, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 18 + }, + "end": { + "line": 1, + "column": 19 + } + }, + "name": "y" + }, + "body": { + "type": "EmptyStatement", + "start": 20, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 20 + }, + "end": { + "line": 1, + "column": 21 + } + } + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-for-of/invalid-var-init/options.json b/test/fixtures/esprima/es2015-for-of/invalid-var-init/options.json new file mode 100644 index 0000000000..89e36d9013 --- /dev/null +++ b/test/fixtures/esprima/es2015-for-of/invalid-var-init/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Unexpected token (1:16)" +} \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-for-of/let-of-of/actual.js b/test/fixtures/esprima/es2015-for-of/let-of-of/actual.js new file mode 100644 index 0000000000..cbc3509ff4 --- /dev/null +++ b/test/fixtures/esprima/es2015-for-of/let-of-of/actual.js @@ -0,0 +1 @@ +for (let of of xyz); diff --git a/test/fixtures/esprima/es2015-for-of/let-of-of/expected.json b/test/fixtures/esprima/es2015-for-of/let-of-of/expected.json new file mode 100644 index 0000000000..1af67a2a58 --- /dev/null +++ b/test/fixtures/esprima/es2015-for-of/let-of-of/expected.json @@ -0,0 +1,129 @@ +{ + "type": "File", + "start": 0, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ForOfStatement", + "start": 0, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "left": { + "type": "VariableDeclaration", + "start": 5, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 9, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "id": { + "type": "Identifier", + "start": 9, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "name": "of" + }, + "init": null + } + ], + "kind": "let" + }, + "right": { + "type": "Identifier", + "start": 15, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "name": "xyz" + }, + "body": { + "type": "EmptyStatement", + "start": 19, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 19 + }, + "end": { + "line": 1, + "column": 20 + } + } + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-for-of/unexpected-number/actual.js b/test/fixtures/esprima/es2015-for-of/unexpected-number/actual.js new file mode 100644 index 0000000000..c2ff917432 --- /dev/null +++ b/test/fixtures/esprima/es2015-for-of/unexpected-number/actual.js @@ -0,0 +1 @@ +for (const of 42); diff --git a/test/fixtures/esprima/es2015-for-of/unexpected-number/options.json b/test/fixtures/esprima/es2015-for-of/unexpected-number/options.json new file mode 100644 index 0000000000..51c483f3d3 --- /dev/null +++ b/test/fixtures/esprima/es2015-for-of/unexpected-number/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Unexpected token (1:14)" +} \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-generator/generator-declaration-with-params/actual.js b/test/fixtures/esprima/es2015-generator/generator-declaration-with-params/actual.js new file mode 100644 index 0000000000..cdbfd3f4f6 --- /dev/null +++ b/test/fixtures/esprima/es2015-generator/generator-declaration-with-params/actual.js @@ -0,0 +1 @@ +function *foo(x, y, z) {} diff --git a/test/fixtures/esprima/es2015-generator/generator-declaration-with-params/expected.json b/test/fixtures/esprima/es2015-generator/generator-declaration-with-params/expected.json new file mode 100644 index 0000000000..94810ff25f --- /dev/null +++ b/test/fixtures/esprima/es2015-generator/generator-declaration-with-params/expected.json @@ -0,0 +1,132 @@ +{ + "type": "File", + "start": 0, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 25 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 25 + } + }, + "sourceType": "script", + "body": [ + { + "type": "FunctionDeclaration", + "start": 0, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 25 + } + }, + "id": { + "type": "Identifier", + "start": 10, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "name": "foo" + }, + "generator": true, + "expression": false, + "params": [ + { + "type": "Identifier", + "start": 14, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 14 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "name": "x" + }, + { + "type": "Identifier", + "start": 17, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 17 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "name": "y" + }, + { + "type": "Identifier", + "start": 20, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 20 + }, + "end": { + "line": 1, + "column": 21 + } + }, + "name": "z" + } + ], + "body": { + "type": "BlockStatement", + "start": 23, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 23 + }, + "end": { + "line": 1, + "column": 25 + } + }, + "body": [] + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-generator/generator-declaration-with-yield-delegate/actual.js b/test/fixtures/esprima/es2015-generator/generator-declaration-with-yield-delegate/actual.js new file mode 100644 index 0000000000..fd4f8e1962 --- /dev/null +++ b/test/fixtures/esprima/es2015-generator/generator-declaration-with-yield-delegate/actual.js @@ -0,0 +1 @@ +function *foo() { yield* 3; } diff --git a/test/fixtures/esprima/es2015-generator/generator-declaration-with-yield-delegate/expected.json b/test/fixtures/esprima/es2015-generator/generator-declaration-with-yield-delegate/expected.json new file mode 100644 index 0000000000..ed91c27238 --- /dev/null +++ b/test/fixtures/esprima/es2015-generator/generator-declaration-with-yield-delegate/expected.json @@ -0,0 +1,133 @@ +{ + "type": "File", + "start": 0, + "end": 29, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 29 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 29, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 29 + } + }, + "sourceType": "script", + "body": [ + { + "type": "FunctionDeclaration", + "start": 0, + "end": 29, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 29 + } + }, + "id": { + "type": "Identifier", + "start": 10, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "name": "foo" + }, + "generator": true, + "expression": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 16, + "end": 29, + "loc": { + "start": { + "line": 1, + "column": 16 + }, + "end": { + "line": 1, + "column": 29 + } + }, + "body": [ + { + "type": "ExpressionStatement", + "start": 18, + "end": 27, + "loc": { + "start": { + "line": 1, + "column": 18 + }, + "end": { + "line": 1, + "column": 27 + } + }, + "expression": { + "type": "YieldExpression", + "start": 18, + "end": 26, + "loc": { + "start": { + "line": 1, + "column": 18 + }, + "end": { + "line": 1, + "column": 26 + } + }, + "delegate": true, + "argument": { + "type": "Literal", + "start": 25, + "end": 26, + "loc": { + "start": { + "line": 1, + "column": 25 + }, + "end": { + "line": 1, + "column": 26 + } + }, + "value": 3, + "rawValue": 3, + "raw": "3" + } + } + } + ] + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-generator/generator-declaration-with-yield/actual.js b/test/fixtures/esprima/es2015-generator/generator-declaration-with-yield/actual.js new file mode 100644 index 0000000000..52ac303f0c --- /dev/null +++ b/test/fixtures/esprima/es2015-generator/generator-declaration-with-yield/actual.js @@ -0,0 +1 @@ +function *foo() { yield 3; } diff --git a/test/fixtures/esprima/es2015-generator/generator-declaration-with-yield/expected.json b/test/fixtures/esprima/es2015-generator/generator-declaration-with-yield/expected.json new file mode 100644 index 0000000000..1e6854a12e --- /dev/null +++ b/test/fixtures/esprima/es2015-generator/generator-declaration-with-yield/expected.json @@ -0,0 +1,133 @@ +{ + "type": "File", + "start": 0, + "end": 28, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 28 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 28, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 28 + } + }, + "sourceType": "script", + "body": [ + { + "type": "FunctionDeclaration", + "start": 0, + "end": 28, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 28 + } + }, + "id": { + "type": "Identifier", + "start": 10, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "name": "foo" + }, + "generator": true, + "expression": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 16, + "end": 28, + "loc": { + "start": { + "line": 1, + "column": 16 + }, + "end": { + "line": 1, + "column": 28 + } + }, + "body": [ + { + "type": "ExpressionStatement", + "start": 18, + "end": 26, + "loc": { + "start": { + "line": 1, + "column": 18 + }, + "end": { + "line": 1, + "column": 26 + } + }, + "expression": { + "type": "YieldExpression", + "start": 18, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 18 + }, + "end": { + "line": 1, + "column": 25 + } + }, + "delegate": false, + "argument": { + "type": "Literal", + "start": 24, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 24 + }, + "end": { + "line": 1, + "column": 25 + } + }, + "value": 3, + "rawValue": 3, + "raw": "3" + } + } + } + ] + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-generator/generator-declaration/actual.js b/test/fixtures/esprima/es2015-generator/generator-declaration/actual.js new file mode 100644 index 0000000000..7c42189626 --- /dev/null +++ b/test/fixtures/esprima/es2015-generator/generator-declaration/actual.js @@ -0,0 +1 @@ +function *foo() {} diff --git a/test/fixtures/esprima/es2015-generator/generator-declaration/expected.json b/test/fixtures/esprima/es2015-generator/generator-declaration/expected.json new file mode 100644 index 0000000000..a222c7d25a --- /dev/null +++ b/test/fixtures/esprima/es2015-generator/generator-declaration/expected.json @@ -0,0 +1,83 @@ +{ + "type": "File", + "start": 0, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "sourceType": "script", + "body": [ + { + "type": "FunctionDeclaration", + "start": 0, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "id": { + "type": "Identifier", + "start": 10, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "name": "foo" + }, + "generator": true, + "expression": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 16, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 16 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "body": [] + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-generator/generator-expression-rest-param/actual.js b/test/fixtures/esprima/es2015-generator/generator-expression-rest-param/actual.js new file mode 100644 index 0000000000..855b74300d --- /dev/null +++ b/test/fixtures/esprima/es2015-generator/generator-expression-rest-param/actual.js @@ -0,0 +1 @@ +(function*(...x) {}) diff --git a/test/fixtures/esprima/es2015-generator/generator-expression-rest-param/expected.json b/test/fixtures/esprima/es2015-generator/generator-expression-rest-param/expected.json new file mode 100644 index 0000000000..cc24e31b58 --- /dev/null +++ b/test/fixtures/esprima/es2015-generator/generator-expression-rest-param/expected.json @@ -0,0 +1,116 @@ +{ + "type": "File", + "start": 0, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "expression": { + "type": "FunctionExpression", + "start": 1, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 19 + } + }, + "id": null, + "generator": true, + "expression": false, + "params": [ + { + "type": "RestElement", + "start": 11, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 11 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "argument": { + "type": "Identifier", + "start": 14, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 14 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "name": "x" + } + } + ], + "body": { + "type": "BlockStatement", + "start": 17, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 17 + }, + "end": { + "line": 1, + "column": 19 + } + }, + "body": [] + }, + "parenthesizedExpression": true + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-generator/generator-expression-with-params/actual.js b/test/fixtures/esprima/es2015-generator/generator-expression-with-params/actual.js new file mode 100644 index 0000000000..49568d61ac --- /dev/null +++ b/test/fixtures/esprima/es2015-generator/generator-expression-with-params/actual.js @@ -0,0 +1 @@ +(function*(x, y, z) {}) diff --git a/test/fixtures/esprima/es2015-generator/generator-expression-with-params/expected.json b/test/fixtures/esprima/es2015-generator/generator-expression-with-params/expected.json new file mode 100644 index 0000000000..0f53a4fd9c --- /dev/null +++ b/test/fixtures/esprima/es2015-generator/generator-expression-with-params/expected.json @@ -0,0 +1,133 @@ +{ + "type": "File", + "start": 0, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "expression": { + "type": "FunctionExpression", + "start": 1, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "id": null, + "generator": true, + "expression": false, + "params": [ + { + "type": "Identifier", + "start": 11, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 11 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "name": "x" + }, + { + "type": "Identifier", + "start": 14, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 14 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "name": "y" + }, + { + "type": "Identifier", + "start": 17, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 17 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "name": "z" + } + ], + "body": { + "type": "BlockStatement", + "start": 20, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 20 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "body": [] + }, + "parenthesizedExpression": true + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-generator/generator-expression-with-yield-delegate/actual.js b/test/fixtures/esprima/es2015-generator/generator-expression-with-yield-delegate/actual.js new file mode 100644 index 0000000000..7d1d130e6b --- /dev/null +++ b/test/fixtures/esprima/es2015-generator/generator-expression-with-yield-delegate/actual.js @@ -0,0 +1 @@ +(function*(x, y, z) { yield* x; }) diff --git a/test/fixtures/esprima/es2015-generator/generator-expression-with-yield-delegate/expected.json b/test/fixtures/esprima/es2015-generator/generator-expression-with-yield-delegate/expected.json new file mode 100644 index 0000000000..4b28752a8f --- /dev/null +++ b/test/fixtures/esprima/es2015-generator/generator-expression-with-yield-delegate/expected.json @@ -0,0 +1,181 @@ +{ + "type": "File", + "start": 0, + "end": 34, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 34 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 34, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 34 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 34, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 34 + } + }, + "expression": { + "type": "FunctionExpression", + "start": 1, + "end": 33, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 33 + } + }, + "id": null, + "generator": true, + "expression": false, + "params": [ + { + "type": "Identifier", + "start": 11, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 11 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "name": "x" + }, + { + "type": "Identifier", + "start": 14, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 14 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "name": "y" + }, + { + "type": "Identifier", + "start": 17, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 17 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "name": "z" + } + ], + "body": { + "type": "BlockStatement", + "start": 20, + "end": 33, + "loc": { + "start": { + "line": 1, + "column": 20 + }, + "end": { + "line": 1, + "column": 33 + } + }, + "body": [ + { + "type": "ExpressionStatement", + "start": 22, + "end": 31, + "loc": { + "start": { + "line": 1, + "column": 22 + }, + "end": { + "line": 1, + "column": 31 + } + }, + "expression": { + "type": "YieldExpression", + "start": 22, + "end": 30, + "loc": { + "start": { + "line": 1, + "column": 22 + }, + "end": { + "line": 1, + "column": 30 + } + }, + "delegate": true, + "argument": { + "type": "Identifier", + "start": 29, + "end": 30, + "loc": { + "start": { + "line": 1, + "column": 29 + }, + "end": { + "line": 1, + "column": 30 + } + }, + "name": "x" + } + } + } + ] + }, + "parenthesizedExpression": true + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-generator/generator-expression-with-yield/actual.js b/test/fixtures/esprima/es2015-generator/generator-expression-with-yield/actual.js new file mode 100644 index 0000000000..9fcc58a8cc --- /dev/null +++ b/test/fixtures/esprima/es2015-generator/generator-expression-with-yield/actual.js @@ -0,0 +1 @@ +(function*() { yield 3; }) diff --git a/test/fixtures/esprima/es2015-generator/generator-expression-with-yield/expected.json b/test/fixtures/esprima/es2015-generator/generator-expression-with-yield/expected.json new file mode 100644 index 0000000000..aada6e0350 --- /dev/null +++ b/test/fixtures/esprima/es2015-generator/generator-expression-with-yield/expected.json @@ -0,0 +1,134 @@ +{ + "type": "File", + "start": 0, + "end": 26, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 26 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 26, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 26 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 26, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 26 + } + }, + "expression": { + "type": "FunctionExpression", + "start": 1, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 25 + } + }, + "id": null, + "generator": true, + "expression": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 13, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 1, + "column": 25 + } + }, + "body": [ + { + "type": "ExpressionStatement", + "start": 15, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "expression": { + "type": "YieldExpression", + "start": 15, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "delegate": false, + "argument": { + "type": "Literal", + "start": 21, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 21 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "value": 3, + "rawValue": 3, + "raw": "3" + } + } + } + ] + }, + "parenthesizedExpression": true + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-generator/generator-expression/actual.js b/test/fixtures/esprima/es2015-generator/generator-expression/actual.js new file mode 100644 index 0000000000..daa6bf5b22 --- /dev/null +++ b/test/fixtures/esprima/es2015-generator/generator-expression/actual.js @@ -0,0 +1 @@ +(function*() {}) diff --git a/test/fixtures/esprima/es2015-generator/generator-expression/expected.json b/test/fixtures/esprima/es2015-generator/generator-expression/expected.json new file mode 100644 index 0000000000..ab58afaeee --- /dev/null +++ b/test/fixtures/esprima/es2015-generator/generator-expression/expected.json @@ -0,0 +1,84 @@ +{ + "type": "File", + "start": 0, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "expression": { + "type": "FunctionExpression", + "start": 1, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "id": null, + "generator": true, + "expression": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 13, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "body": [] + }, + "parenthesizedExpression": true + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-generator/generator-method-with-computed-name/actual.js b/test/fixtures/esprima/es2015-generator/generator-method-with-computed-name/actual.js new file mode 100644 index 0000000000..0739904dc1 --- /dev/null +++ b/test/fixtures/esprima/es2015-generator/generator-method-with-computed-name/actual.js @@ -0,0 +1,3 @@ +(function*() { + { *[yield iter]() {} } +}) diff --git a/test/fixtures/esprima/es2015-generator/generator-method-with-computed-name/options.json b/test/fixtures/esprima/es2015-generator/generator-method-with-computed-name/options.json new file mode 100644 index 0000000000..f86bbd48e9 --- /dev/null +++ b/test/fixtures/esprima/es2015-generator/generator-method-with-computed-name/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Unexpected token (2:6)" +} \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-generator/generator-method-with-invalid-computed-name/actual.js b/test/fixtures/esprima/es2015-generator/generator-method-with-invalid-computed-name/actual.js new file mode 100644 index 0000000000..c55ce55133 --- /dev/null +++ b/test/fixtures/esprima/es2015-generator/generator-method-with-invalid-computed-name/actual.js @@ -0,0 +1 @@ +({ *[yield iter]() {} }) diff --git a/test/fixtures/esprima/es2015-generator/generator-method-with-invalid-computed-name/options.json b/test/fixtures/esprima/es2015-generator/generator-method-with-invalid-computed-name/options.json new file mode 100644 index 0000000000..3e33f7730f --- /dev/null +++ b/test/fixtures/esprima/es2015-generator/generator-method-with-invalid-computed-name/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Unexpected token (1:11)" +} \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-generator/generator-method-with-params/actual.js b/test/fixtures/esprima/es2015-generator/generator-method-with-params/actual.js new file mode 100644 index 0000000000..5d0406edaa --- /dev/null +++ b/test/fixtures/esprima/es2015-generator/generator-method-with-params/actual.js @@ -0,0 +1 @@ +({ *foo(x, y, z) {} }) diff --git a/test/fixtures/esprima/es2015-generator/generator-method-with-params/expected.json b/test/fixtures/esprima/es2015-generator/generator-method-with-params/expected.json new file mode 100644 index 0000000000..d54bbc11a2 --- /dev/null +++ b/test/fixtures/esprima/es2015-generator/generator-method-with-params/expected.json @@ -0,0 +1,185 @@ +{ + "type": "File", + "start": 0, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "expression": { + "type": "ObjectExpression", + "start": 1, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 21 + } + }, + "properties": [ + { + "type": "Property", + "start": 3, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 3 + }, + "end": { + "line": 1, + "column": 19 + } + }, + "method": true, + "shorthand": false, + "computed": false, + "key": { + "type": "Identifier", + "start": 4, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "name": "foo" + }, + "kind": "init", + "value": { + "type": "FunctionExpression", + "start": 7, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 19 + } + }, + "id": null, + "generator": true, + "expression": false, + "params": [ + { + "type": "Identifier", + "start": 8, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "name": "x" + }, + { + "type": "Identifier", + "start": 11, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 11 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "name": "y" + }, + { + "type": "Identifier", + "start": 14, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 14 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "name": "z" + } + ], + "body": { + "type": "BlockStatement", + "start": 17, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 17 + }, + "end": { + "line": 1, + "column": 19 + } + }, + "body": [] + } + } + } + ], + "parenthesizedExpression": true + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-generator/generator-method-with-yield-delegate/actual.js b/test/fixtures/esprima/es2015-generator/generator-method-with-yield-delegate/actual.js new file mode 100644 index 0000000000..84c3ef4bd2 --- /dev/null +++ b/test/fixtures/esprima/es2015-generator/generator-method-with-yield-delegate/actual.js @@ -0,0 +1 @@ +({ *foo() { yield* 3; } }) diff --git a/test/fixtures/esprima/es2015-generator/generator-method-with-yield-delegate/expected.json b/test/fixtures/esprima/es2015-generator/generator-method-with-yield-delegate/expected.json new file mode 100644 index 0000000000..86f538137e --- /dev/null +++ b/test/fixtures/esprima/es2015-generator/generator-method-with-yield-delegate/expected.json @@ -0,0 +1,186 @@ +{ + "type": "File", + "start": 0, + "end": 26, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 26 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 26, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 26 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 26, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 26 + } + }, + "expression": { + "type": "ObjectExpression", + "start": 1, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 25 + } + }, + "properties": [ + { + "type": "Property", + "start": 3, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 3 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "method": true, + "shorthand": false, + "computed": false, + "key": { + "type": "Identifier", + "start": 4, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "name": "foo" + }, + "kind": "init", + "value": { + "type": "FunctionExpression", + "start": 7, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "id": null, + "generator": true, + "expression": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 10, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "body": [ + { + "type": "ExpressionStatement", + "start": 12, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 12 + }, + "end": { + "line": 1, + "column": 21 + } + }, + "expression": { + "type": "YieldExpression", + "start": 12, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 12 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "delegate": true, + "argument": { + "type": "Literal", + "start": 19, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 19 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "value": 3, + "rawValue": 3, + "raw": "3" + } + } + } + ] + } + } + } + ], + "parenthesizedExpression": true + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-generator/generator-method-with-yield-expression/actual.js b/test/fixtures/esprima/es2015-generator/generator-method-with-yield-expression/actual.js new file mode 100644 index 0000000000..e356cfaefc --- /dev/null +++ b/test/fixtures/esprima/es2015-generator/generator-method-with-yield-expression/actual.js @@ -0,0 +1 @@ +({ *foo() { yield 3; } }) diff --git a/test/fixtures/esprima/es2015-generator/generator-method-with-yield-expression/expected.json b/test/fixtures/esprima/es2015-generator/generator-method-with-yield-expression/expected.json new file mode 100644 index 0000000000..652e20d1b3 --- /dev/null +++ b/test/fixtures/esprima/es2015-generator/generator-method-with-yield-expression/expected.json @@ -0,0 +1,186 @@ +{ + "type": "File", + "start": 0, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 25 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 25 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 25 + } + }, + "expression": { + "type": "ObjectExpression", + "start": 1, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 24 + } + }, + "properties": [ + { + "type": "Property", + "start": 3, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 3 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "method": true, + "shorthand": false, + "computed": false, + "key": { + "type": "Identifier", + "start": 4, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "name": "foo" + }, + "kind": "init", + "value": { + "type": "FunctionExpression", + "start": 7, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "id": null, + "generator": true, + "expression": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 10, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "body": [ + { + "type": "ExpressionStatement", + "start": 12, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 12 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "expression": { + "type": "YieldExpression", + "start": 12, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 12 + }, + "end": { + "line": 1, + "column": 19 + } + }, + "delegate": false, + "argument": { + "type": "Literal", + "start": 18, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 18 + }, + "end": { + "line": 1, + "column": 19 + } + }, + "value": 3, + "rawValue": 3, + "raw": "3" + } + } + } + ] + } + } + } + ], + "parenthesizedExpression": true + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-generator/generator-method-with-yield-line-terminator/actual.js b/test/fixtures/esprima/es2015-generator/generator-method-with-yield-line-terminator/actual.js new file mode 100644 index 0000000000..13ebbabcf8 --- /dev/null +++ b/test/fixtures/esprima/es2015-generator/generator-method-with-yield-line-terminator/actual.js @@ -0,0 +1,4 @@ +({ *foo() { + yield + 3 +} }) diff --git a/test/fixtures/esprima/es2015-generator/generator-method-with-yield-line-terminator/expected.json b/test/fixtures/esprima/es2015-generator/generator-method-with-yield-line-terminator/expected.json new file mode 100644 index 0000000000..4fc6768637 --- /dev/null +++ b/test/fixtures/esprima/es2015-generator/generator-method-with-yield-line-terminator/expected.json @@ -0,0 +1,202 @@ +{ + "type": "File", + "start": 0, + "end": 29, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 4, + "column": 4 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 29, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 4, + "column": 4 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 29, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 4, + "column": 4 + } + }, + "expression": { + "type": "ObjectExpression", + "start": 1, + "end": 28, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 4, + "column": 3 + } + }, + "properties": [ + { + "type": "Property", + "start": 3, + "end": 26, + "loc": { + "start": { + "line": 1, + "column": 3 + }, + "end": { + "line": 4, + "column": 1 + } + }, + "method": true, + "shorthand": false, + "computed": false, + "key": { + "type": "Identifier", + "start": 4, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "name": "foo" + }, + "kind": "init", + "value": { + "type": "FunctionExpression", + "start": 7, + "end": 26, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 4, + "column": 1 + } + }, + "id": null, + "generator": true, + "expression": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 10, + "end": 26, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 4, + "column": 1 + } + }, + "body": [ + { + "type": "ExpressionStatement", + "start": 15, + "end": 20, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 2, + "column": 7 + } + }, + "expression": { + "type": "YieldExpression", + "start": 15, + "end": 20, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 2, + "column": 7 + } + }, + "delegate": false, + "argument": null + } + }, + { + "type": "ExpressionStatement", + "start": 23, + "end": 24, + "loc": { + "start": { + "line": 3, + "column": 2 + }, + "end": { + "line": 3, + "column": 3 + } + }, + "expression": { + "type": "Literal", + "start": 23, + "end": 24, + "loc": { + "start": { + "line": 3, + "column": 2 + }, + "end": { + "line": 3, + "column": 3 + } + }, + "value": 3, + "rawValue": 3, + "raw": "3" + } + } + ] + } + } + } + ], + "parenthesizedExpression": true + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-generator/generator-method-with-yield/actual.js b/test/fixtures/esprima/es2015-generator/generator-method-with-yield/actual.js new file mode 100644 index 0000000000..8eea58fd39 --- /dev/null +++ b/test/fixtures/esprima/es2015-generator/generator-method-with-yield/actual.js @@ -0,0 +1 @@ +({ *foo() { yield; } }) diff --git a/test/fixtures/esprima/es2015-generator/generator-method-with-yield/expected.json b/test/fixtures/esprima/es2015-generator/generator-method-with-yield/expected.json new file mode 100644 index 0000000000..dd439657fc --- /dev/null +++ b/test/fixtures/esprima/es2015-generator/generator-method-with-yield/expected.json @@ -0,0 +1,169 @@ +{ + "type": "File", + "start": 0, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "expression": { + "type": "ObjectExpression", + "start": 1, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "properties": [ + { + "type": "Property", + "start": 3, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 3 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "method": true, + "shorthand": false, + "computed": false, + "key": { + "type": "Identifier", + "start": 4, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "name": "foo" + }, + "kind": "init", + "value": { + "type": "FunctionExpression", + "start": 7, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "id": null, + "generator": true, + "expression": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 10, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "body": [ + { + "type": "ExpressionStatement", + "start": 12, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 12 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "expression": { + "type": "YieldExpression", + "start": 12, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 12 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "delegate": false, + "argument": null + } + } + ] + } + } + } + ], + "parenthesizedExpression": true + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-generator/generator-method/actual.js b/test/fixtures/esprima/es2015-generator/generator-method/actual.js new file mode 100644 index 0000000000..c6a22b0ea4 --- /dev/null +++ b/test/fixtures/esprima/es2015-generator/generator-method/actual.js @@ -0,0 +1 @@ +({ *foo() {} }) diff --git a/test/fixtures/esprima/es2015-generator/generator-method/expected.json b/test/fixtures/esprima/es2015-generator/generator-method/expected.json new file mode 100644 index 0000000000..ce2bcad3ea --- /dev/null +++ b/test/fixtures/esprima/es2015-generator/generator-method/expected.json @@ -0,0 +1,136 @@ +{ + "type": "File", + "start": 0, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "expression": { + "type": "ObjectExpression", + "start": 1, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "properties": [ + { + "type": "Property", + "start": 3, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 3 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "method": true, + "shorthand": false, + "computed": false, + "key": { + "type": "Identifier", + "start": 4, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "name": "foo" + }, + "kind": "init", + "value": { + "type": "FunctionExpression", + "start": 7, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "id": null, + "generator": true, + "expression": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 10, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "body": [] + } + } + } + ], + "parenthesizedExpression": true + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-generator/generator-parameter-binding-element/actual.js b/test/fixtures/esprima/es2015-generator/generator-parameter-binding-element/actual.js new file mode 100644 index 0000000000..c8bbdf1d0e --- /dev/null +++ b/test/fixtures/esprima/es2015-generator/generator-parameter-binding-element/actual.js @@ -0,0 +1,3 @@ +(function*() { + function(x = yield 3) {} +}) diff --git a/test/fixtures/esprima/es2015-generator/generator-parameter-binding-element/options.json b/test/fixtures/esprima/es2015-generator/generator-parameter-binding-element/options.json new file mode 100644 index 0000000000..690a8e9e31 --- /dev/null +++ b/test/fixtures/esprima/es2015-generator/generator-parameter-binding-element/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Unexpected token (2:12)" +} \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-generator/generator-parameter-binding-property-reserved/actual.js b/test/fixtures/esprima/es2015-generator/generator-parameter-binding-property-reserved/actual.js new file mode 100644 index 0000000000..d36f1062d1 --- /dev/null +++ b/test/fixtures/esprima/es2015-generator/generator-parameter-binding-property-reserved/actual.js @@ -0,0 +1 @@ +(function*({yield}) {}) diff --git a/test/fixtures/esprima/es2015-generator/generator-parameter-binding-property-reserved/options.json b/test/fixtures/esprima/es2015-generator/generator-parameter-binding-property-reserved/options.json new file mode 100644 index 0000000000..26ddfc8190 --- /dev/null +++ b/test/fixtures/esprima/es2015-generator/generator-parameter-binding-property-reserved/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Binding yield (1:12)" +} \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-generator/generator-parameter-binding-property/actual.js b/test/fixtures/esprima/es2015-generator/generator-parameter-binding-property/actual.js new file mode 100644 index 0000000000..3de539ac3f --- /dev/null +++ b/test/fixtures/esprima/es2015-generator/generator-parameter-binding-property/actual.js @@ -0,0 +1,3 @@ +(function*() { + function({x: y = yield 3}) {} +}) diff --git a/test/fixtures/esprima/es2015-generator/generator-parameter-binding-property/options.json b/test/fixtures/esprima/es2015-generator/generator-parameter-binding-property/options.json new file mode 100644 index 0000000000..690a8e9e31 --- /dev/null +++ b/test/fixtures/esprima/es2015-generator/generator-parameter-binding-property/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Unexpected token (2:12)" +} \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-generator/generator-parameter-computed-property-name/actual.js b/test/fixtures/esprima/es2015-generator/generator-parameter-computed-property-name/actual.js new file mode 100644 index 0000000000..7bc0064073 --- /dev/null +++ b/test/fixtures/esprima/es2015-generator/generator-parameter-computed-property-name/actual.js @@ -0,0 +1,3 @@ +(function*() { + function({[yield 3]: y}) {} +}) diff --git a/test/fixtures/esprima/es2015-generator/generator-parameter-computed-property-name/options.json b/test/fixtures/esprima/es2015-generator/generator-parameter-computed-property-name/options.json new file mode 100644 index 0000000000..690a8e9e31 --- /dev/null +++ b/test/fixtures/esprima/es2015-generator/generator-parameter-computed-property-name/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Unexpected token (2:12)" +} \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-generator/generator-parameter-invalid-binding-element/actual.js b/test/fixtures/esprima/es2015-generator/generator-parameter-invalid-binding-element/actual.js new file mode 100644 index 0000000000..bc7938c174 --- /dev/null +++ b/test/fixtures/esprima/es2015-generator/generator-parameter-invalid-binding-element/actual.js @@ -0,0 +1,3 @@ +(function*() { + function*(x = yield 3) {} +}) diff --git a/test/fixtures/esprima/es2015-generator/generator-parameter-invalid-binding-element/options.json b/test/fixtures/esprima/es2015-generator/generator-parameter-invalid-binding-element/options.json new file mode 100644 index 0000000000..38ea64b097 --- /dev/null +++ b/test/fixtures/esprima/es2015-generator/generator-parameter-invalid-binding-element/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Unexpected token (2:13)" +} \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-generator/generator-parameter-invalid-binding-property/actual.js b/test/fixtures/esprima/es2015-generator/generator-parameter-invalid-binding-property/actual.js new file mode 100644 index 0000000000..c219639513 --- /dev/null +++ b/test/fixtures/esprima/es2015-generator/generator-parameter-invalid-binding-property/actual.js @@ -0,0 +1,3 @@ +(function*() { + function*({x: y = yield 3}) {} +}) diff --git a/test/fixtures/esprima/es2015-generator/generator-parameter-invalid-binding-property/options.json b/test/fixtures/esprima/es2015-generator/generator-parameter-invalid-binding-property/options.json new file mode 100644 index 0000000000..38ea64b097 --- /dev/null +++ b/test/fixtures/esprima/es2015-generator/generator-parameter-invalid-binding-property/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Unexpected token (2:13)" +} \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-generator/generator-parameter-invalid-computed-property-name/actual.js b/test/fixtures/esprima/es2015-generator/generator-parameter-invalid-computed-property-name/actual.js new file mode 100644 index 0000000000..1ca20284b3 --- /dev/null +++ b/test/fixtures/esprima/es2015-generator/generator-parameter-invalid-computed-property-name/actual.js @@ -0,0 +1,3 @@ +(function*() { + function*({[yield 3]: y}) {} +}) diff --git a/test/fixtures/esprima/es2015-generator/generator-parameter-invalid-computed-property-name/options.json b/test/fixtures/esprima/es2015-generator/generator-parameter-invalid-computed-property-name/options.json new file mode 100644 index 0000000000..38ea64b097 --- /dev/null +++ b/test/fixtures/esprima/es2015-generator/generator-parameter-invalid-computed-property-name/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Unexpected token (2:13)" +} \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-generator/incomplete-yield-delegate/actual.js b/test/fixtures/esprima/es2015-generator/incomplete-yield-delegate/actual.js new file mode 100644 index 0000000000..f0d07c0140 --- /dev/null +++ b/test/fixtures/esprima/es2015-generator/incomplete-yield-delegate/actual.js @@ -0,0 +1 @@ +(function*() { yield* }) diff --git a/test/fixtures/esprima/es2015-generator/incomplete-yield-delegate/options.json b/test/fixtures/esprima/es2015-generator/incomplete-yield-delegate/options.json new file mode 100644 index 0000000000..b23f881870 --- /dev/null +++ b/test/fixtures/esprima/es2015-generator/incomplete-yield-delegate/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Unexpected token (1:22)" +} \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-generator/malformed-generator-method-2/actual.js b/test/fixtures/esprima/es2015-generator/malformed-generator-method-2/actual.js new file mode 100644 index 0000000000..0273d50d68 --- /dev/null +++ b/test/fixtures/esprima/es2015-generator/malformed-generator-method-2/actual.js @@ -0,0 +1 @@ +class Foo { * } diff --git a/test/fixtures/esprima/es2015-generator/malformed-generator-method-2/options.json b/test/fixtures/esprima/es2015-generator/malformed-generator-method-2/options.json new file mode 100644 index 0000000000..51c483f3d3 --- /dev/null +++ b/test/fixtures/esprima/es2015-generator/malformed-generator-method-2/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Unexpected token (1:14)" +} \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-generator/malformed-generator-method/actual.js b/test/fixtures/esprima/es2015-generator/malformed-generator-method/actual.js new file mode 100644 index 0000000000..f34ab0f700 --- /dev/null +++ b/test/fixtures/esprima/es2015-generator/malformed-generator-method/actual.js @@ -0,0 +1 @@ +({ * }) diff --git a/test/fixtures/esprima/es2015-generator/malformed-generator-method/options.json b/test/fixtures/esprima/es2015-generator/malformed-generator-method/options.json new file mode 100644 index 0000000000..0ab445fe47 --- /dev/null +++ b/test/fixtures/esprima/es2015-generator/malformed-generator-method/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Unexpected token (1:5)" +} \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-generator/static-generator-method-with-computed-name/actual.js b/test/fixtures/esprima/es2015-generator/static-generator-method-with-computed-name/actual.js new file mode 100644 index 0000000000..5252f9a97d --- /dev/null +++ b/test/fixtures/esprima/es2015-generator/static-generator-method-with-computed-name/actual.js @@ -0,0 +1 @@ +class Foo { static *[foo]() {} } diff --git a/test/fixtures/esprima/es2015-generator/static-generator-method-with-computed-name/expected.json b/test/fixtures/esprima/es2015-generator/static-generator-method-with-computed-name/expected.json new file mode 100644 index 0000000000..d257165465 --- /dev/null +++ b/test/fixtures/esprima/es2015-generator/static-generator-method-with-computed-name/expected.json @@ -0,0 +1,151 @@ +{ + "type": "File", + "start": 0, + "end": 32, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 32 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 32, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 32 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ClassDeclaration", + "start": 0, + "end": 32, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 32 + } + }, + "id": { + "type": "Identifier", + "start": 6, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "name": "Foo" + }, + "superClass": null, + "body": { + "type": "ClassBody", + "start": 10, + "end": 32, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 32 + } + }, + "body": [ + { + "type": "MethodDefinition", + "start": 12, + "end": 30, + "loc": { + "start": { + "line": 1, + "column": 12 + }, + "end": { + "line": 1, + "column": 30 + } + }, + "computed": true, + "key": { + "type": "Identifier", + "start": 21, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 21 + }, + "end": { + "line": 1, + "column": 24 + } + }, + "name": "foo" + }, + "static": true, + "kind": "method", + "value": { + "type": "FunctionExpression", + "start": 25, + "end": 30, + "loc": { + "start": { + "line": 1, + "column": 25 + }, + "end": { + "line": 1, + "column": 30 + } + }, + "id": null, + "generator": true, + "expression": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 28, + "end": 30, + "loc": { + "start": { + "line": 1, + "column": 28 + }, + "end": { + "line": 1, + "column": 30 + } + }, + "body": [] + } + } + } + ] + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-generator/static-generator-method/actual.js b/test/fixtures/esprima/es2015-generator/static-generator-method/actual.js new file mode 100644 index 0000000000..6644eb190c --- /dev/null +++ b/test/fixtures/esprima/es2015-generator/static-generator-method/actual.js @@ -0,0 +1 @@ +class Foo { static *foo() {} } diff --git a/test/fixtures/esprima/es2015-generator/static-generator-method/expected.json b/test/fixtures/esprima/es2015-generator/static-generator-method/expected.json new file mode 100644 index 0000000000..bebbec9f26 --- /dev/null +++ b/test/fixtures/esprima/es2015-generator/static-generator-method/expected.json @@ -0,0 +1,151 @@ +{ + "type": "File", + "start": 0, + "end": 30, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 30 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 30, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 30 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ClassDeclaration", + "start": 0, + "end": 30, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 30 + } + }, + "id": { + "type": "Identifier", + "start": 6, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "name": "Foo" + }, + "superClass": null, + "body": { + "type": "ClassBody", + "start": 10, + "end": 30, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 30 + } + }, + "body": [ + { + "type": "MethodDefinition", + "start": 12, + "end": 28, + "loc": { + "start": { + "line": 1, + "column": 12 + }, + "end": { + "line": 1, + "column": 28 + } + }, + "computed": false, + "key": { + "type": "Identifier", + "start": 20, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 20 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "name": "foo" + }, + "static": true, + "kind": "method", + "value": { + "type": "FunctionExpression", + "start": 23, + "end": 28, + "loc": { + "start": { + "line": 1, + "column": 23 + }, + "end": { + "line": 1, + "column": 28 + } + }, + "id": null, + "generator": true, + "expression": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 26, + "end": 28, + "loc": { + "start": { + "line": 1, + "column": 26 + }, + "end": { + "line": 1, + "column": 28 + } + }, + "body": [] + } + } + } + ] + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-identifier/dakuten_handakuten/actual.js b/test/fixtures/esprima/es2015-identifier/dakuten_handakuten/actual.js new file mode 100644 index 0000000000..38d91a508a --- /dev/null +++ b/test/fixtures/esprima/es2015-identifier/dakuten_handakuten/actual.js @@ -0,0 +1 @@ +゛+ ゜ diff --git a/test/fixtures/esprima/es2015-identifier/dakuten_handakuten/expected.json b/test/fixtures/esprima/es2015-identifier/dakuten_handakuten/expected.json new file mode 100644 index 0000000000..777d6344e3 --- /dev/null +++ b/test/fixtures/esprima/es2015-identifier/dakuten_handakuten/expected.json @@ -0,0 +1,96 @@ +{ + "type": "File", + "start": 0, + "end": 4, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 4 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 4, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 4 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 4, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 4 + } + }, + "expression": { + "type": "BinaryExpression", + "start": 0, + "end": 4, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 4 + } + }, + "left": { + "type": "Identifier", + "start": 0, + "end": 1, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + } + }, + "name": "゛" + }, + "operator": "+", + "right": { + "type": "Identifier", + "start": 3, + "end": 4, + "loc": { + "start": { + "line": 1, + "column": 3 + }, + "end": { + "line": 1, + "column": 4 + } + }, + "name": "゜" + } + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-identifier/escaped_all/actual.js b/test/fixtures/esprima/es2015-identifier/escaped_all/actual.js new file mode 100644 index 0000000000..918581760d --- /dev/null +++ b/test/fixtures/esprima/es2015-identifier/escaped_all/actual.js @@ -0,0 +1 @@ +var \u{41}\u{42}\u{43}; diff --git a/test/fixtures/esprima/es2015-identifier/escaped_all/expected.json b/test/fixtures/esprima/es2015-identifier/escaped_all/expected.json new file mode 100644 index 0000000000..e71aacfe96 --- /dev/null +++ b/test/fixtures/esprima/es2015-identifier/escaped_all/expected.json @@ -0,0 +1,83 @@ +{ + "type": "File", + "start": 0, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "sourceType": "script", + "body": [ + { + "type": "VariableDeclaration", + "start": 0, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 4, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "id": { + "type": "Identifier", + "start": 4, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "name": "ABC" + }, + "init": null + } + ], + "kind": "var" + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-identifier/escaped_math_alef/actual.js b/test/fixtures/esprima/es2015-identifier/escaped_math_alef/actual.js new file mode 100644 index 0000000000..94262d79ba --- /dev/null +++ b/test/fixtures/esprima/es2015-identifier/escaped_math_alef/actual.js @@ -0,0 +1 @@ +var \u{1EE00} diff --git a/test/fixtures/esprima/es2015-identifier/escaped_math_alef/expected.json b/test/fixtures/esprima/es2015-identifier/escaped_math_alef/expected.json new file mode 100644 index 0000000000..720e46270b --- /dev/null +++ b/test/fixtures/esprima/es2015-identifier/escaped_math_alef/expected.json @@ -0,0 +1,83 @@ +{ + "type": "File", + "start": 0, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "sourceType": "script", + "body": [ + { + "type": "VariableDeclaration", + "start": 0, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 4, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "id": { + "type": "Identifier", + "start": 4, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "name": "𞸀" + }, + "init": null + } + ], + "kind": "var" + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-identifier/escaped_math_dal_part/actual.js b/test/fixtures/esprima/es2015-identifier/escaped_math_dal_part/actual.js new file mode 100644 index 0000000000..dfeaf3553e --- /dev/null +++ b/test/fixtures/esprima/es2015-identifier/escaped_math_dal_part/actual.js @@ -0,0 +1 @@ +var _\u{1EE03} diff --git a/test/fixtures/esprima/es2015-identifier/escaped_math_dal_part/expected.json b/test/fixtures/esprima/es2015-identifier/escaped_math_dal_part/expected.json new file mode 100644 index 0000000000..aac895c761 --- /dev/null +++ b/test/fixtures/esprima/es2015-identifier/escaped_math_dal_part/expected.json @@ -0,0 +1,83 @@ +{ + "type": "File", + "start": 0, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "sourceType": "script", + "body": [ + { + "type": "VariableDeclaration", + "start": 0, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 4, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "id": { + "type": "Identifier", + "start": 4, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "name": "_𞸃" + }, + "init": null + } + ], + "kind": "var" + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-identifier/escaped_math_kaf_lam/actual.js b/test/fixtures/esprima/es2015-identifier/escaped_math_kaf_lam/actual.js new file mode 100644 index 0000000000..84eba349a4 --- /dev/null +++ b/test/fixtures/esprima/es2015-identifier/escaped_math_kaf_lam/actual.js @@ -0,0 +1 @@ +var \u{1EE0A}\u{1EE0B} diff --git a/test/fixtures/esprima/es2015-identifier/escaped_math_kaf_lam/expected.json b/test/fixtures/esprima/es2015-identifier/escaped_math_kaf_lam/expected.json new file mode 100644 index 0000000000..aeab4c908f --- /dev/null +++ b/test/fixtures/esprima/es2015-identifier/escaped_math_kaf_lam/expected.json @@ -0,0 +1,83 @@ +{ + "type": "File", + "start": 0, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "sourceType": "script", + "body": [ + { + "type": "VariableDeclaration", + "start": 0, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 4, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "id": { + "type": "Identifier", + "start": 4, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "name": "𞸊𞸋" + }, + "init": null + } + ], + "kind": "var" + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-identifier/escaped_math_zain_start/actual.js b/test/fixtures/esprima/es2015-identifier/escaped_math_zain_start/actual.js new file mode 100644 index 0000000000..7b9341ce7e --- /dev/null +++ b/test/fixtures/esprima/es2015-identifier/escaped_math_zain_start/actual.js @@ -0,0 +1 @@ +var \u{1EE06}_$ diff --git a/test/fixtures/esprima/es2015-identifier/escaped_math_zain_start/expected.json b/test/fixtures/esprima/es2015-identifier/escaped_math_zain_start/expected.json new file mode 100644 index 0000000000..f3f71d5dd7 --- /dev/null +++ b/test/fixtures/esprima/es2015-identifier/escaped_math_zain_start/expected.json @@ -0,0 +1,83 @@ +{ + "type": "File", + "start": 0, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "sourceType": "script", + "body": [ + { + "type": "VariableDeclaration", + "start": 0, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 4, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "id": { + "type": "Identifier", + "start": 4, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "name": "𞸆_$" + }, + "init": null + } + ], + "kind": "var" + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-identifier/escaped_part/actual.js b/test/fixtures/esprima/es2015-identifier/escaped_part/actual.js new file mode 100644 index 0000000000..6f2d330a7a --- /dev/null +++ b/test/fixtures/esprima/es2015-identifier/escaped_part/actual.js @@ -0,0 +1 @@ +var A\u{42}C; diff --git a/test/fixtures/esprima/es2015-identifier/escaped_part/expected.json b/test/fixtures/esprima/es2015-identifier/escaped_part/expected.json new file mode 100644 index 0000000000..538f851879 --- /dev/null +++ b/test/fixtures/esprima/es2015-identifier/escaped_part/expected.json @@ -0,0 +1,83 @@ +{ + "type": "File", + "start": 0, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "sourceType": "script", + "body": [ + { + "type": "VariableDeclaration", + "start": 0, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 4, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "id": { + "type": "Identifier", + "start": 4, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "name": "ABC" + }, + "init": null + } + ], + "kind": "var" + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-identifier/escaped_start/actual.js b/test/fixtures/esprima/es2015-identifier/escaped_start/actual.js new file mode 100644 index 0000000000..a5bd7053f2 --- /dev/null +++ b/test/fixtures/esprima/es2015-identifier/escaped_start/actual.js @@ -0,0 +1 @@ +var \u{41}BC; diff --git a/test/fixtures/esprima/es2015-identifier/escaped_start/expected.json b/test/fixtures/esprima/es2015-identifier/escaped_start/expected.json new file mode 100644 index 0000000000..538f851879 --- /dev/null +++ b/test/fixtures/esprima/es2015-identifier/escaped_start/expected.json @@ -0,0 +1,83 @@ +{ + "type": "File", + "start": 0, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "sourceType": "script", + "body": [ + { + "type": "VariableDeclaration", + "start": 0, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 4, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "id": { + "type": "Identifier", + "start": 4, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "name": "ABC" + }, + "init": null + } + ], + "kind": "var" + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-identifier/estimated/actual.js b/test/fixtures/esprima/es2015-identifier/estimated/actual.js new file mode 100644 index 0000000000..5349d5bcfc --- /dev/null +++ b/test/fixtures/esprima/es2015-identifier/estimated/actual.js @@ -0,0 +1 @@ +let ℮ diff --git a/test/fixtures/esprima/es2015-identifier/estimated/expected.json b/test/fixtures/esprima/es2015-identifier/estimated/expected.json new file mode 100644 index 0000000000..52b66afb75 --- /dev/null +++ b/test/fixtures/esprima/es2015-identifier/estimated/expected.json @@ -0,0 +1,83 @@ +{ + "type": "File", + "start": 0, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "sourceType": "script", + "body": [ + { + "type": "VariableDeclaration", + "start": 0, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 4, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "id": { + "type": "Identifier", + "start": 4, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "name": "℮" + }, + "init": null + } + ], + "kind": "let" + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-identifier/ethiopic_digits/actual.js b/test/fixtures/esprima/es2015-identifier/ethiopic_digits/actual.js new file mode 100644 index 0000000000..43a8b95859 --- /dev/null +++ b/test/fixtures/esprima/es2015-identifier/ethiopic_digits/actual.js @@ -0,0 +1 @@ +var _፩፪፫፬፭፮፯፰፱ diff --git a/test/fixtures/esprima/es2015-identifier/ethiopic_digits/expected.json b/test/fixtures/esprima/es2015-identifier/ethiopic_digits/expected.json new file mode 100644 index 0000000000..3c1f5449e8 --- /dev/null +++ b/test/fixtures/esprima/es2015-identifier/ethiopic_digits/expected.json @@ -0,0 +1,83 @@ +{ + "type": "File", + "start": 0, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "sourceType": "script", + "body": [ + { + "type": "VariableDeclaration", + "start": 0, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 4, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "id": { + "type": "Identifier", + "start": 4, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "name": "_፩፪፫፬፭፮፯፰፱" + }, + "init": null + } + ], + "kind": "var" + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-identifier/invalid_escaped_surrogate_pairs/actual.js b/test/fixtures/esprima/es2015-identifier/invalid_escaped_surrogate_pairs/actual.js new file mode 100644 index 0000000000..bf6b772173 --- /dev/null +++ b/test/fixtures/esprima/es2015-identifier/invalid_escaped_surrogate_pairs/actual.js @@ -0,0 +1 @@ +var \uD83B\uDE00 diff --git a/test/fixtures/esprima/es2015-identifier/invalid_escaped_surrogate_pairs/options.json b/test/fixtures/esprima/es2015-identifier/invalid_escaped_surrogate_pairs/options.json new file mode 100644 index 0000000000..4bb33235bd --- /dev/null +++ b/test/fixtures/esprima/es2015-identifier/invalid_escaped_surrogate_pairs/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Invalid Unicode escape (1:4)" +} \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-identifier/invalid_expression_await/actual.js b/test/fixtures/esprima/es2015-identifier/invalid_expression_await/actual.js new file mode 100644 index 0000000000..8d5a78d2d2 --- /dev/null +++ b/test/fixtures/esprima/es2015-identifier/invalid_expression_await/actual.js @@ -0,0 +1 @@ +export var answer = await + 1; diff --git a/test/fixtures/esprima/es2015-identifier/invalid_expression_await/options.json b/test/fixtures/esprima/es2015-identifier/invalid_expression_await/options.json new file mode 100644 index 0000000000..53ee186d1b --- /dev/null +++ b/test/fixtures/esprima/es2015-identifier/invalid_expression_await/options.json @@ -0,0 +1,3 @@ +{ + "throws": "'import' and 'export' may appear only with 'sourceType: module' (1:0)" +} \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-identifier/invalid_function_wait/actual.js b/test/fixtures/esprima/es2015-identifier/invalid_function_wait/actual.js new file mode 100644 index 0000000000..2526e7ed1d --- /dev/null +++ b/test/fixtures/esprima/es2015-identifier/invalid_function_wait/actual.js @@ -0,0 +1 @@ +function await() {} diff --git a/test/fixtures/esprima/es2015-identifier/invalid_function_wait/expected.json b/test/fixtures/esprima/es2015-identifier/invalid_function_wait/expected.json new file mode 100644 index 0000000000..e1bd544880 --- /dev/null +++ b/test/fixtures/esprima/es2015-identifier/invalid_function_wait/expected.json @@ -0,0 +1,83 @@ +{ + "type": "File", + "start": 0, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 19 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 19 + } + }, + "sourceType": "script", + "body": [ + { + "type": "FunctionDeclaration", + "start": 0, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 19 + } + }, + "id": { + "type": "Identifier", + "start": 9, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "name": "await" + }, + "generator": false, + "expression": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 17, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 17 + }, + "end": { + "line": 1, + "column": 19 + } + }, + "body": [] + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-identifier/invalid_function_wait/options.json b/test/fixtures/esprima/es2015-identifier/invalid_function_wait/options.json new file mode 100644 index 0000000000..328b1ddde8 --- /dev/null +++ b/test/fixtures/esprima/es2015-identifier/invalid_function_wait/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Unexpected token (1:10)" +} \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-identifier/invalid_id_smp/actual.js b/test/fixtures/esprima/es2015-identifier/invalid_id_smp/actual.js new file mode 100644 index 0000000000..9e1a5ea2ed --- /dev/null +++ b/test/fixtures/esprima/es2015-identifier/invalid_id_smp/actual.js @@ -0,0 +1 @@ +var 🀒 diff --git a/test/fixtures/esprima/es2015-identifier/invalid_id_smp/options.json b/test/fixtures/esprima/es2015-identifier/invalid_id_smp/options.json new file mode 100644 index 0000000000..905116584b --- /dev/null +++ b/test/fixtures/esprima/es2015-identifier/invalid_id_smp/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Unexpected character '🀒' (1:4)" +} \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-identifier/invalid_lone_surrogate/actual.js b/test/fixtures/esprima/es2015-identifier/invalid_lone_surrogate/actual.js new file mode 100644 index 0000000000..e66fe1911a --- /dev/null +++ b/test/fixtures/esprima/es2015-identifier/invalid_lone_surrogate/actual.js @@ -0,0 +1 @@ +var source = '\uD800!'; diff --git a/test/fixtures/esprima/es2015-identifier/invalid_lone_surrogate/expected.json b/test/fixtures/esprima/es2015-identifier/invalid_lone_surrogate/expected.json new file mode 100644 index 0000000000..8a8057346c --- /dev/null +++ b/test/fixtures/esprima/es2015-identifier/invalid_lone_surrogate/expected.json @@ -0,0 +1,100 @@ +{ + "type": "File", + "start": 0, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "sourceType": "script", + "body": [ + { + "type": "VariableDeclaration", + "start": 0, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 4, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "id": { + "type": "Identifier", + "start": 4, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "name": "source" + }, + "init": { + "type": "Literal", + "start": 13, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "value": "�!", + "rawValue": "�!", + "raw": "'\\uD800!'" + } + } + ], + "kind": "var" + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-identifier/invalid_lone_surrogate/options.json b/test/fixtures/esprima/es2015-identifier/invalid_lone_surrogate/options.json new file mode 100644 index 0000000000..04b967a2ee --- /dev/null +++ b/test/fixtures/esprima/es2015-identifier/invalid_lone_surrogate/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Unexpected token (1:1)" +} \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-identifier/invalid_var_await/actual.js b/test/fixtures/esprima/es2015-identifier/invalid_var_await/actual.js new file mode 100644 index 0000000000..91cd4f3b2b --- /dev/null +++ b/test/fixtures/esprima/es2015-identifier/invalid_var_await/actual.js @@ -0,0 +1 @@ +export var await; diff --git a/test/fixtures/esprima/es2015-identifier/invalid_var_await/options.json b/test/fixtures/esprima/es2015-identifier/invalid_var_await/options.json new file mode 100644 index 0000000000..53ee186d1b --- /dev/null +++ b/test/fixtures/esprima/es2015-identifier/invalid_var_await/options.json @@ -0,0 +1,3 @@ +{ + "throws": "'import' and 'export' may appear only with 'sourceType: module' (1:0)" +} \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-identifier/math_alef/actual.js b/test/fixtures/esprima/es2015-identifier/math_alef/actual.js new file mode 100644 index 0000000000..965aec3af5 --- /dev/null +++ b/test/fixtures/esprima/es2015-identifier/math_alef/actual.js @@ -0,0 +1 @@ +var 𞸀 diff --git a/test/fixtures/esprima/es2015-identifier/math_alef/expected.json b/test/fixtures/esprima/es2015-identifier/math_alef/expected.json new file mode 100644 index 0000000000..95e4a8ea91 --- /dev/null +++ b/test/fixtures/esprima/es2015-identifier/math_alef/expected.json @@ -0,0 +1,83 @@ +{ + "type": "File", + "start": 0, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "sourceType": "script", + "body": [ + { + "type": "VariableDeclaration", + "start": 0, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 4, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "id": { + "type": "Identifier", + "start": 4, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "name": "𞸀" + }, + "init": null + } + ], + "kind": "var" + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-identifier/math_dal_part/actual.js b/test/fixtures/esprima/es2015-identifier/math_dal_part/actual.js new file mode 100644 index 0000000000..2291df983e --- /dev/null +++ b/test/fixtures/esprima/es2015-identifier/math_dal_part/actual.js @@ -0,0 +1 @@ +var _𞸃 diff --git a/test/fixtures/esprima/es2015-identifier/math_dal_part/expected.json b/test/fixtures/esprima/es2015-identifier/math_dal_part/expected.json new file mode 100644 index 0000000000..177536551c --- /dev/null +++ b/test/fixtures/esprima/es2015-identifier/math_dal_part/expected.json @@ -0,0 +1,83 @@ +{ + "type": "File", + "start": 0, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "sourceType": "script", + "body": [ + { + "type": "VariableDeclaration", + "start": 0, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 4, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "id": { + "type": "Identifier", + "start": 4, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "name": "_𞸃" + }, + "init": null + } + ], + "kind": "var" + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-identifier/math_kaf_lam/actual.js b/test/fixtures/esprima/es2015-identifier/math_kaf_lam/actual.js new file mode 100644 index 0000000000..e1ad50f51d --- /dev/null +++ b/test/fixtures/esprima/es2015-identifier/math_kaf_lam/actual.js @@ -0,0 +1 @@ +var 𞸊𞸋 diff --git a/test/fixtures/esprima/es2015-identifier/math_kaf_lam/expected.json b/test/fixtures/esprima/es2015-identifier/math_kaf_lam/expected.json new file mode 100644 index 0000000000..d3db5f5c03 --- /dev/null +++ b/test/fixtures/esprima/es2015-identifier/math_kaf_lam/expected.json @@ -0,0 +1,83 @@ +{ + "type": "File", + "start": 0, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "sourceType": "script", + "body": [ + { + "type": "VariableDeclaration", + "start": 0, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 4, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "id": { + "type": "Identifier", + "start": 4, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "name": "𞸊𞸋" + }, + "init": null + } + ], + "kind": "var" + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-identifier/math_zain_start/actual.js b/test/fixtures/esprima/es2015-identifier/math_zain_start/actual.js new file mode 100644 index 0000000000..98c10c1f85 --- /dev/null +++ b/test/fixtures/esprima/es2015-identifier/math_zain_start/actual.js @@ -0,0 +1 @@ +var 𞸆_$ diff --git a/test/fixtures/esprima/es2015-identifier/math_zain_start/expected.json b/test/fixtures/esprima/es2015-identifier/math_zain_start/expected.json new file mode 100644 index 0000000000..5124087f99 --- /dev/null +++ b/test/fixtures/esprima/es2015-identifier/math_zain_start/expected.json @@ -0,0 +1,83 @@ +{ + "type": "File", + "start": 0, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "sourceType": "script", + "body": [ + { + "type": "VariableDeclaration", + "start": 0, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 4, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "id": { + "type": "Identifier", + "start": 4, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "name": "𞸆_$" + }, + "init": null + } + ], + "kind": "var" + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-identifier/module_await/actual.js b/test/fixtures/esprima/es2015-identifier/module_await/actual.js new file mode 100644 index 0000000000..aabfa0d200 --- /dev/null +++ b/test/fixtures/esprima/es2015-identifier/module_await/actual.js @@ -0,0 +1 @@ +await = 0; diff --git a/test/fixtures/esprima/es2015-identifier/module_await/expected.json b/test/fixtures/esprima/es2015-identifier/module_await/expected.json new file mode 100644 index 0000000000..9ceb584ddd --- /dev/null +++ b/test/fixtures/esprima/es2015-identifier/module_await/expected.json @@ -0,0 +1,98 @@ +{ + "type": "File", + "start": 0, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "expression": { + "type": "AssignmentExpression", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "operator": "=", + "left": { + "type": "Identifier", + "start": 0, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "name": "await" + }, + "right": { + "type": "Literal", + "start": 8, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "value": 0, + "rawValue": 0, + "raw": "0" + } + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-identifier/valid_await/actual.js b/test/fixtures/esprima/es2015-identifier/valid_await/actual.js new file mode 100644 index 0000000000..4b130dd06e --- /dev/null +++ b/test/fixtures/esprima/es2015-identifier/valid_await/actual.js @@ -0,0 +1 @@ +var await; (await); diff --git a/test/fixtures/esprima/es2015-identifier/valid_await/expected.json b/test/fixtures/esprima/es2015-identifier/valid_await/expected.json new file mode 100644 index 0000000000..480b8d531d --- /dev/null +++ b/test/fixtures/esprima/es2015-identifier/valid_await/expected.json @@ -0,0 +1,115 @@ +{ + "type": "File", + "start": 0, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 19 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 19 + } + }, + "sourceType": "script", + "body": [ + { + "type": "VariableDeclaration", + "start": 0, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 4, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "id": { + "type": "Identifier", + "start": 4, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "name": "await" + }, + "init": null + } + ], + "kind": "var" + }, + { + "type": "ExpressionStatement", + "start": 11, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 11 + }, + "end": { + "line": 1, + "column": 19 + } + }, + "expression": { + "type": "Identifier", + "start": 12, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 12 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "name": "await", + "parenthesizedExpression": true + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-identifier/weierstrass/actual.js b/test/fixtures/esprima/es2015-identifier/weierstrass/actual.js new file mode 100644 index 0000000000..23b440eeed --- /dev/null +++ b/test/fixtures/esprima/es2015-identifier/weierstrass/actual.js @@ -0,0 +1 @@ +var ℘; diff --git a/test/fixtures/esprima/es2015-identifier/weierstrass/expected.json b/test/fixtures/esprima/es2015-identifier/weierstrass/expected.json new file mode 100644 index 0000000000..0fb54a0f5f --- /dev/null +++ b/test/fixtures/esprima/es2015-identifier/weierstrass/expected.json @@ -0,0 +1,83 @@ +{ + "type": "File", + "start": 0, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "sourceType": "script", + "body": [ + { + "type": "VariableDeclaration", + "start": 0, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 4, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "id": { + "type": "Identifier", + "start": 4, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "name": "℘" + }, + "init": null + } + ], + "kind": "var" + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-identifier/weierstrass_weierstrass/actual.js b/test/fixtures/esprima/es2015-identifier/weierstrass_weierstrass/actual.js new file mode 100644 index 0000000000..3fc1e2a32e --- /dev/null +++ b/test/fixtures/esprima/es2015-identifier/weierstrass_weierstrass/actual.js @@ -0,0 +1 @@ +var ℘\u2118 diff --git a/test/fixtures/esprima/es2015-identifier/weierstrass_weierstrass/expected.json b/test/fixtures/esprima/es2015-identifier/weierstrass_weierstrass/expected.json new file mode 100644 index 0000000000..b6bb7d481d --- /dev/null +++ b/test/fixtures/esprima/es2015-identifier/weierstrass_weierstrass/expected.json @@ -0,0 +1,83 @@ +{ + "type": "File", + "start": 0, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "sourceType": "script", + "body": [ + { + "type": "VariableDeclaration", + "start": 0, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 4, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "id": { + "type": "Identifier", + "start": 4, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "name": "℘℘" + }, + "init": null + } + ], + "kind": "var" + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-import-declaration/import-default-and-named-specifiers/actual.js b/test/fixtures/esprima/es2015-import-declaration/import-default-and-named-specifiers/actual.js new file mode 100644 index 0000000000..e544977b3a --- /dev/null +++ b/test/fixtures/esprima/es2015-import-declaration/import-default-and-named-specifiers/actual.js @@ -0,0 +1 @@ +import foo, {bar} from "foo"; diff --git a/test/fixtures/esprima/es2015-import-declaration/import-default-and-named-specifiers/expected.json b/test/fixtures/esprima/es2015-import-declaration/import-default-and-named-specifiers/expected.json new file mode 100644 index 0000000000..edc235cd14 --- /dev/null +++ b/test/fixtures/esprima/es2015-import-declaration/import-default-and-named-specifiers/expected.json @@ -0,0 +1,146 @@ +{ + "type": "File", + "start": 0, + "end": 29, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 29 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 29, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 29 + } + }, + "sourceType": "module", + "body": [ + { + "type": "ImportDeclaration", + "start": 0, + "end": 29, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 29 + } + }, + "specifiers": [ + { + "type": "ImportDefaultSpecifier", + "start": 7, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "local": { + "type": "Identifier", + "start": 7, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "name": "foo" + } + }, + { + "type": "ImportSpecifier", + "start": 13, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "imported": { + "type": "Identifier", + "start": 13, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "name": "bar" + }, + "local": { + "type": "Identifier", + "start": 13, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "name": "bar" + } + } + ], + "source": { + "type": "Literal", + "start": 23, + "end": 28, + "loc": { + "start": { + "line": 1, + "column": 23 + }, + "end": { + "line": 1, + "column": 28 + } + }, + "value": "foo", + "rawValue": "foo", + "raw": "\"foo\"" + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-import-declaration/import-default-and-namespace-specifiers/actual.js b/test/fixtures/esprima/es2015-import-declaration/import-default-and-namespace-specifiers/actual.js new file mode 100644 index 0000000000..084fa0cdd1 --- /dev/null +++ b/test/fixtures/esprima/es2015-import-declaration/import-default-and-namespace-specifiers/actual.js @@ -0,0 +1 @@ +import foo, * as bar from "foo"; diff --git a/test/fixtures/esprima/es2015-import-declaration/import-default-and-namespace-specifiers/expected.json b/test/fixtures/esprima/es2015-import-declaration/import-default-and-namespace-specifiers/expected.json new file mode 100644 index 0000000000..f4121da033 --- /dev/null +++ b/test/fixtures/esprima/es2015-import-declaration/import-default-and-namespace-specifiers/expected.json @@ -0,0 +1,130 @@ +{ + "type": "File", + "start": 0, + "end": 32, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 32 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 32, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 32 + } + }, + "sourceType": "module", + "body": [ + { + "type": "ImportDeclaration", + "start": 0, + "end": 32, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 32 + } + }, + "specifiers": [ + { + "type": "ImportDefaultSpecifier", + "start": 7, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "local": { + "type": "Identifier", + "start": 7, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "name": "foo" + } + }, + { + "type": "ImportNamespaceSpecifier", + "start": 12, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 12 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "local": { + "type": "Identifier", + "start": 17, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 17 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "name": "bar" + } + } + ], + "source": { + "type": "Literal", + "start": 26, + "end": 31, + "loc": { + "start": { + "line": 1, + "column": 26 + }, + "end": { + "line": 1, + "column": 31 + } + }, + "value": "foo", + "rawValue": "foo", + "raw": "\"foo\"" + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-import-declaration/import-default-as/actual.js b/test/fixtures/esprima/es2015-import-declaration/import-default-as/actual.js new file mode 100644 index 0000000000..96c936db10 --- /dev/null +++ b/test/fixtures/esprima/es2015-import-declaration/import-default-as/actual.js @@ -0,0 +1 @@ +import {default as foo} from "foo"; diff --git a/test/fixtures/esprima/es2015-import-declaration/import-default-as/expected.json b/test/fixtures/esprima/es2015-import-declaration/import-default-as/expected.json new file mode 100644 index 0000000000..ef53af8608 --- /dev/null +++ b/test/fixtures/esprima/es2015-import-declaration/import-default-as/expected.json @@ -0,0 +1,115 @@ +{ + "type": "File", + "start": 0, + "end": 35, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 35 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 35, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 35 + } + }, + "sourceType": "module", + "body": [ + { + "type": "ImportDeclaration", + "start": 0, + "end": 35, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 35 + } + }, + "specifiers": [ + { + "type": "ImportSpecifier", + "start": 8, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "imported": { + "type": "Identifier", + "start": 8, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "name": "default" + }, + "local": { + "type": "Identifier", + "start": 19, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 19 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "name": "foo" + } + } + ], + "source": { + "type": "Literal", + "start": 29, + "end": 34, + "loc": { + "start": { + "line": 1, + "column": 29 + }, + "end": { + "line": 1, + "column": 34 + } + }, + "value": "foo", + "rawValue": "foo", + "raw": "\"foo\"" + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-import-declaration/import-default/actual.js b/test/fixtures/esprima/es2015-import-declaration/import-default/actual.js new file mode 100644 index 0000000000..8d1420050a --- /dev/null +++ b/test/fixtures/esprima/es2015-import-declaration/import-default/actual.js @@ -0,0 +1 @@ +import foo from "foo"; diff --git a/test/fixtures/esprima/es2015-import-declaration/import-default/expected.json b/test/fixtures/esprima/es2015-import-declaration/import-default/expected.json new file mode 100644 index 0000000000..f65d947db8 --- /dev/null +++ b/test/fixtures/esprima/es2015-import-declaration/import-default/expected.json @@ -0,0 +1,99 @@ +{ + "type": "File", + "start": 0, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "sourceType": "module", + "body": [ + { + "type": "ImportDeclaration", + "start": 0, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "specifiers": [ + { + "type": "ImportDefaultSpecifier", + "start": 7, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "local": { + "type": "Identifier", + "start": 7, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "name": "foo" + } + } + ], + "source": { + "type": "Literal", + "start": 16, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 16 + }, + "end": { + "line": 1, + "column": 21 + } + }, + "value": "foo", + "rawValue": "foo", + "raw": "\"foo\"" + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-import-declaration/import-jquery/actual.js b/test/fixtures/esprima/es2015-import-declaration/import-jquery/actual.js new file mode 100644 index 0000000000..ea74241b4b --- /dev/null +++ b/test/fixtures/esprima/es2015-import-declaration/import-jquery/actual.js @@ -0,0 +1 @@ +import $ from "jquery" diff --git a/test/fixtures/esprima/es2015-import-declaration/import-jquery/expected.json b/test/fixtures/esprima/es2015-import-declaration/import-jquery/expected.json new file mode 100644 index 0000000000..5466ba5614 --- /dev/null +++ b/test/fixtures/esprima/es2015-import-declaration/import-jquery/expected.json @@ -0,0 +1,99 @@ +{ + "type": "File", + "start": 0, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "sourceType": "module", + "body": [ + { + "type": "ImportDeclaration", + "start": 0, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "specifiers": [ + { + "type": "ImportDefaultSpecifier", + "start": 7, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "local": { + "type": "Identifier", + "start": 7, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "name": "$" + } + } + ], + "source": { + "type": "Literal", + "start": 14, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 14 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "value": "jquery", + "rawValue": "jquery", + "raw": "\"jquery\"" + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-import-declaration/import-module/actual.js b/test/fixtures/esprima/es2015-import-declaration/import-module/actual.js new file mode 100644 index 0000000000..c0748305d5 --- /dev/null +++ b/test/fixtures/esprima/es2015-import-declaration/import-module/actual.js @@ -0,0 +1 @@ +import "foo"; diff --git a/test/fixtures/esprima/es2015-import-declaration/import-module/expected.json b/test/fixtures/esprima/es2015-import-declaration/import-module/expected.json new file mode 100644 index 0000000000..bb56815106 --- /dev/null +++ b/test/fixtures/esprima/es2015-import-declaration/import-module/expected.json @@ -0,0 +1,67 @@ +{ + "type": "File", + "start": 0, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "sourceType": "module", + "body": [ + { + "type": "ImportDeclaration", + "start": 0, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "specifiers": [], + "source": { + "type": "Literal", + "start": 7, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "value": "foo", + "rawValue": "foo", + "raw": "\"foo\"" + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-import-declaration/import-named-as-specifier/actual.js b/test/fixtures/esprima/es2015-import-declaration/import-named-as-specifier/actual.js new file mode 100644 index 0000000000..769f3b3d0c --- /dev/null +++ b/test/fixtures/esprima/es2015-import-declaration/import-named-as-specifier/actual.js @@ -0,0 +1 @@ +import {bar as baz} from "foo"; diff --git a/test/fixtures/esprima/es2015-import-declaration/import-named-as-specifier/expected.json b/test/fixtures/esprima/es2015-import-declaration/import-named-as-specifier/expected.json new file mode 100644 index 0000000000..58842b0c0d --- /dev/null +++ b/test/fixtures/esprima/es2015-import-declaration/import-named-as-specifier/expected.json @@ -0,0 +1,115 @@ +{ + "type": "File", + "start": 0, + "end": 31, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 31 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 31, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 31 + } + }, + "sourceType": "module", + "body": [ + { + "type": "ImportDeclaration", + "start": 0, + "end": 31, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 31 + } + }, + "specifiers": [ + { + "type": "ImportSpecifier", + "start": 8, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "imported": { + "type": "Identifier", + "start": 8, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "name": "bar" + }, + "local": { + "type": "Identifier", + "start": 15, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "name": "baz" + } + } + ], + "source": { + "type": "Literal", + "start": 25, + "end": 30, + "loc": { + "start": { + "line": 1, + "column": 25 + }, + "end": { + "line": 1, + "column": 30 + } + }, + "value": "foo", + "rawValue": "foo", + "raw": "\"foo\"" + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-import-declaration/import-named-as-specifiers/actual.js b/test/fixtures/esprima/es2015-import-declaration/import-named-as-specifiers/actual.js new file mode 100644 index 0000000000..5198ead3cd --- /dev/null +++ b/test/fixtures/esprima/es2015-import-declaration/import-named-as-specifiers/actual.js @@ -0,0 +1 @@ +import {bar as baz, xyz} from "foo"; diff --git a/test/fixtures/esprima/es2015-import-declaration/import-named-as-specifiers/expected.json b/test/fixtures/esprima/es2015-import-declaration/import-named-as-specifiers/expected.json new file mode 100644 index 0000000000..b063a99cd2 --- /dev/null +++ b/test/fixtures/esprima/es2015-import-declaration/import-named-as-specifiers/expected.json @@ -0,0 +1,162 @@ +{ + "type": "File", + "start": 0, + "end": 36, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 36 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 36, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 36 + } + }, + "sourceType": "module", + "body": [ + { + "type": "ImportDeclaration", + "start": 0, + "end": 36, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 36 + } + }, + "specifiers": [ + { + "type": "ImportSpecifier", + "start": 8, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "imported": { + "type": "Identifier", + "start": 8, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "name": "bar" + }, + "local": { + "type": "Identifier", + "start": 15, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "name": "baz" + } + }, + { + "type": "ImportSpecifier", + "start": 20, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 20 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "imported": { + "type": "Identifier", + "start": 20, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 20 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "name": "xyz" + }, + "local": { + "type": "Identifier", + "start": 20, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 20 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "name": "xyz" + } + } + ], + "source": { + "type": "Literal", + "start": 30, + "end": 35, + "loc": { + "start": { + "line": 1, + "column": 30 + }, + "end": { + "line": 1, + "column": 35 + } + }, + "value": "foo", + "rawValue": "foo", + "raw": "\"foo\"" + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-import-declaration/import-named-empty/actual.js b/test/fixtures/esprima/es2015-import-declaration/import-named-empty/actual.js new file mode 100644 index 0000000000..5faab37ebb --- /dev/null +++ b/test/fixtures/esprima/es2015-import-declaration/import-named-empty/actual.js @@ -0,0 +1 @@ +import {} from "foo"; diff --git a/test/fixtures/esprima/es2015-import-declaration/import-named-empty/expected.json b/test/fixtures/esprima/es2015-import-declaration/import-named-empty/expected.json new file mode 100644 index 0000000000..a896b50ab1 --- /dev/null +++ b/test/fixtures/esprima/es2015-import-declaration/import-named-empty/expected.json @@ -0,0 +1,67 @@ +{ + "type": "File", + "start": 0, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 21 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 21 + } + }, + "sourceType": "module", + "body": [ + { + "type": "ImportDeclaration", + "start": 0, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 21 + } + }, + "specifiers": [], + "source": { + "type": "Literal", + "start": 15, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "value": "foo", + "rawValue": "foo", + "raw": "\"foo\"" + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-import-declaration/import-named-specifier/actual.js b/test/fixtures/esprima/es2015-import-declaration/import-named-specifier/actual.js new file mode 100644 index 0000000000..fc80c74dd7 --- /dev/null +++ b/test/fixtures/esprima/es2015-import-declaration/import-named-specifier/actual.js @@ -0,0 +1 @@ +import {bar} from "foo"; diff --git a/test/fixtures/esprima/es2015-import-declaration/import-named-specifier/expected.json b/test/fixtures/esprima/es2015-import-declaration/import-named-specifier/expected.json new file mode 100644 index 0000000000..6a3be9f6d3 --- /dev/null +++ b/test/fixtures/esprima/es2015-import-declaration/import-named-specifier/expected.json @@ -0,0 +1,115 @@ +{ + "type": "File", + "start": 0, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 24 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 24 + } + }, + "sourceType": "module", + "body": [ + { + "type": "ImportDeclaration", + "start": 0, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 24 + } + }, + "specifiers": [ + { + "type": "ImportSpecifier", + "start": 8, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "imported": { + "type": "Identifier", + "start": 8, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "name": "bar" + }, + "local": { + "type": "Identifier", + "start": 8, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "name": "bar" + } + } + ], + "source": { + "type": "Literal", + "start": 18, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 18 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "value": "foo", + "rawValue": "foo", + "raw": "\"foo\"" + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-import-declaration/import-named-specifiers-comma/actual.js b/test/fixtures/esprima/es2015-import-declaration/import-named-specifiers-comma/actual.js new file mode 100644 index 0000000000..c2e95853d6 --- /dev/null +++ b/test/fixtures/esprima/es2015-import-declaration/import-named-specifiers-comma/actual.js @@ -0,0 +1 @@ +import {bar, baz,} from "foo"; diff --git a/test/fixtures/esprima/es2015-import-declaration/import-named-specifiers-comma/expected.json b/test/fixtures/esprima/es2015-import-declaration/import-named-specifiers-comma/expected.json new file mode 100644 index 0000000000..2913832639 --- /dev/null +++ b/test/fixtures/esprima/es2015-import-declaration/import-named-specifiers-comma/expected.json @@ -0,0 +1,162 @@ +{ + "type": "File", + "start": 0, + "end": 30, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 30 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 30, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 30 + } + }, + "sourceType": "module", + "body": [ + { + "type": "ImportDeclaration", + "start": 0, + "end": 30, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 30 + } + }, + "specifiers": [ + { + "type": "ImportSpecifier", + "start": 8, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "imported": { + "type": "Identifier", + "start": 8, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "name": "bar" + }, + "local": { + "type": "Identifier", + "start": 8, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "name": "bar" + } + }, + { + "type": "ImportSpecifier", + "start": 13, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "imported": { + "type": "Identifier", + "start": 13, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "name": "baz" + }, + "local": { + "type": "Identifier", + "start": 13, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "name": "baz" + } + } + ], + "source": { + "type": "Literal", + "start": 24, + "end": 29, + "loc": { + "start": { + "line": 1, + "column": 24 + }, + "end": { + "line": 1, + "column": 29 + } + }, + "value": "foo", + "rawValue": "foo", + "raw": "\"foo\"" + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-import-declaration/import-named-specifiers/actual.js b/test/fixtures/esprima/es2015-import-declaration/import-named-specifiers/actual.js new file mode 100644 index 0000000000..2fb83c2349 --- /dev/null +++ b/test/fixtures/esprima/es2015-import-declaration/import-named-specifiers/actual.js @@ -0,0 +1 @@ +import {bar, baz} from "foo"; diff --git a/test/fixtures/esprima/es2015-import-declaration/import-named-specifiers/expected.json b/test/fixtures/esprima/es2015-import-declaration/import-named-specifiers/expected.json new file mode 100644 index 0000000000..f5152845f5 --- /dev/null +++ b/test/fixtures/esprima/es2015-import-declaration/import-named-specifiers/expected.json @@ -0,0 +1,162 @@ +{ + "type": "File", + "start": 0, + "end": 29, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 29 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 29, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 29 + } + }, + "sourceType": "module", + "body": [ + { + "type": "ImportDeclaration", + "start": 0, + "end": 29, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 29 + } + }, + "specifiers": [ + { + "type": "ImportSpecifier", + "start": 8, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "imported": { + "type": "Identifier", + "start": 8, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "name": "bar" + }, + "local": { + "type": "Identifier", + "start": 8, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "name": "bar" + } + }, + { + "type": "ImportSpecifier", + "start": 13, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "imported": { + "type": "Identifier", + "start": 13, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "name": "baz" + }, + "local": { + "type": "Identifier", + "start": 13, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "name": "baz" + } + } + ], + "source": { + "type": "Literal", + "start": 23, + "end": 28, + "loc": { + "start": { + "line": 1, + "column": 23 + }, + "end": { + "line": 1, + "column": 28 + } + }, + "value": "foo", + "rawValue": "foo", + "raw": "\"foo\"" + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-import-declaration/import-namespace-specifier/actual.js b/test/fixtures/esprima/es2015-import-declaration/import-namespace-specifier/actual.js new file mode 100644 index 0000000000..e55c077500 --- /dev/null +++ b/test/fixtures/esprima/es2015-import-declaration/import-namespace-specifier/actual.js @@ -0,0 +1 @@ +import * as foo from "foo"; diff --git a/test/fixtures/esprima/es2015-import-declaration/import-namespace-specifier/expected.json b/test/fixtures/esprima/es2015-import-declaration/import-namespace-specifier/expected.json new file mode 100644 index 0000000000..27b3e13863 --- /dev/null +++ b/test/fixtures/esprima/es2015-import-declaration/import-namespace-specifier/expected.json @@ -0,0 +1,99 @@ +{ + "type": "File", + "start": 0, + "end": 27, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 27 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 27, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 27 + } + }, + "sourceType": "module", + "body": [ + { + "type": "ImportDeclaration", + "start": 0, + "end": 27, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 27 + } + }, + "specifiers": [ + { + "type": "ImportNamespaceSpecifier", + "start": 7, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "local": { + "type": "Identifier", + "start": 12, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 12 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "name": "foo" + } + } + ], + "source": { + "type": "Literal", + "start": 21, + "end": 26, + "loc": { + "start": { + "line": 1, + "column": 21 + }, + "end": { + "line": 1, + "column": 26 + } + }, + "value": "foo", + "rawValue": "foo", + "raw": "\"foo\"" + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-import-declaration/import-null-as-nil/actual.js b/test/fixtures/esprima/es2015-import-declaration/import-null-as-nil/actual.js new file mode 100644 index 0000000000..ced8a86bb8 --- /dev/null +++ b/test/fixtures/esprima/es2015-import-declaration/import-null-as-nil/actual.js @@ -0,0 +1 @@ +import { null as nil } from "bar" diff --git a/test/fixtures/esprima/es2015-import-declaration/import-null-as-nil/expected.json b/test/fixtures/esprima/es2015-import-declaration/import-null-as-nil/expected.json new file mode 100644 index 0000000000..20286c5ce1 --- /dev/null +++ b/test/fixtures/esprima/es2015-import-declaration/import-null-as-nil/expected.json @@ -0,0 +1,115 @@ +{ + "type": "File", + "start": 0, + "end": 33, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 33 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 33, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 33 + } + }, + "sourceType": "module", + "body": [ + { + "type": "ImportDeclaration", + "start": 0, + "end": 33, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 33 + } + }, + "specifiers": [ + { + "type": "ImportSpecifier", + "start": 9, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "imported": { + "type": "Identifier", + "start": 9, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "name": "null" + }, + "local": { + "type": "Identifier", + "start": 17, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 17 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "name": "nil" + } + } + ], + "source": { + "type": "Literal", + "start": 28, + "end": 33, + "loc": { + "start": { + "line": 1, + "column": 28 + }, + "end": { + "line": 1, + "column": 33 + } + }, + "value": "bar", + "rawValue": "bar", + "raw": "\"bar\"" + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-import-declaration/invalid-import-default-after-named-after-default/actual.js b/test/fixtures/esprima/es2015-import-declaration/invalid-import-default-after-named-after-default/actual.js new file mode 100644 index 0000000000..69aac7e8e1 --- /dev/null +++ b/test/fixtures/esprima/es2015-import-declaration/invalid-import-default-after-named-after-default/actual.js @@ -0,0 +1 @@ +import foo, {bar}, foo from "foo"; diff --git a/test/fixtures/esprima/es2015-import-declaration/invalid-import-default-after-named-after-default/options.json b/test/fixtures/esprima/es2015-import-declaration/invalid-import-default-after-named-after-default/options.json new file mode 100644 index 0000000000..8bb9a5f99b --- /dev/null +++ b/test/fixtures/esprima/es2015-import-declaration/invalid-import-default-after-named-after-default/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Unexpected token (1:17)" +} \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-import-declaration/invalid-import-default-after-named/actual.js b/test/fixtures/esprima/es2015-import-declaration/invalid-import-default-after-named/actual.js new file mode 100644 index 0000000000..5be12dab64 --- /dev/null +++ b/test/fixtures/esprima/es2015-import-declaration/invalid-import-default-after-named/actual.js @@ -0,0 +1 @@ +import {bar}, foo from "foo" diff --git a/test/fixtures/esprima/es2015-import-declaration/invalid-import-default-after-named/options.json b/test/fixtures/esprima/es2015-import-declaration/invalid-import-default-after-named/options.json new file mode 100644 index 0000000000..358068a16a --- /dev/null +++ b/test/fixtures/esprima/es2015-import-declaration/invalid-import-default-after-named/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Unexpected token (1:12)" +} \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-import-declaration/invalid-import-default-missing-module-specifier/actual.js b/test/fixtures/esprima/es2015-import-declaration/invalid-import-default-missing-module-specifier/actual.js new file mode 100644 index 0000000000..ddf557475a --- /dev/null +++ b/test/fixtures/esprima/es2015-import-declaration/invalid-import-default-missing-module-specifier/actual.js @@ -0,0 +1 @@ +import foo diff --git a/test/fixtures/esprima/es2015-import-declaration/invalid-import-default-missing-module-specifier/options.json b/test/fixtures/esprima/es2015-import-declaration/invalid-import-default-missing-module-specifier/options.json new file mode 100644 index 0000000000..328b1ddde8 --- /dev/null +++ b/test/fixtures/esprima/es2015-import-declaration/invalid-import-default-missing-module-specifier/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Unexpected token (1:10)" +} \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-import-declaration/invalid-import-default-module-specifier/actual.js b/test/fixtures/esprima/es2015-import-declaration/invalid-import-default-module-specifier/actual.js new file mode 100644 index 0000000000..16e3ea2897 --- /dev/null +++ b/test/fixtures/esprima/es2015-import-declaration/invalid-import-default-module-specifier/actual.js @@ -0,0 +1 @@ +import foo from bar; diff --git a/test/fixtures/esprima/es2015-import-declaration/invalid-import-default-module-specifier/options.json b/test/fixtures/esprima/es2015-import-declaration/invalid-import-default-module-specifier/options.json new file mode 100644 index 0000000000..89e36d9013 --- /dev/null +++ b/test/fixtures/esprima/es2015-import-declaration/invalid-import-default-module-specifier/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Unexpected token (1:16)" +} \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-import-declaration/invalid-import-default/actual.js b/test/fixtures/esprima/es2015-import-declaration/invalid-import-default/actual.js new file mode 100644 index 0000000000..6399a1a662 --- /dev/null +++ b/test/fixtures/esprima/es2015-import-declaration/invalid-import-default/actual.js @@ -0,0 +1 @@ +import default from "foo" diff --git a/test/fixtures/esprima/es2015-import-declaration/invalid-import-default/options.json b/test/fixtures/esprima/es2015-import-declaration/invalid-import-default/options.json new file mode 100644 index 0000000000..167116741e --- /dev/null +++ b/test/fixtures/esprima/es2015-import-declaration/invalid-import-default/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Unexpected token (1:7)" +} \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-import-declaration/invalid-import-missing-comma/actual.js b/test/fixtures/esprima/es2015-import-declaration/invalid-import-missing-comma/actual.js new file mode 100644 index 0000000000..e54f9c16f5 --- /dev/null +++ b/test/fixtures/esprima/es2015-import-declaration/invalid-import-missing-comma/actual.js @@ -0,0 +1 @@ +import foo { bar } from "bar"; diff --git a/test/fixtures/esprima/es2015-import-declaration/invalid-import-missing-comma/options.json b/test/fixtures/esprima/es2015-import-declaration/invalid-import-missing-comma/options.json new file mode 100644 index 0000000000..3e33f7730f --- /dev/null +++ b/test/fixtures/esprima/es2015-import-declaration/invalid-import-missing-comma/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Unexpected token (1:11)" +} \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-import-declaration/invalid-import-missing-module-specifier/actual.js b/test/fixtures/esprima/es2015-import-declaration/invalid-import-missing-module-specifier/actual.js new file mode 100644 index 0000000000..338ebc128b --- /dev/null +++ b/test/fixtures/esprima/es2015-import-declaration/invalid-import-missing-module-specifier/actual.js @@ -0,0 +1 @@ +import { foo, bar } diff --git a/test/fixtures/esprima/es2015-import-declaration/invalid-import-missing-module-specifier/options.json b/test/fixtures/esprima/es2015-import-declaration/invalid-import-missing-module-specifier/options.json new file mode 100644 index 0000000000..1e730e1707 --- /dev/null +++ b/test/fixtures/esprima/es2015-import-declaration/invalid-import-missing-module-specifier/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Unexpected token (1:19)" +} \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-import-declaration/invalid-import-module-specifier/actual.js b/test/fixtures/esprima/es2015-import-declaration/invalid-import-module-specifier/actual.js new file mode 100644 index 0000000000..15dda167c6 --- /dev/null +++ b/test/fixtures/esprima/es2015-import-declaration/invalid-import-module-specifier/actual.js @@ -0,0 +1 @@ +export {foo} from bar diff --git a/test/fixtures/esprima/es2015-import-declaration/invalid-import-module-specifier/options.json b/test/fixtures/esprima/es2015-import-declaration/invalid-import-module-specifier/options.json new file mode 100644 index 0000000000..2a73699bc2 --- /dev/null +++ b/test/fixtures/esprima/es2015-import-declaration/invalid-import-module-specifier/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Unexpected token (1:18)" +} \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-import-declaration/invalid-import-named-after-named/actual.js b/test/fixtures/esprima/es2015-import-declaration/invalid-import-named-after-named/actual.js new file mode 100644 index 0000000000..a0557bf0ea --- /dev/null +++ b/test/fixtures/esprima/es2015-import-declaration/invalid-import-named-after-named/actual.js @@ -0,0 +1 @@ +import {bar}, {foo} from "foo"; diff --git a/test/fixtures/esprima/es2015-import-declaration/invalid-import-named-after-named/options.json b/test/fixtures/esprima/es2015-import-declaration/invalid-import-named-after-named/options.json new file mode 100644 index 0000000000..358068a16a --- /dev/null +++ b/test/fixtures/esprima/es2015-import-declaration/invalid-import-named-after-named/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Unexpected token (1:12)" +} \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-import-declaration/invalid-import-named-after-namespace/actual.js b/test/fixtures/esprima/es2015-import-declaration/invalid-import-named-after-namespace/actual.js new file mode 100644 index 0000000000..24cede9de6 --- /dev/null +++ b/test/fixtures/esprima/es2015-import-declaration/invalid-import-named-after-namespace/actual.js @@ -0,0 +1 @@ +import * as foo, {bar} from "foo"; diff --git a/test/fixtures/esprima/es2015-import-declaration/invalid-import-named-after-namespace/options.json b/test/fixtures/esprima/es2015-import-declaration/invalid-import-named-after-namespace/options.json new file mode 100644 index 0000000000..7ca1e1ffbb --- /dev/null +++ b/test/fixtures/esprima/es2015-import-declaration/invalid-import-named-after-namespace/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Unexpected token (1:15)" +} \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-import-declaration/invalid-import-named-as-missing-from/actual.js b/test/fixtures/esprima/es2015-import-declaration/invalid-import-named-as-missing-from/actual.js new file mode 100644 index 0000000000..5d7daedfbd --- /dev/null +++ b/test/fixtures/esprima/es2015-import-declaration/invalid-import-named-as-missing-from/actual.js @@ -0,0 +1 @@ +import {default as foo} diff --git a/test/fixtures/esprima/es2015-import-declaration/invalid-import-named-as-missing-from/options.json b/test/fixtures/esprima/es2015-import-declaration/invalid-import-named-as-missing-from/options.json new file mode 100644 index 0000000000..2ddc9e708f --- /dev/null +++ b/test/fixtures/esprima/es2015-import-declaration/invalid-import-named-as-missing-from/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Unexpected token (1:23)" +} \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-import-declaration/invalid-import-namespace-after-named/actual.js b/test/fixtures/esprima/es2015-import-declaration/invalid-import-namespace-after-named/actual.js new file mode 100644 index 0000000000..09d0d344e6 --- /dev/null +++ b/test/fixtures/esprima/es2015-import-declaration/invalid-import-namespace-after-named/actual.js @@ -0,0 +1 @@ +import {bar}, * as foo from "foo"; diff --git a/test/fixtures/esprima/es2015-import-declaration/invalid-import-namespace-after-named/options.json b/test/fixtures/esprima/es2015-import-declaration/invalid-import-namespace-after-named/options.json new file mode 100644 index 0000000000..358068a16a --- /dev/null +++ b/test/fixtures/esprima/es2015-import-declaration/invalid-import-namespace-after-named/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Unexpected token (1:12)" +} \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-import-declaration/invalid-import-namespace-missing-as/actual.js b/test/fixtures/esprima/es2015-import-declaration/invalid-import-namespace-missing-as/actual.js new file mode 100644 index 0000000000..4382a94adb --- /dev/null +++ b/test/fixtures/esprima/es2015-import-declaration/invalid-import-namespace-missing-as/actual.js @@ -0,0 +1 @@ +import * from "foo" diff --git a/test/fixtures/esprima/es2015-import-declaration/invalid-import-namespace-missing-as/options.json b/test/fixtures/esprima/es2015-import-declaration/invalid-import-namespace-missing-as/options.json new file mode 100644 index 0000000000..93db7641c7 --- /dev/null +++ b/test/fixtures/esprima/es2015-import-declaration/invalid-import-namespace-missing-as/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Unexpected token (1:9)" +} \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-import-declaration/invalid-import-specifiers/actual.js b/test/fixtures/esprima/es2015-import-declaration/invalid-import-specifiers/actual.js new file mode 100644 index 0000000000..297310b37d --- /dev/null +++ b/test/fixtures/esprima/es2015-import-declaration/invalid-import-specifiers/actual.js @@ -0,0 +1 @@ +import foo, from "bar"; diff --git a/test/fixtures/esprima/es2015-import-declaration/invalid-import-specifiers/options.json b/test/fixtures/esprima/es2015-import-declaration/invalid-import-specifiers/options.json new file mode 100644 index 0000000000..358068a16a --- /dev/null +++ b/test/fixtures/esprima/es2015-import-declaration/invalid-import-specifiers/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Unexpected token (1:12)" +} \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-import-declaration/options.json b/test/fixtures/esprima/es2015-import-declaration/options.json new file mode 100644 index 0000000000..2104ca4328 --- /dev/null +++ b/test/fixtures/esprima/es2015-import-declaration/options.json @@ -0,0 +1,3 @@ +{ + "sourceType": "module" +} diff --git a/test/fixtures/esprima/es2015-lexical-declaration/invalid_complex_binding_without_init/actual.js b/test/fixtures/esprima/es2015-lexical-declaration/invalid_complex_binding_without_init/actual.js new file mode 100644 index 0000000000..ba39fedac6 --- /dev/null +++ b/test/fixtures/esprima/es2015-lexical-declaration/invalid_complex_binding_without_init/actual.js @@ -0,0 +1 @@ +let [] diff --git a/test/fixtures/esprima/es2015-lexical-declaration/invalid_complex_binding_without_init/options.json b/test/fixtures/esprima/es2015-lexical-declaration/invalid_complex_binding_without_init/options.json new file mode 100644 index 0000000000..8cb567ee77 --- /dev/null +++ b/test/fixtures/esprima/es2015-lexical-declaration/invalid_complex_binding_without_init/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Complex binding patterns require an initialization value (1:6)" +} \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-lexical-declaration/invalid_const_forin/actual.js b/test/fixtures/esprima/es2015-lexical-declaration/invalid_const_forin/actual.js new file mode 100644 index 0000000000..2c6e10ed33 --- /dev/null +++ b/test/fixtures/esprima/es2015-lexical-declaration/invalid_const_forin/actual.js @@ -0,0 +1 @@ +for (const x = 0 in y){} diff --git a/test/fixtures/esprima/es2015-lexical-declaration/invalid_const_forin/options.json b/test/fixtures/esprima/es2015-lexical-declaration/invalid_const_forin/options.json new file mode 100644 index 0000000000..8bb9a5f99b --- /dev/null +++ b/test/fixtures/esprima/es2015-lexical-declaration/invalid_const_forin/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Unexpected token (1:17)" +} \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-lexical-declaration/invalid_let_forin/actual.js b/test/fixtures/esprima/es2015-lexical-declaration/invalid_let_forin/actual.js new file mode 100644 index 0000000000..6686af7386 --- /dev/null +++ b/test/fixtures/esprima/es2015-lexical-declaration/invalid_let_forin/actual.js @@ -0,0 +1 @@ +for (let x = 0 in y){} diff --git a/test/fixtures/esprima/es2015-lexical-declaration/invalid_let_forin/options.json b/test/fixtures/esprima/es2015-lexical-declaration/invalid_let_forin/options.json new file mode 100644 index 0000000000..7ca1e1ffbb --- /dev/null +++ b/test/fixtures/esprima/es2015-lexical-declaration/invalid_let_forin/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Unexpected token (1:15)" +} \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-lexical-declaration/migrated_0000/actual.js b/test/fixtures/esprima/es2015-lexical-declaration/migrated_0000/actual.js new file mode 100644 index 0000000000..5df03fa0b7 --- /dev/null +++ b/test/fixtures/esprima/es2015-lexical-declaration/migrated_0000/actual.js @@ -0,0 +1 @@ +switch (answer) { case 42: let t = 42; break; } diff --git a/test/fixtures/esprima/es2015-lexical-declaration/migrated_0000/expected.json b/test/fixtures/esprima/es2015-lexical-declaration/migrated_0000/expected.json new file mode 100644 index 0000000000..9cb6015642 --- /dev/null +++ b/test/fixtures/esprima/es2015-lexical-declaration/migrated_0000/expected.json @@ -0,0 +1,184 @@ +{ + "type": "File", + "start": 0, + "end": 47, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 47 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 47, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 47 + } + }, + "sourceType": "script", + "body": [ + { + "type": "SwitchStatement", + "start": 0, + "end": 47, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 47 + } + }, + "discriminant": { + "type": "Identifier", + "start": 8, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "name": "answer" + }, + "cases": [ + { + "type": "SwitchCase", + "start": 18, + "end": 45, + "loc": { + "start": { + "line": 1, + "column": 18 + }, + "end": { + "line": 1, + "column": 45 + } + }, + "consequent": [ + { + "type": "VariableDeclaration", + "start": 27, + "end": 38, + "loc": { + "start": { + "line": 1, + "column": 27 + }, + "end": { + "line": 1, + "column": 38 + } + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 31, + "end": 37, + "loc": { + "start": { + "line": 1, + "column": 31 + }, + "end": { + "line": 1, + "column": 37 + } + }, + "id": { + "type": "Identifier", + "start": 31, + "end": 32, + "loc": { + "start": { + "line": 1, + "column": 31 + }, + "end": { + "line": 1, + "column": 32 + } + }, + "name": "t" + }, + "init": { + "type": "Literal", + "start": 35, + "end": 37, + "loc": { + "start": { + "line": 1, + "column": 35 + }, + "end": { + "line": 1, + "column": 37 + } + }, + "value": 42, + "rawValue": 42, + "raw": "42" + } + } + ], + "kind": "let" + }, + { + "type": "BreakStatement", + "start": 39, + "end": 45, + "loc": { + "start": { + "line": 1, + "column": 39 + }, + "end": { + "line": 1, + "column": 45 + } + }, + "label": null + } + ], + "test": { + "type": "Literal", + "start": 23, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 23 + }, + "end": { + "line": 1, + "column": 25 + } + }, + "value": 42, + "rawValue": 42, + "raw": "42" + } + } + ] + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-meta-property/assign-new-target/actual.js b/test/fixtures/esprima/es2015-meta-property/assign-new-target/actual.js new file mode 100644 index 0000000000..34426e1f42 --- /dev/null +++ b/test/fixtures/esprima/es2015-meta-property/assign-new-target/actual.js @@ -0,0 +1,3 @@ +function f() { + let x = new.target; +} diff --git a/test/fixtures/esprima/es2015-meta-property/assign-new-target/expected.json b/test/fixtures/esprima/es2015-meta-property/assign-new-target/expected.json new file mode 100644 index 0000000000..e909c85c33 --- /dev/null +++ b/test/fixtures/esprima/es2015-meta-property/assign-new-target/expected.json @@ -0,0 +1,180 @@ +{ + "type": "File", + "start": 0, + "end": 40, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 3, + "column": 1 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 40, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 3, + "column": 1 + } + }, + "sourceType": "script", + "body": [ + { + "type": "FunctionDeclaration", + "start": 0, + "end": 40, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 3, + "column": 1 + } + }, + "id": { + "type": "Identifier", + "start": 9, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "name": "f" + }, + "generator": false, + "expression": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 13, + "end": 40, + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 3, + "column": 1 + } + }, + "body": [ + { + "type": "VariableDeclaration", + "start": 19, + "end": 38, + "loc": { + "start": { + "line": 2, + "column": 4 + }, + "end": { + "line": 2, + "column": 23 + } + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 23, + "end": 37, + "loc": { + "start": { + "line": 2, + "column": 8 + }, + "end": { + "line": 2, + "column": 22 + } + }, + "id": { + "type": "Identifier", + "start": 23, + "end": 24, + "loc": { + "start": { + "line": 2, + "column": 8 + }, + "end": { + "line": 2, + "column": 9 + } + }, + "name": "x" + }, + "init": { + "type": "MetaProperty", + "start": 27, + "end": 37, + "loc": { + "start": { + "line": 2, + "column": 12 + }, + "end": { + "line": 2, + "column": 22 + } + }, + "meta": { + "type": "Identifier", + "start": 27, + "end": 30, + "loc": { + "start": { + "line": 2, + "column": 12 + }, + "end": { + "line": 2, + "column": 15 + } + }, + "name": "new" + }, + "property": { + "type": "Identifier", + "start": 31, + "end": 37, + "loc": { + "start": { + "line": 2, + "column": 16 + }, + "end": { + "line": 2, + "column": 22 + } + }, + "name": "target" + } + } + } + ], + "kind": "let" + } + ] + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-meta-property/invalid-dots/actual.js b/test/fixtures/esprima/es2015-meta-property/invalid-dots/actual.js new file mode 100644 index 0000000000..a535e5644b --- /dev/null +++ b/test/fixtures/esprima/es2015-meta-property/invalid-dots/actual.js @@ -0,0 +1 @@ +var x = function() { y = new..target; } diff --git a/test/fixtures/esprima/es2015-meta-property/invalid-dots/options.json b/test/fixtures/esprima/es2015-meta-property/invalid-dots/options.json new file mode 100644 index 0000000000..4e08e9340e --- /dev/null +++ b/test/fixtures/esprima/es2015-meta-property/invalid-dots/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Unexpected token (1:29)" +} \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-meta-property/invalid-new-target/actual.js b/test/fixtures/esprima/es2015-meta-property/invalid-new-target/actual.js new file mode 100644 index 0000000000..46b13d0e56 --- /dev/null +++ b/test/fixtures/esprima/es2015-meta-property/invalid-new-target/actual.js @@ -0,0 +1 @@ +var x = new.target; diff --git a/test/fixtures/esprima/es2015-meta-property/invalid-new-target/expected.json b/test/fixtures/esprima/es2015-meta-property/invalid-new-target/expected.json new file mode 100644 index 0000000000..c2ab0aba1b --- /dev/null +++ b/test/fixtures/esprima/es2015-meta-property/invalid-new-target/expected.json @@ -0,0 +1,129 @@ +{ + "type": "File", + "start": 0, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 19 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 19 + } + }, + "sourceType": "script", + "body": [ + { + "type": "VariableDeclaration", + "start": 0, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 19 + } + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 4, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "id": { + "type": "Identifier", + "start": 4, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "name": "x" + }, + "init": { + "type": "MetaProperty", + "start": 8, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "meta": { + "type": "Identifier", + "start": 8, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "name": "new" + }, + "property": { + "type": "Identifier", + "start": 12, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 12 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "name": "target" + } + } + } + ], + "kind": "var" + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-meta-property/invalid-new-target/options.json b/test/fixtures/esprima/es2015-meta-property/invalid-new-target/options.json new file mode 100644 index 0000000000..27f6e27de8 --- /dev/null +++ b/test/fixtures/esprima/es2015-meta-property/invalid-new-target/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Unexpected token (1:13)" +} \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-meta-property/new-new-target/actual.js b/test/fixtures/esprima/es2015-meta-property/new-new-target/actual.js new file mode 100644 index 0000000000..ac74ad9bc2 --- /dev/null +++ b/test/fixtures/esprima/es2015-meta-property/new-new-target/actual.js @@ -0,0 +1,3 @@ +function f() { + new new.target; +} diff --git a/test/fixtures/esprima/es2015-meta-property/new-new-target/expected.json b/test/fixtures/esprima/es2015-meta-property/new-new-target/expected.json new file mode 100644 index 0000000000..545d3f05a9 --- /dev/null +++ b/test/fixtures/esprima/es2015-meta-property/new-new-target/expected.json @@ -0,0 +1,162 @@ +{ + "type": "File", + "start": 0, + "end": 36, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 3, + "column": 1 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 36, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 3, + "column": 1 + } + }, + "sourceType": "script", + "body": [ + { + "type": "FunctionDeclaration", + "start": 0, + "end": 36, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 3, + "column": 1 + } + }, + "id": { + "type": "Identifier", + "start": 9, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "name": "f" + }, + "generator": false, + "expression": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 13, + "end": 36, + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 3, + "column": 1 + } + }, + "body": [ + { + "type": "ExpressionStatement", + "start": 19, + "end": 34, + "loc": { + "start": { + "line": 2, + "column": 4 + }, + "end": { + "line": 2, + "column": 19 + } + }, + "expression": { + "type": "NewExpression", + "start": 19, + "end": 33, + "loc": { + "start": { + "line": 2, + "column": 4 + }, + "end": { + "line": 2, + "column": 18 + } + }, + "callee": { + "type": "MetaProperty", + "start": 23, + "end": 33, + "loc": { + "start": { + "line": 2, + "column": 8 + }, + "end": { + "line": 2, + "column": 18 + } + }, + "meta": { + "type": "Identifier", + "start": 23, + "end": 26, + "loc": { + "start": { + "line": 2, + "column": 8 + }, + "end": { + "line": 2, + "column": 11 + } + }, + "name": "new" + }, + "property": { + "type": "Identifier", + "start": 27, + "end": 33, + "loc": { + "start": { + "line": 2, + "column": 12 + }, + "end": { + "line": 2, + "column": 18 + } + }, + "name": "target" + } + }, + "arguments": [] + } + } + ] + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-meta-property/new-target-declaration/actual.js b/test/fixtures/esprima/es2015-meta-property/new-target-declaration/actual.js new file mode 100644 index 0000000000..01687a0993 --- /dev/null +++ b/test/fixtures/esprima/es2015-meta-property/new-target-declaration/actual.js @@ -0,0 +1,3 @@ +function f() { + new.target; +} diff --git a/test/fixtures/esprima/es2015-meta-property/new-target-declaration/expected.json b/test/fixtures/esprima/es2015-meta-property/new-target-declaration/expected.json new file mode 100644 index 0000000000..154850a47c --- /dev/null +++ b/test/fixtures/esprima/es2015-meta-property/new-target-declaration/expected.json @@ -0,0 +1,146 @@ +{ + "type": "File", + "start": 0, + "end": 32, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 3, + "column": 1 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 32, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 3, + "column": 1 + } + }, + "sourceType": "script", + "body": [ + { + "type": "FunctionDeclaration", + "start": 0, + "end": 32, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 3, + "column": 1 + } + }, + "id": { + "type": "Identifier", + "start": 9, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "name": "f" + }, + "generator": false, + "expression": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 13, + "end": 32, + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 3, + "column": 1 + } + }, + "body": [ + { + "type": "ExpressionStatement", + "start": 19, + "end": 30, + "loc": { + "start": { + "line": 2, + "column": 4 + }, + "end": { + "line": 2, + "column": 15 + } + }, + "expression": { + "type": "MetaProperty", + "start": 19, + "end": 29, + "loc": { + "start": { + "line": 2, + "column": 4 + }, + "end": { + "line": 2, + "column": 14 + } + }, + "meta": { + "type": "Identifier", + "start": 19, + "end": 22, + "loc": { + "start": { + "line": 2, + "column": 4 + }, + "end": { + "line": 2, + "column": 7 + } + }, + "name": "new" + }, + "property": { + "type": "Identifier", + "start": 23, + "end": 29, + "loc": { + "start": { + "line": 2, + "column": 8 + }, + "end": { + "line": 2, + "column": 14 + } + }, + "name": "target" + } + } + } + ] + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-meta-property/new-target-expression/actual.js b/test/fixtures/esprima/es2015-meta-property/new-target-expression/actual.js new file mode 100644 index 0000000000..f8f320a995 --- /dev/null +++ b/test/fixtures/esprima/es2015-meta-property/new-target-expression/actual.js @@ -0,0 +1 @@ +var f = function() { new.target; } diff --git a/test/fixtures/esprima/es2015-meta-property/new-target-expression/expected.json b/test/fixtures/esprima/es2015-meta-property/new-target-expression/expected.json new file mode 100644 index 0000000000..fdf1e48cdb --- /dev/null +++ b/test/fixtures/esprima/es2015-meta-property/new-target-expression/expected.json @@ -0,0 +1,180 @@ +{ + "type": "File", + "start": 0, + "end": 34, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 34 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 34, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 34 + } + }, + "sourceType": "script", + "body": [ + { + "type": "VariableDeclaration", + "start": 0, + "end": 34, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 34 + } + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 4, + "end": 34, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 34 + } + }, + "id": { + "type": "Identifier", + "start": 4, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "name": "f" + }, + "init": { + "type": "FunctionExpression", + "start": 8, + "end": 34, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 34 + } + }, + "id": null, + "generator": false, + "expression": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 19, + "end": 34, + "loc": { + "start": { + "line": 1, + "column": 19 + }, + "end": { + "line": 1, + "column": 34 + } + }, + "body": [ + { + "type": "ExpressionStatement", + "start": 21, + "end": 32, + "loc": { + "start": { + "line": 1, + "column": 21 + }, + "end": { + "line": 1, + "column": 32 + } + }, + "expression": { + "type": "MetaProperty", + "start": 21, + "end": 31, + "loc": { + "start": { + "line": 1, + "column": 21 + }, + "end": { + "line": 1, + "column": 31 + } + }, + "meta": { + "type": "Identifier", + "start": 21, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 21 + }, + "end": { + "line": 1, + "column": 24 + } + }, + "name": "new" + }, + "property": { + "type": "Identifier", + "start": 25, + "end": 31, + "loc": { + "start": { + "line": 1, + "column": 25 + }, + "end": { + "line": 1, + "column": 31 + } + }, + "name": "target" + } + } + } + ] + } + } + } + ], + "kind": "var" + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-meta-property/new-target-invoke/actual.js b/test/fixtures/esprima/es2015-meta-property/new-target-invoke/actual.js new file mode 100644 index 0000000000..bebd659c0c --- /dev/null +++ b/test/fixtures/esprima/es2015-meta-property/new-target-invoke/actual.js @@ -0,0 +1,3 @@ +function f() { + new.target(); +} diff --git a/test/fixtures/esprima/es2015-meta-property/new-target-invoke/expected.json b/test/fixtures/esprima/es2015-meta-property/new-target-invoke/expected.json new file mode 100644 index 0000000000..4480d5f16b --- /dev/null +++ b/test/fixtures/esprima/es2015-meta-property/new-target-invoke/expected.json @@ -0,0 +1,162 @@ +{ + "type": "File", + "start": 0, + "end": 34, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 3, + "column": 1 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 34, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 3, + "column": 1 + } + }, + "sourceType": "script", + "body": [ + { + "type": "FunctionDeclaration", + "start": 0, + "end": 34, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 3, + "column": 1 + } + }, + "id": { + "type": "Identifier", + "start": 9, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "name": "f" + }, + "generator": false, + "expression": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 13, + "end": 34, + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 3, + "column": 1 + } + }, + "body": [ + { + "type": "ExpressionStatement", + "start": 19, + "end": 32, + "loc": { + "start": { + "line": 2, + "column": 4 + }, + "end": { + "line": 2, + "column": 17 + } + }, + "expression": { + "type": "CallExpression", + "start": 19, + "end": 31, + "loc": { + "start": { + "line": 2, + "column": 4 + }, + "end": { + "line": 2, + "column": 16 + } + }, + "callee": { + "type": "MetaProperty", + "start": 19, + "end": 29, + "loc": { + "start": { + "line": 2, + "column": 4 + }, + "end": { + "line": 2, + "column": 14 + } + }, + "meta": { + "type": "Identifier", + "start": 19, + "end": 22, + "loc": { + "start": { + "line": 2, + "column": 4 + }, + "end": { + "line": 2, + "column": 7 + } + }, + "name": "new" + }, + "property": { + "type": "Identifier", + "start": 23, + "end": 29, + "loc": { + "start": { + "line": 2, + "column": 8 + }, + "end": { + "line": 2, + "column": 14 + } + }, + "name": "target" + } + }, + "arguments": [] + } + } + ] + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-meta-property/new-target-precedence/actual.js b/test/fixtures/esprima/es2015-meta-property/new-target-precedence/actual.js new file mode 100644 index 0000000000..d5dded3f12 --- /dev/null +++ b/test/fixtures/esprima/es2015-meta-property/new-target-precedence/actual.js @@ -0,0 +1,3 @@ +function f() { + new new.target()(); +} diff --git a/test/fixtures/esprima/es2015-meta-property/new-target-precedence/expected.json b/test/fixtures/esprima/es2015-meta-property/new-target-precedence/expected.json new file mode 100644 index 0000000000..3a85fec1a1 --- /dev/null +++ b/test/fixtures/esprima/es2015-meta-property/new-target-precedence/expected.json @@ -0,0 +1,178 @@ +{ + "type": "File", + "start": 0, + "end": 40, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 3, + "column": 1 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 40, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 3, + "column": 1 + } + }, + "sourceType": "script", + "body": [ + { + "type": "FunctionDeclaration", + "start": 0, + "end": 40, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 3, + "column": 1 + } + }, + "id": { + "type": "Identifier", + "start": 9, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "name": "f" + }, + "generator": false, + "expression": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 13, + "end": 40, + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 3, + "column": 1 + } + }, + "body": [ + { + "type": "ExpressionStatement", + "start": 19, + "end": 38, + "loc": { + "start": { + "line": 2, + "column": 4 + }, + "end": { + "line": 2, + "column": 23 + } + }, + "expression": { + "type": "CallExpression", + "start": 19, + "end": 37, + "loc": { + "start": { + "line": 2, + "column": 4 + }, + "end": { + "line": 2, + "column": 22 + } + }, + "callee": { + "type": "NewExpression", + "start": 19, + "end": 35, + "loc": { + "start": { + "line": 2, + "column": 4 + }, + "end": { + "line": 2, + "column": 20 + } + }, + "callee": { + "type": "MetaProperty", + "start": 23, + "end": 33, + "loc": { + "start": { + "line": 2, + "column": 8 + }, + "end": { + "line": 2, + "column": 18 + } + }, + "meta": { + "type": "Identifier", + "start": 23, + "end": 26, + "loc": { + "start": { + "line": 2, + "column": 8 + }, + "end": { + "line": 2, + "column": 11 + } + }, + "name": "new" + }, + "property": { + "type": "Identifier", + "start": 27, + "end": 33, + "loc": { + "start": { + "line": 2, + "column": 12 + }, + "end": { + "line": 2, + "column": 18 + } + }, + "name": "target" + } + }, + "arguments": [] + }, + "arguments": [] + } + } + ] + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-meta-property/unknown-property/actual.js b/test/fixtures/esprima/es2015-meta-property/unknown-property/actual.js new file mode 100644 index 0000000000..dc1b123d55 --- /dev/null +++ b/test/fixtures/esprima/es2015-meta-property/unknown-property/actual.js @@ -0,0 +1 @@ +var f = function() { new.unknown_property; } diff --git a/test/fixtures/esprima/es2015-meta-property/unknown-property/options.json b/test/fixtures/esprima/es2015-meta-property/unknown-property/options.json new file mode 100644 index 0000000000..2985f64e65 --- /dev/null +++ b/test/fixtures/esprima/es2015-meta-property/unknown-property/options.json @@ -0,0 +1,3 @@ +{ + "throws": "The only valid meta property for new is new.target (1:25)" +} \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-method-definition/migrated_0000/actual.js b/test/fixtures/esprima/es2015-method-definition/migrated_0000/actual.js new file mode 100644 index 0000000000..9b4c1e304a --- /dev/null +++ b/test/fixtures/esprima/es2015-method-definition/migrated_0000/actual.js @@ -0,0 +1 @@ +x = { method() { } } diff --git a/test/fixtures/esprima/es2015-method-definition/migrated_0000/expected.json b/test/fixtures/esprima/es2015-method-definition/migrated_0000/expected.json new file mode 100644 index 0000000000..5d4235ff90 --- /dev/null +++ b/test/fixtures/esprima/es2015-method-definition/migrated_0000/expected.json @@ -0,0 +1,167 @@ +{ + "type": "File", + "start": 0, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "expression": { + "type": "AssignmentExpression", + "start": 0, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "operator": "=", + "left": { + "type": "Identifier", + "start": 0, + "end": 1, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + } + }, + "name": "x" + }, + "right": { + "type": "ObjectExpression", + "start": 4, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "properties": [ + { + "type": "Property", + "start": 6, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "method": true, + "shorthand": false, + "computed": false, + "key": { + "type": "Identifier", + "start": 6, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "name": "method" + }, + "kind": "init", + "value": { + "type": "FunctionExpression", + "start": 12, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 12 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "id": null, + "generator": false, + "expression": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 15, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "body": [] + } + } + } + ] + } + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-method-definition/migrated_0001/actual.js b/test/fixtures/esprima/es2015-method-definition/migrated_0001/actual.js new file mode 100644 index 0000000000..01ff4912cf --- /dev/null +++ b/test/fixtures/esprima/es2015-method-definition/migrated_0001/actual.js @@ -0,0 +1 @@ +x = { method(test) { } } diff --git a/test/fixtures/esprima/es2015-method-definition/migrated_0001/expected.json b/test/fixtures/esprima/es2015-method-definition/migrated_0001/expected.json new file mode 100644 index 0000000000..9e72a8c644 --- /dev/null +++ b/test/fixtures/esprima/es2015-method-definition/migrated_0001/expected.json @@ -0,0 +1,184 @@ +{ + "type": "File", + "start": 0, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 24 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 24 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 24 + } + }, + "expression": { + "type": "AssignmentExpression", + "start": 0, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 24 + } + }, + "operator": "=", + "left": { + "type": "Identifier", + "start": 0, + "end": 1, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + } + }, + "name": "x" + }, + "right": { + "type": "ObjectExpression", + "start": 4, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 24 + } + }, + "properties": [ + { + "type": "Property", + "start": 6, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "method": true, + "shorthand": false, + "computed": false, + "key": { + "type": "Identifier", + "start": 6, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "name": "method" + }, + "kind": "init", + "value": { + "type": "FunctionExpression", + "start": 12, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 12 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "id": null, + "generator": false, + "expression": false, + "params": [ + { + "type": "Identifier", + "start": 13, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "name": "test" + } + ], + "body": { + "type": "BlockStatement", + "start": 19, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 19 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "body": [] + } + } + } + ] + } + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-method-definition/migrated_0002/actual.js b/test/fixtures/esprima/es2015-method-definition/migrated_0002/actual.js new file mode 100644 index 0000000000..0f3a2113e2 --- /dev/null +++ b/test/fixtures/esprima/es2015-method-definition/migrated_0002/actual.js @@ -0,0 +1 @@ +x = { 'method'() { } } diff --git a/test/fixtures/esprima/es2015-method-definition/migrated_0002/expected.json b/test/fixtures/esprima/es2015-method-definition/migrated_0002/expected.json new file mode 100644 index 0000000000..c05da73d96 --- /dev/null +++ b/test/fixtures/esprima/es2015-method-definition/migrated_0002/expected.json @@ -0,0 +1,169 @@ +{ + "type": "File", + "start": 0, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "expression": { + "type": "AssignmentExpression", + "start": 0, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "operator": "=", + "left": { + "type": "Identifier", + "start": 0, + "end": 1, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + } + }, + "name": "x" + }, + "right": { + "type": "ObjectExpression", + "start": 4, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "properties": [ + { + "type": "Property", + "start": 6, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "method": true, + "shorthand": false, + "computed": false, + "key": { + "type": "Literal", + "start": 6, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "value": "method", + "rawValue": "method", + "raw": "'method'" + }, + "kind": "init", + "value": { + "type": "FunctionExpression", + "start": 14, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 14 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "id": null, + "generator": false, + "expression": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 17, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 17 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "body": [] + } + } + } + ] + } + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-method-definition/migrated_0003/actual.js b/test/fixtures/esprima/es2015-method-definition/migrated_0003/actual.js new file mode 100644 index 0000000000..56936cfbd1 --- /dev/null +++ b/test/fixtures/esprima/es2015-method-definition/migrated_0003/actual.js @@ -0,0 +1 @@ +x = { get() { } } diff --git a/test/fixtures/esprima/es2015-method-definition/migrated_0003/expected.json b/test/fixtures/esprima/es2015-method-definition/migrated_0003/expected.json new file mode 100644 index 0000000000..986432a828 --- /dev/null +++ b/test/fixtures/esprima/es2015-method-definition/migrated_0003/expected.json @@ -0,0 +1,167 @@ +{ + "type": "File", + "start": 0, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "expression": { + "type": "AssignmentExpression", + "start": 0, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "operator": "=", + "left": { + "type": "Identifier", + "start": 0, + "end": 1, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + } + }, + "name": "x" + }, + "right": { + "type": "ObjectExpression", + "start": 4, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "properties": [ + { + "type": "Property", + "start": 6, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "method": true, + "shorthand": false, + "computed": false, + "key": { + "type": "Identifier", + "start": 6, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "name": "get" + }, + "kind": "init", + "value": { + "type": "FunctionExpression", + "start": 9, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "id": null, + "generator": false, + "expression": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 12, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 12 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "body": [] + } + } + } + ] + } + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-method-definition/migrated_0004/actual.js b/test/fixtures/esprima/es2015-method-definition/migrated_0004/actual.js new file mode 100644 index 0000000000..561e2f42f1 --- /dev/null +++ b/test/fixtures/esprima/es2015-method-definition/migrated_0004/actual.js @@ -0,0 +1 @@ +x = { set() { } } diff --git a/test/fixtures/esprima/es2015-method-definition/migrated_0004/expected.json b/test/fixtures/esprima/es2015-method-definition/migrated_0004/expected.json new file mode 100644 index 0000000000..8d18a3447c --- /dev/null +++ b/test/fixtures/esprima/es2015-method-definition/migrated_0004/expected.json @@ -0,0 +1,167 @@ +{ + "type": "File", + "start": 0, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "expression": { + "type": "AssignmentExpression", + "start": 0, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "operator": "=", + "left": { + "type": "Identifier", + "start": 0, + "end": 1, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + } + }, + "name": "x" + }, + "right": { + "type": "ObjectExpression", + "start": 4, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "properties": [ + { + "type": "Property", + "start": 6, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "method": true, + "shorthand": false, + "computed": false, + "key": { + "type": "Identifier", + "start": 6, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "name": "set" + }, + "kind": "init", + "value": { + "type": "FunctionExpression", + "start": 9, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "id": null, + "generator": false, + "expression": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 12, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 12 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "body": [] + } + } + } + ] + } + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-object-initialiser/invalid-proto-getter-literal-identifier/actual.js b/test/fixtures/esprima/es2015-object-initialiser/invalid-proto-getter-literal-identifier/actual.js new file mode 100644 index 0000000000..3f9966ff99 --- /dev/null +++ b/test/fixtures/esprima/es2015-object-initialiser/invalid-proto-getter-literal-identifier/actual.js @@ -0,0 +1 @@ +({ get __proto(){}, "__proto__": null, __proto__: null, }) diff --git a/test/fixtures/esprima/es2015-object-initialiser/invalid-proto-getter-literal-identifier/options.json b/test/fixtures/esprima/es2015-object-initialiser/invalid-proto-getter-literal-identifier/options.json new file mode 100644 index 0000000000..57e02d3bf4 --- /dev/null +++ b/test/fixtures/esprima/es2015-object-initialiser/invalid-proto-getter-literal-identifier/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Redefinition of __proto__ property (1:39)" +} \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-object-initialiser/invalid-proto-identifier-literal/actual.js b/test/fixtures/esprima/es2015-object-initialiser/invalid-proto-identifier-literal/actual.js new file mode 100644 index 0000000000..e399af6d6d --- /dev/null +++ b/test/fixtures/esprima/es2015-object-initialiser/invalid-proto-identifier-literal/actual.js @@ -0,0 +1 @@ +({ __proto__: null, "__proto__": null }) diff --git a/test/fixtures/esprima/es2015-object-initialiser/invalid-proto-identifier-literal/options.json b/test/fixtures/esprima/es2015-object-initialiser/invalid-proto-identifier-literal/options.json new file mode 100644 index 0000000000..f36f2e1bd9 --- /dev/null +++ b/test/fixtures/esprima/es2015-object-initialiser/invalid-proto-identifier-literal/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Redefinition of __proto__ property (1:20)" +} \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-object-initialiser/invalid-proto-identifier-shorthand/actual.js b/test/fixtures/esprima/es2015-object-initialiser/invalid-proto-identifier-shorthand/actual.js new file mode 100644 index 0000000000..c62a4ce1a1 --- /dev/null +++ b/test/fixtures/esprima/es2015-object-initialiser/invalid-proto-identifier-shorthand/actual.js @@ -0,0 +1 @@ +({ __proto__: null, __proto__ }) diff --git a/test/fixtures/esprima/es2015-object-initialiser/invalid-proto-identifier-shorthand/expected.json b/test/fixtures/esprima/es2015-object-initialiser/invalid-proto-identifier-shorthand/expected.json new file mode 100644 index 0000000000..957f3941af --- /dev/null +++ b/test/fixtures/esprima/es2015-object-initialiser/invalid-proto-identifier-shorthand/expected.json @@ -0,0 +1,170 @@ +{ + "type": "File", + "start": 0, + "end": 32, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 32 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 32, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 32 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 32, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 32 + } + }, + "expression": { + "type": "ObjectExpression", + "start": 1, + "end": 31, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 31 + } + }, + "properties": [ + { + "type": "Property", + "start": 3, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 3 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "method": false, + "shorthand": false, + "computed": false, + "key": { + "type": "Identifier", + "start": 3, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 3 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "name": "__proto__" + }, + "value": { + "type": "Literal", + "start": 14, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 14 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "value": null, + "rawValue": null, + "raw": "null" + }, + "kind": "init" + }, + { + "type": "Property", + "start": 20, + "end": 29, + "loc": { + "start": { + "line": 1, + "column": 20 + }, + "end": { + "line": 1, + "column": 29 + } + }, + "method": false, + "shorthand": true, + "computed": false, + "key": { + "type": "Identifier", + "start": 20, + "end": 29, + "loc": { + "start": { + "line": 1, + "column": 20 + }, + "end": { + "line": 1, + "column": 29 + } + }, + "name": "__proto__" + }, + "kind": "init", + "value": { + "type": "Identifier", + "start": 20, + "end": 29, + "loc": { + "start": { + "line": 1, + "column": 20 + }, + "end": { + "line": 1, + "column": 29 + } + }, + "name": "__proto__" + } + } + ], + "parenthesizedExpression": true + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-object-initialiser/invalid-proto-identifier-shorthand/options.json b/test/fixtures/esprima/es2015-object-initialiser/invalid-proto-identifier-shorthand/options.json new file mode 100644 index 0000000000..7b7329bb7e --- /dev/null +++ b/test/fixtures/esprima/es2015-object-initialiser/invalid-proto-identifier-shorthand/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Unexpected token (1:30)" +} \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-object-initialiser/invalid-proto-identifiers/actual.js b/test/fixtures/esprima/es2015-object-initialiser/invalid-proto-identifiers/actual.js new file mode 100644 index 0000000000..112b5ff8de --- /dev/null +++ b/test/fixtures/esprima/es2015-object-initialiser/invalid-proto-identifiers/actual.js @@ -0,0 +1 @@ +({ __proto__: null, __proto__: null }) diff --git a/test/fixtures/esprima/es2015-object-initialiser/invalid-proto-identifiers/options.json b/test/fixtures/esprima/es2015-object-initialiser/invalid-proto-identifiers/options.json new file mode 100644 index 0000000000..f36f2e1bd9 --- /dev/null +++ b/test/fixtures/esprima/es2015-object-initialiser/invalid-proto-identifiers/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Redefinition of __proto__ property (1:20)" +} \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-object-initialiser/invalid-proto-literal-identifier/actual.js b/test/fixtures/esprima/es2015-object-initialiser/invalid-proto-literal-identifier/actual.js new file mode 100644 index 0000000000..4e890f9366 --- /dev/null +++ b/test/fixtures/esprima/es2015-object-initialiser/invalid-proto-literal-identifier/actual.js @@ -0,0 +1 @@ +({ "__proto__": null, __proto__: null }) diff --git a/test/fixtures/esprima/es2015-object-initialiser/invalid-proto-literal-identifier/options.json b/test/fixtures/esprima/es2015-object-initialiser/invalid-proto-literal-identifier/options.json new file mode 100644 index 0000000000..afd5a5116b --- /dev/null +++ b/test/fixtures/esprima/es2015-object-initialiser/invalid-proto-literal-identifier/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Redefinition of __proto__ property (1:22)" +} \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-object-initialiser/invalid-proto-literal-shorthand/actual.js b/test/fixtures/esprima/es2015-object-initialiser/invalid-proto-literal-shorthand/actual.js new file mode 100644 index 0000000000..2972018b5a --- /dev/null +++ b/test/fixtures/esprima/es2015-object-initialiser/invalid-proto-literal-shorthand/actual.js @@ -0,0 +1 @@ +({ "__proto__": null, __proto__ }) diff --git a/test/fixtures/esprima/es2015-object-initialiser/invalid-proto-literal-shorthand/expected.json b/test/fixtures/esprima/es2015-object-initialiser/invalid-proto-literal-shorthand/expected.json new file mode 100644 index 0000000000..22e6537ffa --- /dev/null +++ b/test/fixtures/esprima/es2015-object-initialiser/invalid-proto-literal-shorthand/expected.json @@ -0,0 +1,172 @@ +{ + "type": "File", + "start": 0, + "end": 34, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 34 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 34, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 34 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 34, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 34 + } + }, + "expression": { + "type": "ObjectExpression", + "start": 1, + "end": 33, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 33 + } + }, + "properties": [ + { + "type": "Property", + "start": 3, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 3 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "method": false, + "shorthand": false, + "computed": false, + "key": { + "type": "Literal", + "start": 3, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 3 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "value": "__proto__", + "rawValue": "__proto__", + "raw": "\"__proto__\"" + }, + "value": { + "type": "Literal", + "start": 16, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 16 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "value": null, + "rawValue": null, + "raw": "null" + }, + "kind": "init" + }, + { + "type": "Property", + "start": 22, + "end": 31, + "loc": { + "start": { + "line": 1, + "column": 22 + }, + "end": { + "line": 1, + "column": 31 + } + }, + "method": false, + "shorthand": true, + "computed": false, + "key": { + "type": "Identifier", + "start": 22, + "end": 31, + "loc": { + "start": { + "line": 1, + "column": 22 + }, + "end": { + "line": 1, + "column": 31 + } + }, + "name": "__proto__" + }, + "kind": "init", + "value": { + "type": "Identifier", + "start": 22, + "end": 31, + "loc": { + "start": { + "line": 1, + "column": 22 + }, + "end": { + "line": 1, + "column": 31 + } + }, + "name": "__proto__" + } + } + ], + "parenthesizedExpression": true + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-object-initialiser/invalid-proto-literal-shorthand/options.json b/test/fixtures/esprima/es2015-object-initialiser/invalid-proto-literal-shorthand/options.json new file mode 100644 index 0000000000..cbc444ce90 --- /dev/null +++ b/test/fixtures/esprima/es2015-object-initialiser/invalid-proto-literal-shorthand/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Unexpected token (1:32)" +} \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-object-initialiser/invalid-proto-literals/actual.js b/test/fixtures/esprima/es2015-object-initialiser/invalid-proto-literals/actual.js new file mode 100644 index 0000000000..be94b24002 --- /dev/null +++ b/test/fixtures/esprima/es2015-object-initialiser/invalid-proto-literals/actual.js @@ -0,0 +1 @@ +({ "__proto__": null, '__proto__': null }) diff --git a/test/fixtures/esprima/es2015-object-initialiser/invalid-proto-literals/options.json b/test/fixtures/esprima/es2015-object-initialiser/invalid-proto-literals/options.json new file mode 100644 index 0000000000..afd5a5116b --- /dev/null +++ b/test/fixtures/esprima/es2015-object-initialiser/invalid-proto-literals/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Redefinition of __proto__ property (1:22)" +} \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-object-initialiser/invalid-proto-setter-literal-identifier/actual.js b/test/fixtures/esprima/es2015-object-initialiser/invalid-proto-setter-literal-identifier/actual.js new file mode 100644 index 0000000000..0d07da8456 --- /dev/null +++ b/test/fixtures/esprima/es2015-object-initialiser/invalid-proto-setter-literal-identifier/actual.js @@ -0,0 +1 @@ +({ set __proto__(x){}, "__proto__": null, __proto__: null, }) diff --git a/test/fixtures/esprima/es2015-object-initialiser/invalid-proto-setter-literal-identifier/options.json b/test/fixtures/esprima/es2015-object-initialiser/invalid-proto-setter-literal-identifier/options.json new file mode 100644 index 0000000000..cf57a1fa83 --- /dev/null +++ b/test/fixtures/esprima/es2015-object-initialiser/invalid-proto-setter-literal-identifier/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Redefinition of __proto__ property (1:42)" +} \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-object-initialiser/invalid-proto-shorthand-identifier/actual.js b/test/fixtures/esprima/es2015-object-initialiser/invalid-proto-shorthand-identifier/actual.js new file mode 100644 index 0000000000..9cf6d27e79 --- /dev/null +++ b/test/fixtures/esprima/es2015-object-initialiser/invalid-proto-shorthand-identifier/actual.js @@ -0,0 +1 @@ +({ __proto__, __proto__: null }) diff --git a/test/fixtures/esprima/es2015-object-initialiser/invalid-proto-shorthand-identifier/expected.json b/test/fixtures/esprima/es2015-object-initialiser/invalid-proto-shorthand-identifier/expected.json new file mode 100644 index 0000000000..3f3242833e --- /dev/null +++ b/test/fixtures/esprima/es2015-object-initialiser/invalid-proto-shorthand-identifier/expected.json @@ -0,0 +1,170 @@ +{ + "type": "File", + "start": 0, + "end": 32, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 32 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 32, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 32 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 32, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 32 + } + }, + "expression": { + "type": "ObjectExpression", + "start": 1, + "end": 31, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 31 + } + }, + "properties": [ + { + "type": "Property", + "start": 3, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 3 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "method": false, + "shorthand": true, + "computed": false, + "key": { + "type": "Identifier", + "start": 3, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 3 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "name": "__proto__" + }, + "kind": "init", + "value": { + "type": "Identifier", + "start": 3, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 3 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "name": "__proto__" + } + }, + { + "type": "Property", + "start": 14, + "end": 29, + "loc": { + "start": { + "line": 1, + "column": 14 + }, + "end": { + "line": 1, + "column": 29 + } + }, + "method": false, + "shorthand": false, + "computed": false, + "key": { + "type": "Identifier", + "start": 14, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 14 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "name": "__proto__" + }, + "value": { + "type": "Literal", + "start": 25, + "end": 29, + "loc": { + "start": { + "line": 1, + "column": 25 + }, + "end": { + "line": 1, + "column": 29 + } + }, + "value": null, + "rawValue": null, + "raw": "null" + }, + "kind": "init" + } + ], + "parenthesizedExpression": true + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-object-initialiser/invalid-proto-shorthand-identifier/options.json b/test/fixtures/esprima/es2015-object-initialiser/invalid-proto-shorthand-identifier/options.json new file mode 100644 index 0000000000..0c5f4deed6 --- /dev/null +++ b/test/fixtures/esprima/es2015-object-initialiser/invalid-proto-shorthand-identifier/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Unexpected token (1:24)" +} \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-object-initialiser/invalid-proto-shorthand-literal/actual.js b/test/fixtures/esprima/es2015-object-initialiser/invalid-proto-shorthand-literal/actual.js new file mode 100644 index 0000000000..898082ce49 --- /dev/null +++ b/test/fixtures/esprima/es2015-object-initialiser/invalid-proto-shorthand-literal/actual.js @@ -0,0 +1 @@ +({ __proto__, "__proto__": null }) diff --git a/test/fixtures/esprima/es2015-object-initialiser/invalid-proto-shorthand-literal/expected.json b/test/fixtures/esprima/es2015-object-initialiser/invalid-proto-shorthand-literal/expected.json new file mode 100644 index 0000000000..c09f7f715b --- /dev/null +++ b/test/fixtures/esprima/es2015-object-initialiser/invalid-proto-shorthand-literal/expected.json @@ -0,0 +1,172 @@ +{ + "type": "File", + "start": 0, + "end": 34, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 34 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 34, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 34 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 34, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 34 + } + }, + "expression": { + "type": "ObjectExpression", + "start": 1, + "end": 33, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 33 + } + }, + "properties": [ + { + "type": "Property", + "start": 3, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 3 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "method": false, + "shorthand": true, + "computed": false, + "key": { + "type": "Identifier", + "start": 3, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 3 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "name": "__proto__" + }, + "kind": "init", + "value": { + "type": "Identifier", + "start": 3, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 3 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "name": "__proto__" + } + }, + { + "type": "Property", + "start": 14, + "end": 31, + "loc": { + "start": { + "line": 1, + "column": 14 + }, + "end": { + "line": 1, + "column": 31 + } + }, + "method": false, + "shorthand": false, + "computed": false, + "key": { + "type": "Literal", + "start": 14, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 14 + }, + "end": { + "line": 1, + "column": 25 + } + }, + "value": "__proto__", + "rawValue": "__proto__", + "raw": "\"__proto__\"" + }, + "value": { + "type": "Literal", + "start": 27, + "end": 31, + "loc": { + "start": { + "line": 1, + "column": 27 + }, + "end": { + "line": 1, + "column": 31 + } + }, + "value": null, + "rawValue": null, + "raw": "null" + }, + "kind": "init" + } + ], + "parenthesizedExpression": true + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-object-initialiser/invalid-proto-shorthand-literal/options.json b/test/fixtures/esprima/es2015-object-initialiser/invalid-proto-shorthand-literal/options.json new file mode 100644 index 0000000000..00b62a33f8 --- /dev/null +++ b/test/fixtures/esprima/es2015-object-initialiser/invalid-proto-shorthand-literal/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Unexpected token (1:26)" +} \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-object-initialiser/invalid-proto-shorthands/actual.js b/test/fixtures/esprima/es2015-object-initialiser/invalid-proto-shorthands/actual.js new file mode 100644 index 0000000000..785615c976 --- /dev/null +++ b/test/fixtures/esprima/es2015-object-initialiser/invalid-proto-shorthands/actual.js @@ -0,0 +1 @@ +({ __proto__, __proto__ }) diff --git a/test/fixtures/esprima/es2015-object-initialiser/invalid-proto-shorthands/expected.json b/test/fixtures/esprima/es2015-object-initialiser/invalid-proto-shorthands/expected.json new file mode 100644 index 0000000000..3de2340596 --- /dev/null +++ b/test/fixtures/esprima/es2015-object-initialiser/invalid-proto-shorthands/expected.json @@ -0,0 +1,168 @@ +{ + "type": "File", + "start": 0, + "end": 26, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 26 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 26, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 26 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 26, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 26 + } + }, + "expression": { + "type": "ObjectExpression", + "start": 1, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 25 + } + }, + "properties": [ + { + "type": "Property", + "start": 3, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 3 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "method": false, + "shorthand": true, + "computed": false, + "key": { + "type": "Identifier", + "start": 3, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 3 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "name": "__proto__" + }, + "kind": "init", + "value": { + "type": "Identifier", + "start": 3, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 3 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "name": "__proto__" + } + }, + { + "type": "Property", + "start": 14, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 14 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "method": false, + "shorthand": true, + "computed": false, + "key": { + "type": "Identifier", + "start": 14, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 14 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "name": "__proto__" + }, + "kind": "init", + "value": { + "type": "Identifier", + "start": 14, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 14 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "name": "__proto__" + } + } + ], + "parenthesizedExpression": true + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-object-initialiser/invalid-proto-shorthands/options.json b/test/fixtures/esprima/es2015-object-initialiser/invalid-proto-shorthands/options.json new file mode 100644 index 0000000000..0c5f4deed6 --- /dev/null +++ b/test/fixtures/esprima/es2015-object-initialiser/invalid-proto-shorthands/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Unexpected token (1:24)" +} \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-object-initialiser/proto-identifier-getter-setter/actual.js b/test/fixtures/esprima/es2015-object-initialiser/proto-identifier-getter-setter/actual.js new file mode 100644 index 0000000000..a3741bf749 --- /dev/null +++ b/test/fixtures/esprima/es2015-object-initialiser/proto-identifier-getter-setter/actual.js @@ -0,0 +1 @@ +({ __proto__: null, get __proto__(){}, set __proto__(x){} }) diff --git a/test/fixtures/esprima/es2015-object-initialiser/proto-identifier-getter-setter/expected.json b/test/fixtures/esprima/es2015-object-initialiser/proto-identifier-getter-setter/expected.json new file mode 100644 index 0000000000..226684195f --- /dev/null +++ b/test/fixtures/esprima/es2015-object-initialiser/proto-identifier-getter-setter/expected.json @@ -0,0 +1,276 @@ +{ + "type": "File", + "start": 0, + "end": 60, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 60 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 60, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 60 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 60, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 60 + } + }, + "expression": { + "type": "ObjectExpression", + "start": 1, + "end": 59, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 59 + } + }, + "properties": [ + { + "type": "Property", + "start": 3, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 3 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "method": false, + "shorthand": false, + "computed": false, + "key": { + "type": "Identifier", + "start": 3, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 3 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "name": "__proto__" + }, + "value": { + "type": "Literal", + "start": 14, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 14 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "value": null, + "rawValue": null, + "raw": "null" + }, + "kind": "init" + }, + { + "type": "Property", + "start": 20, + "end": 37, + "loc": { + "start": { + "line": 1, + "column": 20 + }, + "end": { + "line": 1, + "column": 37 + } + }, + "method": false, + "shorthand": false, + "computed": false, + "key": { + "type": "Identifier", + "start": 24, + "end": 33, + "loc": { + "start": { + "line": 1, + "column": 24 + }, + "end": { + "line": 1, + "column": 33 + } + }, + "name": "__proto__" + }, + "kind": "get", + "value": { + "type": "FunctionExpression", + "start": 33, + "end": 37, + "loc": { + "start": { + "line": 1, + "column": 33 + }, + "end": { + "line": 1, + "column": 37 + } + }, + "id": null, + "generator": false, + "expression": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 35, + "end": 37, + "loc": { + "start": { + "line": 1, + "column": 35 + }, + "end": { + "line": 1, + "column": 37 + } + }, + "body": [] + } + } + }, + { + "type": "Property", + "start": 39, + "end": 57, + "loc": { + "start": { + "line": 1, + "column": 39 + }, + "end": { + "line": 1, + "column": 57 + } + }, + "method": false, + "shorthand": false, + "computed": false, + "key": { + "type": "Identifier", + "start": 43, + "end": 52, + "loc": { + "start": { + "line": 1, + "column": 43 + }, + "end": { + "line": 1, + "column": 52 + } + }, + "name": "__proto__" + }, + "kind": "set", + "value": { + "type": "FunctionExpression", + "start": 52, + "end": 57, + "loc": { + "start": { + "line": 1, + "column": 52 + }, + "end": { + "line": 1, + "column": 57 + } + }, + "id": null, + "generator": false, + "expression": false, + "params": [ + { + "type": "Identifier", + "start": 53, + "end": 54, + "loc": { + "start": { + "line": 1, + "column": 53 + }, + "end": { + "line": 1, + "column": 54 + } + }, + "name": "x" + } + ], + "body": { + "type": "BlockStatement", + "start": 55, + "end": 57, + "loc": { + "start": { + "line": 1, + "column": 55 + }, + "end": { + "line": 1, + "column": 57 + } + }, + "body": [] + } + } + } + ], + "parenthesizedExpression": true + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-object-initialiser/proto-identifier-getter/actual.js b/test/fixtures/esprima/es2015-object-initialiser/proto-identifier-getter/actual.js new file mode 100644 index 0000000000..b98cb5a0c5 --- /dev/null +++ b/test/fixtures/esprima/es2015-object-initialiser/proto-identifier-getter/actual.js @@ -0,0 +1 @@ +({ __proto__: null, get __proto__(){} }) diff --git a/test/fixtures/esprima/es2015-object-initialiser/proto-identifier-getter/expected.json b/test/fixtures/esprima/es2015-object-initialiser/proto-identifier-getter/expected.json new file mode 100644 index 0000000000..799d51e116 --- /dev/null +++ b/test/fixtures/esprima/es2015-object-initialiser/proto-identifier-getter/expected.json @@ -0,0 +1,189 @@ +{ + "type": "File", + "start": 0, + "end": 40, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 40 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 40, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 40 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 40, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 40 + } + }, + "expression": { + "type": "ObjectExpression", + "start": 1, + "end": 39, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 39 + } + }, + "properties": [ + { + "type": "Property", + "start": 3, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 3 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "method": false, + "shorthand": false, + "computed": false, + "key": { + "type": "Identifier", + "start": 3, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 3 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "name": "__proto__" + }, + "value": { + "type": "Literal", + "start": 14, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 14 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "value": null, + "rawValue": null, + "raw": "null" + }, + "kind": "init" + }, + { + "type": "Property", + "start": 20, + "end": 37, + "loc": { + "start": { + "line": 1, + "column": 20 + }, + "end": { + "line": 1, + "column": 37 + } + }, + "method": false, + "shorthand": false, + "computed": false, + "key": { + "type": "Identifier", + "start": 24, + "end": 33, + "loc": { + "start": { + "line": 1, + "column": 24 + }, + "end": { + "line": 1, + "column": 33 + } + }, + "name": "__proto__" + }, + "kind": "get", + "value": { + "type": "FunctionExpression", + "start": 33, + "end": 37, + "loc": { + "start": { + "line": 1, + "column": 33 + }, + "end": { + "line": 1, + "column": 37 + } + }, + "id": null, + "generator": false, + "expression": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 35, + "end": 37, + "loc": { + "start": { + "line": 1, + "column": 35 + }, + "end": { + "line": 1, + "column": 37 + } + }, + "body": [] + } + } + } + ], + "parenthesizedExpression": true + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-object-initialiser/proto-identifier-method/actual.js b/test/fixtures/esprima/es2015-object-initialiser/proto-identifier-method/actual.js new file mode 100644 index 0000000000..b886d6e186 --- /dev/null +++ b/test/fixtures/esprima/es2015-object-initialiser/proto-identifier-method/actual.js @@ -0,0 +1 @@ +({ __proto__: null, __proto__(){}, }) diff --git a/test/fixtures/esprima/es2015-object-initialiser/proto-identifier-method/expected.json b/test/fixtures/esprima/es2015-object-initialiser/proto-identifier-method/expected.json new file mode 100644 index 0000000000..12192e3584 --- /dev/null +++ b/test/fixtures/esprima/es2015-object-initialiser/proto-identifier-method/expected.json @@ -0,0 +1,189 @@ +{ + "type": "File", + "start": 0, + "end": 37, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 37 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 37, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 37 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 37, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 37 + } + }, + "expression": { + "type": "ObjectExpression", + "start": 1, + "end": 36, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 36 + } + }, + "properties": [ + { + "type": "Property", + "start": 3, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 3 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "method": false, + "shorthand": false, + "computed": false, + "key": { + "type": "Identifier", + "start": 3, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 3 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "name": "__proto__" + }, + "value": { + "type": "Literal", + "start": 14, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 14 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "value": null, + "rawValue": null, + "raw": "null" + }, + "kind": "init" + }, + { + "type": "Property", + "start": 20, + "end": 33, + "loc": { + "start": { + "line": 1, + "column": 20 + }, + "end": { + "line": 1, + "column": 33 + } + }, + "method": true, + "shorthand": false, + "computed": false, + "key": { + "type": "Identifier", + "start": 20, + "end": 29, + "loc": { + "start": { + "line": 1, + "column": 20 + }, + "end": { + "line": 1, + "column": 29 + } + }, + "name": "__proto__" + }, + "kind": "init", + "value": { + "type": "FunctionExpression", + "start": 29, + "end": 33, + "loc": { + "start": { + "line": 1, + "column": 29 + }, + "end": { + "line": 1, + "column": 33 + } + }, + "id": null, + "generator": false, + "expression": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 31, + "end": 33, + "loc": { + "start": { + "line": 1, + "column": 31 + }, + "end": { + "line": 1, + "column": 33 + } + }, + "body": [] + } + } + } + ], + "parenthesizedExpression": true + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-object-initialiser/proto-identifier-setter/actual.js b/test/fixtures/esprima/es2015-object-initialiser/proto-identifier-setter/actual.js new file mode 100644 index 0000000000..433662021a --- /dev/null +++ b/test/fixtures/esprima/es2015-object-initialiser/proto-identifier-setter/actual.js @@ -0,0 +1 @@ +({ __proto__: null, set __proto__(x){} }) diff --git a/test/fixtures/esprima/es2015-object-initialiser/proto-identifier-setter/expected.json b/test/fixtures/esprima/es2015-object-initialiser/proto-identifier-setter/expected.json new file mode 100644 index 0000000000..b85b34999c --- /dev/null +++ b/test/fixtures/esprima/es2015-object-initialiser/proto-identifier-setter/expected.json @@ -0,0 +1,206 @@ +{ + "type": "File", + "start": 0, + "end": 41, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 41 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 41, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 41 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 41, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 41 + } + }, + "expression": { + "type": "ObjectExpression", + "start": 1, + "end": 40, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 40 + } + }, + "properties": [ + { + "type": "Property", + "start": 3, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 3 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "method": false, + "shorthand": false, + "computed": false, + "key": { + "type": "Identifier", + "start": 3, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 3 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "name": "__proto__" + }, + "value": { + "type": "Literal", + "start": 14, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 14 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "value": null, + "rawValue": null, + "raw": "null" + }, + "kind": "init" + }, + { + "type": "Property", + "start": 20, + "end": 38, + "loc": { + "start": { + "line": 1, + "column": 20 + }, + "end": { + "line": 1, + "column": 38 + } + }, + "method": false, + "shorthand": false, + "computed": false, + "key": { + "type": "Identifier", + "start": 24, + "end": 33, + "loc": { + "start": { + "line": 1, + "column": 24 + }, + "end": { + "line": 1, + "column": 33 + } + }, + "name": "__proto__" + }, + "kind": "set", + "value": { + "type": "FunctionExpression", + "start": 33, + "end": 38, + "loc": { + "start": { + "line": 1, + "column": 33 + }, + "end": { + "line": 1, + "column": 38 + } + }, + "id": null, + "generator": false, + "expression": false, + "params": [ + { + "type": "Identifier", + "start": 34, + "end": 35, + "loc": { + "start": { + "line": 1, + "column": 34 + }, + "end": { + "line": 1, + "column": 35 + } + }, + "name": "x" + } + ], + "body": { + "type": "BlockStatement", + "start": 36, + "end": 38, + "loc": { + "start": { + "line": 1, + "column": 36 + }, + "end": { + "line": 1, + "column": 38 + } + }, + "body": [] + } + } + } + ], + "parenthesizedExpression": true + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-object-initialiser/proto-literal-getter-setter/actual.js b/test/fixtures/esprima/es2015-object-initialiser/proto-literal-getter-setter/actual.js new file mode 100644 index 0000000000..08c6ed23ae --- /dev/null +++ b/test/fixtures/esprima/es2015-object-initialiser/proto-literal-getter-setter/actual.js @@ -0,0 +1 @@ +({ "__proto__": null, get __proto__(){}, set __proto__(x){} }) diff --git a/test/fixtures/esprima/es2015-object-initialiser/proto-literal-getter-setter/expected.json b/test/fixtures/esprima/es2015-object-initialiser/proto-literal-getter-setter/expected.json new file mode 100644 index 0000000000..fb52590573 --- /dev/null +++ b/test/fixtures/esprima/es2015-object-initialiser/proto-literal-getter-setter/expected.json @@ -0,0 +1,278 @@ +{ + "type": "File", + "start": 0, + "end": 62, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 62 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 62, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 62 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 62, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 62 + } + }, + "expression": { + "type": "ObjectExpression", + "start": 1, + "end": 61, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 61 + } + }, + "properties": [ + { + "type": "Property", + "start": 3, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 3 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "method": false, + "shorthand": false, + "computed": false, + "key": { + "type": "Literal", + "start": 3, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 3 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "value": "__proto__", + "rawValue": "__proto__", + "raw": "\"__proto__\"" + }, + "value": { + "type": "Literal", + "start": 16, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 16 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "value": null, + "rawValue": null, + "raw": "null" + }, + "kind": "init" + }, + { + "type": "Property", + "start": 22, + "end": 39, + "loc": { + "start": { + "line": 1, + "column": 22 + }, + "end": { + "line": 1, + "column": 39 + } + }, + "method": false, + "shorthand": false, + "computed": false, + "key": { + "type": "Identifier", + "start": 26, + "end": 35, + "loc": { + "start": { + "line": 1, + "column": 26 + }, + "end": { + "line": 1, + "column": 35 + } + }, + "name": "__proto__" + }, + "kind": "get", + "value": { + "type": "FunctionExpression", + "start": 35, + "end": 39, + "loc": { + "start": { + "line": 1, + "column": 35 + }, + "end": { + "line": 1, + "column": 39 + } + }, + "id": null, + "generator": false, + "expression": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 37, + "end": 39, + "loc": { + "start": { + "line": 1, + "column": 37 + }, + "end": { + "line": 1, + "column": 39 + } + }, + "body": [] + } + } + }, + { + "type": "Property", + "start": 41, + "end": 59, + "loc": { + "start": { + "line": 1, + "column": 41 + }, + "end": { + "line": 1, + "column": 59 + } + }, + "method": false, + "shorthand": false, + "computed": false, + "key": { + "type": "Identifier", + "start": 45, + "end": 54, + "loc": { + "start": { + "line": 1, + "column": 45 + }, + "end": { + "line": 1, + "column": 54 + } + }, + "name": "__proto__" + }, + "kind": "set", + "value": { + "type": "FunctionExpression", + "start": 54, + "end": 59, + "loc": { + "start": { + "line": 1, + "column": 54 + }, + "end": { + "line": 1, + "column": 59 + } + }, + "id": null, + "generator": false, + "expression": false, + "params": [ + { + "type": "Identifier", + "start": 55, + "end": 56, + "loc": { + "start": { + "line": 1, + "column": 55 + }, + "end": { + "line": 1, + "column": 56 + } + }, + "name": "x" + } + ], + "body": { + "type": "BlockStatement", + "start": 57, + "end": 59, + "loc": { + "start": { + "line": 1, + "column": 57 + }, + "end": { + "line": 1, + "column": 59 + } + }, + "body": [] + } + } + } + ], + "parenthesizedExpression": true + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-object-initialiser/proto-literal-getter/actual.js b/test/fixtures/esprima/es2015-object-initialiser/proto-literal-getter/actual.js new file mode 100644 index 0000000000..b0496bde96 --- /dev/null +++ b/test/fixtures/esprima/es2015-object-initialiser/proto-literal-getter/actual.js @@ -0,0 +1 @@ +({ "__proto__": null, get __proto__(){} }) diff --git a/test/fixtures/esprima/es2015-object-initialiser/proto-literal-getter/expected.json b/test/fixtures/esprima/es2015-object-initialiser/proto-literal-getter/expected.json new file mode 100644 index 0000000000..981e9ca6a1 --- /dev/null +++ b/test/fixtures/esprima/es2015-object-initialiser/proto-literal-getter/expected.json @@ -0,0 +1,191 @@ +{ + "type": "File", + "start": 0, + "end": 42, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 42 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 42, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 42 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 42, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 42 + } + }, + "expression": { + "type": "ObjectExpression", + "start": 1, + "end": 41, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 41 + } + }, + "properties": [ + { + "type": "Property", + "start": 3, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 3 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "method": false, + "shorthand": false, + "computed": false, + "key": { + "type": "Literal", + "start": 3, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 3 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "value": "__proto__", + "rawValue": "__proto__", + "raw": "\"__proto__\"" + }, + "value": { + "type": "Literal", + "start": 16, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 16 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "value": null, + "rawValue": null, + "raw": "null" + }, + "kind": "init" + }, + { + "type": "Property", + "start": 22, + "end": 39, + "loc": { + "start": { + "line": 1, + "column": 22 + }, + "end": { + "line": 1, + "column": 39 + } + }, + "method": false, + "shorthand": false, + "computed": false, + "key": { + "type": "Identifier", + "start": 26, + "end": 35, + "loc": { + "start": { + "line": 1, + "column": 26 + }, + "end": { + "line": 1, + "column": 35 + } + }, + "name": "__proto__" + }, + "kind": "get", + "value": { + "type": "FunctionExpression", + "start": 35, + "end": 39, + "loc": { + "start": { + "line": 1, + "column": 35 + }, + "end": { + "line": 1, + "column": 39 + } + }, + "id": null, + "generator": false, + "expression": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 37, + "end": 39, + "loc": { + "start": { + "line": 1, + "column": 37 + }, + "end": { + "line": 1, + "column": 39 + } + }, + "body": [] + } + } + } + ], + "parenthesizedExpression": true + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-object-initialiser/proto-literal-method/actual.js b/test/fixtures/esprima/es2015-object-initialiser/proto-literal-method/actual.js new file mode 100644 index 0000000000..9aaf992935 --- /dev/null +++ b/test/fixtures/esprima/es2015-object-initialiser/proto-literal-method/actual.js @@ -0,0 +1 @@ +({ "__proto__": null, __proto__(){}, }) diff --git a/test/fixtures/esprima/es2015-object-initialiser/proto-literal-method/expected.json b/test/fixtures/esprima/es2015-object-initialiser/proto-literal-method/expected.json new file mode 100644 index 0000000000..aaff700170 --- /dev/null +++ b/test/fixtures/esprima/es2015-object-initialiser/proto-literal-method/expected.json @@ -0,0 +1,191 @@ +{ + "type": "File", + "start": 0, + "end": 39, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 39 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 39, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 39 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 39, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 39 + } + }, + "expression": { + "type": "ObjectExpression", + "start": 1, + "end": 38, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 38 + } + }, + "properties": [ + { + "type": "Property", + "start": 3, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 3 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "method": false, + "shorthand": false, + "computed": false, + "key": { + "type": "Literal", + "start": 3, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 3 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "value": "__proto__", + "rawValue": "__proto__", + "raw": "\"__proto__\"" + }, + "value": { + "type": "Literal", + "start": 16, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 16 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "value": null, + "rawValue": null, + "raw": "null" + }, + "kind": "init" + }, + { + "type": "Property", + "start": 22, + "end": 35, + "loc": { + "start": { + "line": 1, + "column": 22 + }, + "end": { + "line": 1, + "column": 35 + } + }, + "method": true, + "shorthand": false, + "computed": false, + "key": { + "type": "Identifier", + "start": 22, + "end": 31, + "loc": { + "start": { + "line": 1, + "column": 22 + }, + "end": { + "line": 1, + "column": 31 + } + }, + "name": "__proto__" + }, + "kind": "init", + "value": { + "type": "FunctionExpression", + "start": 31, + "end": 35, + "loc": { + "start": { + "line": 1, + "column": 31 + }, + "end": { + "line": 1, + "column": 35 + } + }, + "id": null, + "generator": false, + "expression": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 33, + "end": 35, + "loc": { + "start": { + "line": 1, + "column": 33 + }, + "end": { + "line": 1, + "column": 35 + } + }, + "body": [] + } + } + } + ], + "parenthesizedExpression": true + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-object-initialiser/proto-literal-setter/actual.js b/test/fixtures/esprima/es2015-object-initialiser/proto-literal-setter/actual.js new file mode 100644 index 0000000000..4481cb5890 --- /dev/null +++ b/test/fixtures/esprima/es2015-object-initialiser/proto-literal-setter/actual.js @@ -0,0 +1 @@ +({ "__proto__": null, set __proto__(x){} }) diff --git a/test/fixtures/esprima/es2015-object-initialiser/proto-literal-setter/expected.json b/test/fixtures/esprima/es2015-object-initialiser/proto-literal-setter/expected.json new file mode 100644 index 0000000000..92e920ccdd --- /dev/null +++ b/test/fixtures/esprima/es2015-object-initialiser/proto-literal-setter/expected.json @@ -0,0 +1,208 @@ +{ + "type": "File", + "start": 0, + "end": 43, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 43 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 43, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 43 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 43, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 43 + } + }, + "expression": { + "type": "ObjectExpression", + "start": 1, + "end": 42, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 42 + } + }, + "properties": [ + { + "type": "Property", + "start": 3, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 3 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "method": false, + "shorthand": false, + "computed": false, + "key": { + "type": "Literal", + "start": 3, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 3 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "value": "__proto__", + "rawValue": "__proto__", + "raw": "\"__proto__\"" + }, + "value": { + "type": "Literal", + "start": 16, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 16 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "value": null, + "rawValue": null, + "raw": "null" + }, + "kind": "init" + }, + { + "type": "Property", + "start": 22, + "end": 40, + "loc": { + "start": { + "line": 1, + "column": 22 + }, + "end": { + "line": 1, + "column": 40 + } + }, + "method": false, + "shorthand": false, + "computed": false, + "key": { + "type": "Identifier", + "start": 26, + "end": 35, + "loc": { + "start": { + "line": 1, + "column": 26 + }, + "end": { + "line": 1, + "column": 35 + } + }, + "name": "__proto__" + }, + "kind": "set", + "value": { + "type": "FunctionExpression", + "start": 35, + "end": 40, + "loc": { + "start": { + "line": 1, + "column": 35 + }, + "end": { + "line": 1, + "column": 40 + } + }, + "id": null, + "generator": false, + "expression": false, + "params": [ + { + "type": "Identifier", + "start": 36, + "end": 37, + "loc": { + "start": { + "line": 1, + "column": 36 + }, + "end": { + "line": 1, + "column": 37 + } + }, + "name": "x" + } + ], + "body": { + "type": "BlockStatement", + "start": 38, + "end": 40, + "loc": { + "start": { + "line": 1, + "column": 38 + }, + "end": { + "line": 1, + "column": 40 + } + }, + "body": [] + } + } + } + ], + "parenthesizedExpression": true + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-object-literal-property-value-shorthand/migrated_0000/actual.js b/test/fixtures/esprima/es2015-object-literal-property-value-shorthand/migrated_0000/actual.js new file mode 100644 index 0000000000..02c62e5f34 --- /dev/null +++ b/test/fixtures/esprima/es2015-object-literal-property-value-shorthand/migrated_0000/actual.js @@ -0,0 +1 @@ +x = { y, z } diff --git a/test/fixtures/esprima/es2015-object-literal-property-value-shorthand/migrated_0000/expected.json b/test/fixtures/esprima/es2015-object-literal-property-value-shorthand/migrated_0000/expected.json new file mode 100644 index 0000000000..83f868da39 --- /dev/null +++ b/test/fixtures/esprima/es2015-object-literal-property-value-shorthand/migrated_0000/expected.json @@ -0,0 +1,199 @@ +{ + "type": "File", + "start": 0, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "expression": { + "type": "AssignmentExpression", + "start": 0, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "operator": "=", + "left": { + "type": "Identifier", + "start": 0, + "end": 1, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + } + }, + "name": "x" + }, + "right": { + "type": "ObjectExpression", + "start": 4, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "properties": [ + { + "type": "Property", + "start": 6, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "method": false, + "shorthand": true, + "computed": false, + "key": { + "type": "Identifier", + "start": 6, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "name": "y" + }, + "kind": "init", + "value": { + "type": "Identifier", + "start": 6, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "name": "y" + } + }, + { + "type": "Property", + "start": 9, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "method": false, + "shorthand": true, + "computed": false, + "key": { + "type": "Identifier", + "start": 9, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "name": "z" + }, + "kind": "init", + "value": { + "type": "Identifier", + "start": 9, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "name": "z" + } + } + ] + } + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-object-pattern/elision/actual.js b/test/fixtures/esprima/es2015-object-pattern/elision/actual.js new file mode 100644 index 0000000000..458d6387cc --- /dev/null +++ b/test/fixtures/esprima/es2015-object-pattern/elision/actual.js @@ -0,0 +1 @@ +let {a,} = 0 diff --git a/test/fixtures/esprima/es2015-object-pattern/elision/expected.json b/test/fixtures/esprima/es2015-object-pattern/elision/expected.json new file mode 100644 index 0000000000..7b239f85db --- /dev/null +++ b/test/fixtures/esprima/es2015-object-pattern/elision/expected.json @@ -0,0 +1,152 @@ +{ + "type": "File", + "start": 0, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "sourceType": "script", + "body": [ + { + "type": "VariableDeclaration", + "start": 0, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 4, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "id": { + "type": "ObjectPattern", + "start": 4, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "properties": [ + { + "type": "Property", + "start": 5, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "method": false, + "shorthand": true, + "computed": false, + "key": { + "type": "Identifier", + "start": 5, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "name": "a" + }, + "kind": "init", + "value": { + "type": "Identifier", + "start": 5, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "name": "a" + } + } + ] + }, + "init": { + "type": "Literal", + "start": 11, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 11 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "value": 0, + "rawValue": 0, + "raw": "0" + } + } + ], + "kind": "let" + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-object-pattern/empty-catch-param/actual.js b/test/fixtures/esprima/es2015-object-pattern/empty-catch-param/actual.js new file mode 100644 index 0000000000..14d2f32e56 --- /dev/null +++ b/test/fixtures/esprima/es2015-object-pattern/empty-catch-param/actual.js @@ -0,0 +1 @@ +try { } catch ({}) {} diff --git a/test/fixtures/esprima/es2015-object-pattern/empty-catch-param/expected.json b/test/fixtures/esprima/es2015-object-pattern/empty-catch-param/expected.json new file mode 100644 index 0000000000..360729bf4f --- /dev/null +++ b/test/fixtures/esprima/es2015-object-pattern/empty-catch-param/expected.json @@ -0,0 +1,113 @@ +{ + "type": "File", + "start": 0, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 21 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 21 + } + }, + "sourceType": "script", + "body": [ + { + "type": "TryStatement", + "start": 0, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 21 + } + }, + "block": { + "type": "BlockStatement", + "start": 4, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "body": [] + }, + "handler": { + "type": "CatchClause", + "start": 8, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 21 + } + }, + "param": { + "type": "ObjectPattern", + "start": 15, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "properties": [] + }, + "body": { + "type": "BlockStatement", + "start": 19, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 19 + }, + "end": { + "line": 1, + "column": 21 + } + }, + "body": [] + } + }, + "guardedHandlers": [], + "finalizer": null + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-object-pattern/empty-fn/actual.js b/test/fixtures/esprima/es2015-object-pattern/empty-fn/actual.js new file mode 100644 index 0000000000..5b576774b5 --- /dev/null +++ b/test/fixtures/esprima/es2015-object-pattern/empty-fn/actual.js @@ -0,0 +1 @@ +function a({}) {} diff --git a/test/fixtures/esprima/es2015-object-pattern/empty-fn/expected.json b/test/fixtures/esprima/es2015-object-pattern/empty-fn/expected.json new file mode 100644 index 0000000000..fc8aa6cdb9 --- /dev/null +++ b/test/fixtures/esprima/es2015-object-pattern/empty-fn/expected.json @@ -0,0 +1,100 @@ +{ + "type": "File", + "start": 0, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "sourceType": "script", + "body": [ + { + "type": "FunctionDeclaration", + "start": 0, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "id": { + "type": "Identifier", + "start": 9, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "name": "a" + }, + "generator": false, + "expression": false, + "params": [ + { + "type": "ObjectPattern", + "start": 11, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 11 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "properties": [] + } + ], + "body": { + "type": "BlockStatement", + "start": 15, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "body": [] + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-object-pattern/empty-for-lex/actual.js b/test/fixtures/esprima/es2015-object-pattern/empty-for-lex/actual.js new file mode 100644 index 0000000000..23033126a8 --- /dev/null +++ b/test/fixtures/esprima/es2015-object-pattern/empty-for-lex/actual.js @@ -0,0 +1 @@ +for (let {} in 0); diff --git a/test/fixtures/esprima/es2015-object-pattern/empty-for-lex/expected.json b/test/fixtures/esprima/es2015-object-pattern/empty-for-lex/expected.json new file mode 100644 index 0000000000..d3ba43788a --- /dev/null +++ b/test/fixtures/esprima/es2015-object-pattern/empty-for-lex/expected.json @@ -0,0 +1,131 @@ +{ + "type": "File", + "start": 0, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ForInStatement", + "start": 0, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "left": { + "type": "VariableDeclaration", + "start": 5, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 9, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "id": { + "type": "ObjectPattern", + "start": 9, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "properties": [] + }, + "init": null + } + ], + "kind": "let" + }, + "right": { + "type": "Literal", + "start": 15, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "value": 0, + "rawValue": 0, + "raw": "0" + }, + "body": { + "type": "EmptyStatement", + "start": 17, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 17 + }, + "end": { + "line": 1, + "column": 18 + } + } + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-object-pattern/empty-lexical/actual.js b/test/fixtures/esprima/es2015-object-pattern/empty-lexical/actual.js new file mode 100644 index 0000000000..fe8923efef --- /dev/null +++ b/test/fixtures/esprima/es2015-object-pattern/empty-lexical/actual.js @@ -0,0 +1 @@ +let {} = 0 diff --git a/test/fixtures/esprima/es2015-object-pattern/empty-lexical/expected.json b/test/fixtures/esprima/es2015-object-pattern/empty-lexical/expected.json new file mode 100644 index 0000000000..dbbd5e0895 --- /dev/null +++ b/test/fixtures/esprima/es2015-object-pattern/empty-lexical/expected.json @@ -0,0 +1,100 @@ +{ + "type": "File", + "start": 0, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "sourceType": "script", + "body": [ + { + "type": "VariableDeclaration", + "start": 0, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 4, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "id": { + "type": "ObjectPattern", + "start": 4, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "properties": [] + }, + "init": { + "type": "Literal", + "start": 9, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "value": 0, + "rawValue": 0, + "raw": "0" + } + } + ], + "kind": "let" + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-object-pattern/empty-var/actual.js b/test/fixtures/esprima/es2015-object-pattern/empty-var/actual.js new file mode 100644 index 0000000000..8e5b5da7ca --- /dev/null +++ b/test/fixtures/esprima/es2015-object-pattern/empty-var/actual.js @@ -0,0 +1 @@ +var {} = 0 diff --git a/test/fixtures/esprima/es2015-object-pattern/empty-var/expected.json b/test/fixtures/esprima/es2015-object-pattern/empty-var/expected.json new file mode 100644 index 0000000000..24ff27c2f1 --- /dev/null +++ b/test/fixtures/esprima/es2015-object-pattern/empty-var/expected.json @@ -0,0 +1,100 @@ +{ + "type": "File", + "start": 0, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "sourceType": "script", + "body": [ + { + "type": "VariableDeclaration", + "start": 0, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 4, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "id": { + "type": "ObjectPattern", + "start": 4, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "properties": [] + }, + "init": { + "type": "Literal", + "start": 9, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "value": 0, + "rawValue": 0, + "raw": "0" + } + } + ], + "kind": "var" + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-object-pattern/nested/actual.js b/test/fixtures/esprima/es2015-object-pattern/nested/actual.js new file mode 100644 index 0000000000..82d997cb9b --- /dev/null +++ b/test/fixtures/esprima/es2015-object-pattern/nested/actual.js @@ -0,0 +1 @@ +let {a:{}} = 0 diff --git a/test/fixtures/esprima/es2015-object-pattern/nested/expected.json b/test/fixtures/esprima/es2015-object-pattern/nested/expected.json new file mode 100644 index 0000000000..1e70efa276 --- /dev/null +++ b/test/fixtures/esprima/es2015-object-pattern/nested/expected.json @@ -0,0 +1,152 @@ +{ + "type": "File", + "start": 0, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "sourceType": "script", + "body": [ + { + "type": "VariableDeclaration", + "start": 0, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 4, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "id": { + "type": "ObjectPattern", + "start": 4, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "properties": [ + { + "type": "Property", + "start": 5, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "method": false, + "shorthand": false, + "computed": false, + "key": { + "type": "Identifier", + "start": 5, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "name": "a" + }, + "value": { + "type": "ObjectPattern", + "start": 7, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "properties": [] + }, + "kind": "init" + } + ] + }, + "init": { + "type": "Literal", + "start": 13, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "value": 0, + "rawValue": 0, + "raw": "0" + } + } + ], + "kind": "let" + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-object-pattern/properties/actual.js b/test/fixtures/esprima/es2015-object-pattern/properties/actual.js new file mode 100644 index 0000000000..37e1fb1514 --- /dev/null +++ b/test/fixtures/esprima/es2015-object-pattern/properties/actual.js @@ -0,0 +1 @@ +let {a,b=0,c:d,e:f=0,[g]:[h]}=0 diff --git a/test/fixtures/esprima/es2015-object-pattern/properties/expected.json b/test/fixtures/esprima/es2015-object-pattern/properties/expected.json new file mode 100644 index 0000000000..3540998633 --- /dev/null +++ b/test/fixtures/esprima/es2015-object-pattern/properties/expected.json @@ -0,0 +1,439 @@ +{ + "type": "File", + "start": 0, + "end": 31, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 31 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 31, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 31 + } + }, + "sourceType": "script", + "body": [ + { + "type": "VariableDeclaration", + "start": 0, + "end": 31, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 31 + } + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 4, + "end": 31, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 31 + } + }, + "id": { + "type": "ObjectPattern", + "start": 4, + "end": 29, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 29 + } + }, + "properties": [ + { + "type": "Property", + "start": 5, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "method": false, + "shorthand": true, + "computed": false, + "key": { + "type": "Identifier", + "start": 5, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "name": "a" + }, + "kind": "init", + "value": { + "type": "Identifier", + "start": 5, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "name": "a" + } + }, + { + "type": "Property", + "start": 7, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "method": false, + "shorthand": true, + "computed": false, + "key": { + "type": "Identifier", + "start": 7, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "name": "b" + }, + "kind": "init", + "value": { + "type": "AssignmentPattern", + "start": 7, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "left": { + "type": "Identifier", + "start": 7, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "name": "b" + }, + "right": { + "type": "Literal", + "start": 9, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "value": 0, + "rawValue": 0, + "raw": "0" + } + } + }, + { + "type": "Property", + "start": 11, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 11 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "method": false, + "shorthand": false, + "computed": false, + "key": { + "type": "Identifier", + "start": 11, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 11 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "name": "c" + }, + "value": { + "type": "Identifier", + "start": 13, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "name": "d" + }, + "kind": "init" + }, + { + "type": "Property", + "start": 15, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "method": false, + "shorthand": false, + "computed": false, + "key": { + "type": "Identifier", + "start": 15, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "name": "e" + }, + "value": { + "type": "AssignmentPattern", + "start": 17, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 17 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "left": { + "type": "Identifier", + "start": 17, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 17 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "name": "f" + }, + "right": { + "type": "Literal", + "start": 19, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 19 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "value": 0, + "rawValue": 0, + "raw": "0" + } + }, + "kind": "init" + }, + { + "type": "Property", + "start": 21, + "end": 28, + "loc": { + "start": { + "line": 1, + "column": 21 + }, + "end": { + "line": 1, + "column": 28 + } + }, + "method": false, + "shorthand": false, + "computed": true, + "key": { + "type": "Identifier", + "start": 22, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 22 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "name": "g" + }, + "value": { + "type": "ArrayPattern", + "start": 25, + "end": 28, + "loc": { + "start": { + "line": 1, + "column": 25 + }, + "end": { + "line": 1, + "column": 28 + } + }, + "elements": [ + { + "type": "Identifier", + "start": 26, + "end": 27, + "loc": { + "start": { + "line": 1, + "column": 26 + }, + "end": { + "line": 1, + "column": 27 + } + }, + "name": "h" + } + ] + }, + "kind": "init" + } + ] + }, + "init": { + "type": "Literal", + "start": 30, + "end": 31, + "loc": { + "start": { + "line": 1, + "column": 30 + }, + "end": { + "line": 1, + "column": 31 + } + }, + "value": 0, + "rawValue": 0, + "raw": "0" + } + } + ], + "kind": "let" + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-octal-integer-literal/migrated_0000/actual.js b/test/fixtures/esprima/es2015-octal-integer-literal/migrated_0000/actual.js new file mode 100644 index 0000000000..4daddb72ff --- /dev/null +++ b/test/fixtures/esprima/es2015-octal-integer-literal/migrated_0000/actual.js @@ -0,0 +1 @@ +00 diff --git a/test/fixtures/esprima/es2015-octal-integer-literal/migrated_0000/expected.json b/test/fixtures/esprima/es2015-octal-integer-literal/migrated_0000/expected.json new file mode 100644 index 0000000000..7071e2971b --- /dev/null +++ b/test/fixtures/esprima/es2015-octal-integer-literal/migrated_0000/expected.json @@ -0,0 +1,66 @@ +{ + "type": "File", + "start": 0, + "end": 2, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 2 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 2, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 2 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 2, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 2 + } + }, + "expression": { + "type": "Literal", + "start": 0, + "end": 2, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 2 + } + }, + "value": 0, + "rawValue": 0, + "raw": "00" + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-octal-integer-literal/migrated_0001/actual.js b/test/fixtures/esprima/es2015-octal-integer-literal/migrated_0001/actual.js new file mode 100644 index 0000000000..8893f6d11d --- /dev/null +++ b/test/fixtures/esprima/es2015-octal-integer-literal/migrated_0001/actual.js @@ -0,0 +1 @@ +0o0 diff --git a/test/fixtures/esprima/es2015-octal-integer-literal/migrated_0001/expected.json b/test/fixtures/esprima/es2015-octal-integer-literal/migrated_0001/expected.json new file mode 100644 index 0000000000..198d34971a --- /dev/null +++ b/test/fixtures/esprima/es2015-octal-integer-literal/migrated_0001/expected.json @@ -0,0 +1,66 @@ +{ + "type": "File", + "start": 0, + "end": 3, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 3 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 3, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 3 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 3, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 3 + } + }, + "expression": { + "type": "Literal", + "start": 0, + "end": 3, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 3 + } + }, + "value": 0, + "rawValue": 0, + "raw": "0o0" + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-octal-integer-literal/migrated_0002/actual.js b/test/fixtures/esprima/es2015-octal-integer-literal/migrated_0002/actual.js new file mode 100644 index 0000000000..2efa481a33 --- /dev/null +++ b/test/fixtures/esprima/es2015-octal-integer-literal/migrated_0002/actual.js @@ -0,0 +1 @@ +function test() {'use strict'; 0o0; } diff --git a/test/fixtures/esprima/es2015-octal-integer-literal/migrated_0002/expected.json b/test/fixtures/esprima/es2015-octal-integer-literal/migrated_0002/expected.json new file mode 100644 index 0000000000..205a96ab16 --- /dev/null +++ b/test/fixtures/esprima/es2015-octal-integer-literal/migrated_0002/expected.json @@ -0,0 +1,150 @@ +{ + "type": "File", + "start": 0, + "end": 37, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 37 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 37, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 37 + } + }, + "sourceType": "script", + "body": [ + { + "type": "FunctionDeclaration", + "start": 0, + "end": 37, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 37 + } + }, + "id": { + "type": "Identifier", + "start": 9, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "name": "test" + }, + "generator": false, + "expression": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 16, + "end": 37, + "loc": { + "start": { + "line": 1, + "column": 16 + }, + "end": { + "line": 1, + "column": 37 + } + }, + "body": [ + { + "type": "ExpressionStatement", + "start": 17, + "end": 30, + "loc": { + "start": { + "line": 1, + "column": 17 + }, + "end": { + "line": 1, + "column": 30 + } + }, + "expression": { + "type": "Literal", + "start": 17, + "end": 29, + "loc": { + "start": { + "line": 1, + "column": 17 + }, + "end": { + "line": 1, + "column": 29 + } + }, + "value": "use strict", + "rawValue": "use strict", + "raw": "'use strict'" + } + }, + { + "type": "ExpressionStatement", + "start": 31, + "end": 35, + "loc": { + "start": { + "line": 1, + "column": 31 + }, + "end": { + "line": 1, + "column": 35 + } + }, + "expression": { + "type": "Literal", + "start": 31, + "end": 34, + "loc": { + "start": { + "line": 1, + "column": 31 + }, + "end": { + "line": 1, + "column": 34 + } + }, + "value": 0, + "rawValue": 0, + "raw": "0o0" + } + } + ] + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-octal-integer-literal/migrated_0003/actual.js b/test/fixtures/esprima/es2015-octal-integer-literal/migrated_0003/actual.js new file mode 100644 index 0000000000..11ec2e8006 --- /dev/null +++ b/test/fixtures/esprima/es2015-octal-integer-literal/migrated_0003/actual.js @@ -0,0 +1 @@ +0o2 diff --git a/test/fixtures/esprima/es2015-octal-integer-literal/migrated_0003/expected.json b/test/fixtures/esprima/es2015-octal-integer-literal/migrated_0003/expected.json new file mode 100644 index 0000000000..5e0a93482f --- /dev/null +++ b/test/fixtures/esprima/es2015-octal-integer-literal/migrated_0003/expected.json @@ -0,0 +1,66 @@ +{ + "type": "File", + "start": 0, + "end": 3, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 3 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 3, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 3 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 3, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 3 + } + }, + "expression": { + "type": "Literal", + "start": 0, + "end": 3, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 3 + } + }, + "value": 2, + "rawValue": 2, + "raw": "0o2" + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-octal-integer-literal/migrated_0004/actual.js b/test/fixtures/esprima/es2015-octal-integer-literal/migrated_0004/actual.js new file mode 100644 index 0000000000..0d019e772e --- /dev/null +++ b/test/fixtures/esprima/es2015-octal-integer-literal/migrated_0004/actual.js @@ -0,0 +1 @@ +0o12 diff --git a/test/fixtures/esprima/es2015-octal-integer-literal/migrated_0004/expected.json b/test/fixtures/esprima/es2015-octal-integer-literal/migrated_0004/expected.json new file mode 100644 index 0000000000..99d27ef22c --- /dev/null +++ b/test/fixtures/esprima/es2015-octal-integer-literal/migrated_0004/expected.json @@ -0,0 +1,66 @@ +{ + "type": "File", + "start": 0, + "end": 4, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 4 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 4, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 4 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 4, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 4 + } + }, + "expression": { + "type": "Literal", + "start": 0, + "end": 4, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 4 + } + }, + "value": 10, + "rawValue": 10, + "raw": "0o12" + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-octal-integer-literal/migrated_0005/actual.js b/test/fixtures/esprima/es2015-octal-integer-literal/migrated_0005/actual.js new file mode 100644 index 0000000000..fa429fd56e --- /dev/null +++ b/test/fixtures/esprima/es2015-octal-integer-literal/migrated_0005/actual.js @@ -0,0 +1 @@ +0O0 diff --git a/test/fixtures/esprima/es2015-octal-integer-literal/migrated_0005/expected.json b/test/fixtures/esprima/es2015-octal-integer-literal/migrated_0005/expected.json new file mode 100644 index 0000000000..b97a7679b0 --- /dev/null +++ b/test/fixtures/esprima/es2015-octal-integer-literal/migrated_0005/expected.json @@ -0,0 +1,66 @@ +{ + "type": "File", + "start": 0, + "end": 3, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 3 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 3, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 3 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 3, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 3 + } + }, + "expression": { + "type": "Literal", + "start": 0, + "end": 3, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 3 + } + }, + "value": 0, + "rawValue": 0, + "raw": "0O0" + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-octal-integer-literal/migrated_0006/actual.js b/test/fixtures/esprima/es2015-octal-integer-literal/migrated_0006/actual.js new file mode 100644 index 0000000000..ca79cb08e1 --- /dev/null +++ b/test/fixtures/esprima/es2015-octal-integer-literal/migrated_0006/actual.js @@ -0,0 +1 @@ +function test() {'use strict'; 0O0; } diff --git a/test/fixtures/esprima/es2015-octal-integer-literal/migrated_0006/expected.json b/test/fixtures/esprima/es2015-octal-integer-literal/migrated_0006/expected.json new file mode 100644 index 0000000000..e3ee2c9f37 --- /dev/null +++ b/test/fixtures/esprima/es2015-octal-integer-literal/migrated_0006/expected.json @@ -0,0 +1,150 @@ +{ + "type": "File", + "start": 0, + "end": 37, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 37 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 37, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 37 + } + }, + "sourceType": "script", + "body": [ + { + "type": "FunctionDeclaration", + "start": 0, + "end": 37, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 37 + } + }, + "id": { + "type": "Identifier", + "start": 9, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "name": "test" + }, + "generator": false, + "expression": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 16, + "end": 37, + "loc": { + "start": { + "line": 1, + "column": 16 + }, + "end": { + "line": 1, + "column": 37 + } + }, + "body": [ + { + "type": "ExpressionStatement", + "start": 17, + "end": 30, + "loc": { + "start": { + "line": 1, + "column": 17 + }, + "end": { + "line": 1, + "column": 30 + } + }, + "expression": { + "type": "Literal", + "start": 17, + "end": 29, + "loc": { + "start": { + "line": 1, + "column": 17 + }, + "end": { + "line": 1, + "column": 29 + } + }, + "value": "use strict", + "rawValue": "use strict", + "raw": "'use strict'" + } + }, + { + "type": "ExpressionStatement", + "start": 31, + "end": 35, + "loc": { + "start": { + "line": 1, + "column": 31 + }, + "end": { + "line": 1, + "column": 35 + } + }, + "expression": { + "type": "Literal", + "start": 31, + "end": 34, + "loc": { + "start": { + "line": 1, + "column": 31 + }, + "end": { + "line": 1, + "column": 34 + } + }, + "value": 0, + "rawValue": 0, + "raw": "0O0" + } + } + ] + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-rest-parameter/function-declaration/actual.js b/test/fixtures/esprima/es2015-rest-parameter/function-declaration/actual.js new file mode 100644 index 0000000000..712e8692f7 --- /dev/null +++ b/test/fixtures/esprima/es2015-rest-parameter/function-declaration/actual.js @@ -0,0 +1 @@ +function f(a, ...b) {} diff --git a/test/fixtures/esprima/es2015-rest-parameter/function-declaration/expected.json b/test/fixtures/esprima/es2015-rest-parameter/function-declaration/expected.json new file mode 100644 index 0000000000..4a17d865f7 --- /dev/null +++ b/test/fixtures/esprima/es2015-rest-parameter/function-declaration/expected.json @@ -0,0 +1,131 @@ +{ + "type": "File", + "start": 0, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "sourceType": "script", + "body": [ + { + "type": "FunctionDeclaration", + "start": 0, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "id": { + "type": "Identifier", + "start": 9, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "name": "f" + }, + "generator": false, + "expression": false, + "params": [ + { + "type": "Identifier", + "start": 11, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 11 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "name": "a" + }, + { + "type": "RestElement", + "start": 14, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 14 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "argument": { + "type": "Identifier", + "start": 17, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 17 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "name": "b" + } + } + ], + "body": { + "type": "BlockStatement", + "start": 20, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 20 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "body": [] + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-rest-parameter/function-expression/actual.js b/test/fixtures/esprima/es2015-rest-parameter/function-expression/actual.js new file mode 100644 index 0000000000..fa971224bb --- /dev/null +++ b/test/fixtures/esprima/es2015-rest-parameter/function-expression/actual.js @@ -0,0 +1 @@ +f = function(a, ...b) {} diff --git a/test/fixtures/esprima/es2015-rest-parameter/function-expression/expected.json b/test/fixtures/esprima/es2015-rest-parameter/function-expression/expected.json new file mode 100644 index 0000000000..d524d90df1 --- /dev/null +++ b/test/fixtures/esprima/es2015-rest-parameter/function-expression/expected.json @@ -0,0 +1,163 @@ +{ + "type": "File", + "start": 0, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 24 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 24 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 24 + } + }, + "expression": { + "type": "AssignmentExpression", + "start": 0, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 24 + } + }, + "operator": "=", + "left": { + "type": "Identifier", + "start": 0, + "end": 1, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + } + }, + "name": "f" + }, + "right": { + "type": "FunctionExpression", + "start": 4, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 24 + } + }, + "id": null, + "generator": false, + "expression": false, + "params": [ + { + "type": "Identifier", + "start": 13, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "name": "a" + }, + { + "type": "RestElement", + "start": 16, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 16 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "argument": { + "type": "Identifier", + "start": 19, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 19 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "name": "b" + } + } + ], + "body": { + "type": "BlockStatement", + "start": 22, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 22 + }, + "end": { + "line": 1, + "column": 24 + } + }, + "body": [] + } + } + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-rest-parameter/object-method/actual.js b/test/fixtures/esprima/es2015-rest-parameter/object-method/actual.js new file mode 100644 index 0000000000..af5910b4fc --- /dev/null +++ b/test/fixtures/esprima/es2015-rest-parameter/object-method/actual.js @@ -0,0 +1 @@ +o = { f: function(a, ...b) {} } diff --git a/test/fixtures/esprima/es2015-rest-parameter/object-method/expected.json b/test/fixtures/esprima/es2015-rest-parameter/object-method/expected.json new file mode 100644 index 0000000000..e7736168c6 --- /dev/null +++ b/test/fixtures/esprima/es2015-rest-parameter/object-method/expected.json @@ -0,0 +1,215 @@ +{ + "type": "File", + "start": 0, + "end": 31, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 31 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 31, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 31 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 31, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 31 + } + }, + "expression": { + "type": "AssignmentExpression", + "start": 0, + "end": 31, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 31 + } + }, + "operator": "=", + "left": { + "type": "Identifier", + "start": 0, + "end": 1, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + } + }, + "name": "o" + }, + "right": { + "type": "ObjectExpression", + "start": 4, + "end": 31, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 31 + } + }, + "properties": [ + { + "type": "Property", + "start": 6, + "end": 29, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 29 + } + }, + "method": false, + "shorthand": false, + "computed": false, + "key": { + "type": "Identifier", + "start": 6, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "name": "f" + }, + "value": { + "type": "FunctionExpression", + "start": 9, + "end": 29, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 29 + } + }, + "id": null, + "generator": false, + "expression": false, + "params": [ + { + "type": "Identifier", + "start": 18, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 18 + }, + "end": { + "line": 1, + "column": 19 + } + }, + "name": "a" + }, + { + "type": "RestElement", + "start": 21, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 21 + }, + "end": { + "line": 1, + "column": 25 + } + }, + "argument": { + "type": "Identifier", + "start": 24, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 24 + }, + "end": { + "line": 1, + "column": 25 + } + }, + "name": "b" + } + } + ], + "body": { + "type": "BlockStatement", + "start": 27, + "end": 29, + "loc": { + "start": { + "line": 1, + "column": 27 + }, + "end": { + "line": 1, + "column": 29 + } + }, + "body": [] + } + }, + "kind": "init" + } + ] + } + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-rest-parameter/object-shorthand-method/actual.js b/test/fixtures/esprima/es2015-rest-parameter/object-shorthand-method/actual.js new file mode 100644 index 0000000000..5099434fef --- /dev/null +++ b/test/fixtures/esprima/es2015-rest-parameter/object-shorthand-method/actual.js @@ -0,0 +1 @@ +x = { method(...test) { } } diff --git a/test/fixtures/esprima/es2015-rest-parameter/object-shorthand-method/expected.json b/test/fixtures/esprima/es2015-rest-parameter/object-shorthand-method/expected.json new file mode 100644 index 0000000000..aee5d3439b --- /dev/null +++ b/test/fixtures/esprima/es2015-rest-parameter/object-shorthand-method/expected.json @@ -0,0 +1,199 @@ +{ + "type": "File", + "start": 0, + "end": 27, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 27 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 27, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 27 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 27, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 27 + } + }, + "expression": { + "type": "AssignmentExpression", + "start": 0, + "end": 27, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 27 + } + }, + "operator": "=", + "left": { + "type": "Identifier", + "start": 0, + "end": 1, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + } + }, + "name": "x" + }, + "right": { + "type": "ObjectExpression", + "start": 4, + "end": 27, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 27 + } + }, + "properties": [ + { + "type": "Property", + "start": 6, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 25 + } + }, + "method": true, + "shorthand": false, + "computed": false, + "key": { + "type": "Identifier", + "start": 6, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "name": "method" + }, + "kind": "init", + "value": { + "type": "FunctionExpression", + "start": 12, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 12 + }, + "end": { + "line": 1, + "column": 25 + } + }, + "id": null, + "generator": false, + "expression": false, + "params": [ + { + "type": "RestElement", + "start": 13, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "argument": { + "type": "Identifier", + "start": 16, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 16 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "name": "test" + } + } + ], + "body": { + "type": "BlockStatement", + "start": 22, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 22 + }, + "end": { + "line": 1, + "column": 25 + } + }, + "body": [] + } + } + } + ] + } + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-spread-element/call-multi-spread/actual.js b/test/fixtures/esprima/es2015-spread-element/call-multi-spread/actual.js new file mode 100644 index 0000000000..35ce3a284a --- /dev/null +++ b/test/fixtures/esprima/es2015-spread-element/call-multi-spread/actual.js @@ -0,0 +1 @@ +f(...x, ...y, ...z); diff --git a/test/fixtures/esprima/es2015-spread-element/call-multi-spread/expected.json b/test/fixtures/esprima/es2015-spread-element/call-multi-spread/expected.json new file mode 100644 index 0000000000..2610b26d4f --- /dev/null +++ b/test/fixtures/esprima/es2015-spread-element/call-multi-spread/expected.json @@ -0,0 +1,174 @@ +{ + "type": "File", + "start": 0, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "expression": { + "type": "CallExpression", + "start": 0, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 19 + } + }, + "callee": { + "type": "Identifier", + "start": 0, + "end": 1, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + } + }, + "name": "f" + }, + "arguments": [ + { + "type": "SpreadElement", + "start": 2, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 2 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "argument": { + "type": "Identifier", + "start": 5, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "name": "x" + } + }, + { + "type": "SpreadElement", + "start": 8, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "argument": { + "type": "Identifier", + "start": 11, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 11 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "name": "y" + } + }, + { + "type": "SpreadElement", + "start": 14, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 14 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "argument": { + "type": "Identifier", + "start": 17, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 17 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "name": "z" + } + } + ] + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-spread-element/call-spread-default/actual.js b/test/fixtures/esprima/es2015-spread-element/call-spread-default/actual.js new file mode 100644 index 0000000000..66837c3c6c --- /dev/null +++ b/test/fixtures/esprima/es2015-spread-element/call-spread-default/actual.js @@ -0,0 +1 @@ +f(g, ...h = i); diff --git a/test/fixtures/esprima/es2015-spread-element/call-spread-default/expected.json b/test/fixtures/esprima/es2015-spread-element/call-spread-default/expected.json new file mode 100644 index 0000000000..dbf33a3d90 --- /dev/null +++ b/test/fixtures/esprima/es2015-spread-element/call-spread-default/expected.json @@ -0,0 +1,160 @@ +{ + "type": "File", + "start": 0, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "expression": { + "type": "CallExpression", + "start": 0, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "callee": { + "type": "Identifier", + "start": 0, + "end": 1, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + } + }, + "name": "f" + }, + "arguments": [ + { + "type": "Identifier", + "start": 2, + "end": 3, + "loc": { + "start": { + "line": 1, + "column": 2 + }, + "end": { + "line": 1, + "column": 3 + } + }, + "name": "g" + }, + { + "type": "SpreadElement", + "start": 5, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "argument": { + "type": "AssignmentExpression", + "start": 8, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "operator": "=", + "left": { + "type": "Identifier", + "start": 8, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "name": "h" + }, + "right": { + "type": "Identifier", + "start": 12, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 12 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "name": "i" + } + } + } + ] + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-spread-element/call-spread-first/actual.js b/test/fixtures/esprima/es2015-spread-element/call-spread-first/actual.js new file mode 100644 index 0000000000..c6bb9ceba6 --- /dev/null +++ b/test/fixtures/esprima/es2015-spread-element/call-spread-first/actual.js @@ -0,0 +1 @@ +f(...x, y, z); diff --git a/test/fixtures/esprima/es2015-spread-element/call-spread-first/expected.json b/test/fixtures/esprima/es2015-spread-element/call-spread-first/expected.json new file mode 100644 index 0000000000..4200d9b278 --- /dev/null +++ b/test/fixtures/esprima/es2015-spread-element/call-spread-first/expected.json @@ -0,0 +1,144 @@ +{ + "type": "File", + "start": 0, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "expression": { + "type": "CallExpression", + "start": 0, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "callee": { + "type": "Identifier", + "start": 0, + "end": 1, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + } + }, + "name": "f" + }, + "arguments": [ + { + "type": "SpreadElement", + "start": 2, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 2 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "argument": { + "type": "Identifier", + "start": 5, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "name": "x" + } + }, + { + "type": "Identifier", + "start": 8, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "name": "y" + }, + { + "type": "Identifier", + "start": 11, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 11 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "name": "z" + } + ] + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-spread-element/call-spread-number/actual.js b/test/fixtures/esprima/es2015-spread-element/call-spread-number/actual.js new file mode 100644 index 0000000000..e97b23f2bc --- /dev/null +++ b/test/fixtures/esprima/es2015-spread-element/call-spread-number/actual.js @@ -0,0 +1 @@ +f(....5); diff --git a/test/fixtures/esprima/es2015-spread-element/call-spread-number/expected.json b/test/fixtures/esprima/es2015-spread-element/call-spread-number/expected.json new file mode 100644 index 0000000000..0b852348e3 --- /dev/null +++ b/test/fixtures/esprima/es2015-spread-element/call-spread-number/expected.json @@ -0,0 +1,114 @@ +{ + "type": "File", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "expression": { + "type": "CallExpression", + "start": 0, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "callee": { + "type": "Identifier", + "start": 0, + "end": 1, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + } + }, + "name": "f" + }, + "arguments": [ + { + "type": "SpreadElement", + "start": 2, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 2 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "argument": { + "type": "Literal", + "start": 5, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "value": 0.5, + "rawValue": 0.5, + "raw": ".5" + } + } + ] + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-spread-element/call-spread/actual.js b/test/fixtures/esprima/es2015-spread-element/call-spread/actual.js new file mode 100644 index 0000000000..95c689e847 --- /dev/null +++ b/test/fixtures/esprima/es2015-spread-element/call-spread/actual.js @@ -0,0 +1 @@ +f(...g); diff --git a/test/fixtures/esprima/es2015-spread-element/call-spread/expected.json b/test/fixtures/esprima/es2015-spread-element/call-spread/expected.json new file mode 100644 index 0000000000..f85b3967a4 --- /dev/null +++ b/test/fixtures/esprima/es2015-spread-element/call-spread/expected.json @@ -0,0 +1,112 @@ +{ + "type": "File", + "start": 0, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "expression": { + "type": "CallExpression", + "start": 0, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "callee": { + "type": "Identifier", + "start": 0, + "end": 1, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + } + }, + "name": "f" + }, + "arguments": [ + { + "type": "SpreadElement", + "start": 2, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 2 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "argument": { + "type": "Identifier", + "start": 5, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "name": "g" + } + } + ] + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-spread-element/invalid-call-dot-dot/actual.js b/test/fixtures/esprima/es2015-spread-element/invalid-call-dot-dot/actual.js new file mode 100644 index 0000000000..893bd180db --- /dev/null +++ b/test/fixtures/esprima/es2015-spread-element/invalid-call-dot-dot/actual.js @@ -0,0 +1 @@ +f(..g); diff --git a/test/fixtures/esprima/es2015-spread-element/invalid-call-dot-dot/options.json b/test/fixtures/esprima/es2015-spread-element/invalid-call-dot-dot/options.json new file mode 100644 index 0000000000..e68fbb6aec --- /dev/null +++ b/test/fixtures/esprima/es2015-spread-element/invalid-call-dot-dot/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Unexpected token (1:2)" +} \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-spread-element/invalid-call-dots/actual.js b/test/fixtures/esprima/es2015-spread-element/invalid-call-dots/actual.js new file mode 100644 index 0000000000..70875a2750 --- /dev/null +++ b/test/fixtures/esprima/es2015-spread-element/invalid-call-dots/actual.js @@ -0,0 +1 @@ +f(....g); diff --git a/test/fixtures/esprima/es2015-spread-element/invalid-call-dots/options.json b/test/fixtures/esprima/es2015-spread-element/invalid-call-dots/options.json new file mode 100644 index 0000000000..0ab445fe47 --- /dev/null +++ b/test/fixtures/esprima/es2015-spread-element/invalid-call-dots/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Unexpected token (1:5)" +} \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-spread-element/invalid-call-spreads/actual.js b/test/fixtures/esprima/es2015-spread-element/invalid-call-spreads/actual.js new file mode 100644 index 0000000000..6c046e3528 --- /dev/null +++ b/test/fixtures/esprima/es2015-spread-element/invalid-call-spreads/actual.js @@ -0,0 +1 @@ +f(... ... g); diff --git a/test/fixtures/esprima/es2015-spread-element/invalid-call-spreads/options.json b/test/fixtures/esprima/es2015-spread-element/invalid-call-spreads/options.json new file mode 100644 index 0000000000..515b971673 --- /dev/null +++ b/test/fixtures/esprima/es2015-spread-element/invalid-call-spreads/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Unexpected token (1:6)" +} \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-spread-element/invalid-new-dot-dot/actual.js b/test/fixtures/esprima/es2015-spread-element/invalid-new-dot-dot/actual.js new file mode 100644 index 0000000000..94f077133c --- /dev/null +++ b/test/fixtures/esprima/es2015-spread-element/invalid-new-dot-dot/actual.js @@ -0,0 +1 @@ +new f(..g); diff --git a/test/fixtures/esprima/es2015-spread-element/invalid-new-dot-dot/options.json b/test/fixtures/esprima/es2015-spread-element/invalid-new-dot-dot/options.json new file mode 100644 index 0000000000..515b971673 --- /dev/null +++ b/test/fixtures/esprima/es2015-spread-element/invalid-new-dot-dot/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Unexpected token (1:6)" +} \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-spread-element/invalid-new-dots/actual.js b/test/fixtures/esprima/es2015-spread-element/invalid-new-dots/actual.js new file mode 100644 index 0000000000..1078dba79a --- /dev/null +++ b/test/fixtures/esprima/es2015-spread-element/invalid-new-dots/actual.js @@ -0,0 +1 @@ +new f(....g); diff --git a/test/fixtures/esprima/es2015-spread-element/invalid-new-dots/options.json b/test/fixtures/esprima/es2015-spread-element/invalid-new-dots/options.json new file mode 100644 index 0000000000..93db7641c7 --- /dev/null +++ b/test/fixtures/esprima/es2015-spread-element/invalid-new-dots/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Unexpected token (1:9)" +} \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-spread-element/invalid-new-spreads/actual.js b/test/fixtures/esprima/es2015-spread-element/invalid-new-spreads/actual.js new file mode 100644 index 0000000000..5f6a3034bc --- /dev/null +++ b/test/fixtures/esprima/es2015-spread-element/invalid-new-spreads/actual.js @@ -0,0 +1 @@ +new f(... ... g); diff --git a/test/fixtures/esprima/es2015-spread-element/invalid-new-spreads/options.json b/test/fixtures/esprima/es2015-spread-element/invalid-new-spreads/options.json new file mode 100644 index 0000000000..328b1ddde8 --- /dev/null +++ b/test/fixtures/esprima/es2015-spread-element/invalid-new-spreads/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Unexpected token (1:10)" +} \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-spread-element/new-multi-spread/actual.js b/test/fixtures/esprima/es2015-spread-element/new-multi-spread/actual.js new file mode 100644 index 0000000000..afb519abca --- /dev/null +++ b/test/fixtures/esprima/es2015-spread-element/new-multi-spread/actual.js @@ -0,0 +1 @@ +new f(...x, ...y, ...z); diff --git a/test/fixtures/esprima/es2015-spread-element/new-multi-spread/expected.json b/test/fixtures/esprima/es2015-spread-element/new-multi-spread/expected.json new file mode 100644 index 0000000000..8a3987d6e0 --- /dev/null +++ b/test/fixtures/esprima/es2015-spread-element/new-multi-spread/expected.json @@ -0,0 +1,174 @@ +{ + "type": "File", + "start": 0, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 24 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 24 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 24 + } + }, + "expression": { + "type": "NewExpression", + "start": 0, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "callee": { + "type": "Identifier", + "start": 4, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "name": "f" + }, + "arguments": [ + { + "type": "SpreadElement", + "start": 6, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "argument": { + "type": "Identifier", + "start": 9, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "name": "x" + } + }, + { + "type": "SpreadElement", + "start": 12, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 12 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "argument": { + "type": "Identifier", + "start": 15, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "name": "y" + } + }, + { + "type": "SpreadElement", + "start": 18, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 18 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "argument": { + "type": "Identifier", + "start": 21, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 21 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "name": "z" + } + } + ] + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-spread-element/new-spread-default/actual.js b/test/fixtures/esprima/es2015-spread-element/new-spread-default/actual.js new file mode 100644 index 0000000000..a379e559f4 --- /dev/null +++ b/test/fixtures/esprima/es2015-spread-element/new-spread-default/actual.js @@ -0,0 +1 @@ +new f(g, ...h = i); diff --git a/test/fixtures/esprima/es2015-spread-element/new-spread-default/expected.json b/test/fixtures/esprima/es2015-spread-element/new-spread-default/expected.json new file mode 100644 index 0000000000..79688da6aa --- /dev/null +++ b/test/fixtures/esprima/es2015-spread-element/new-spread-default/expected.json @@ -0,0 +1,160 @@ +{ + "type": "File", + "start": 0, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 19 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 19 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 19 + } + }, + "expression": { + "type": "NewExpression", + "start": 0, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "callee": { + "type": "Identifier", + "start": 4, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "name": "f" + }, + "arguments": [ + { + "type": "Identifier", + "start": 6, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "name": "g" + }, + { + "type": "SpreadElement", + "start": 9, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "argument": { + "type": "AssignmentExpression", + "start": 12, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 12 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "operator": "=", + "left": { + "type": "Identifier", + "start": 12, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 12 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "name": "h" + }, + "right": { + "type": "Identifier", + "start": 16, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 16 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "name": "i" + } + } + } + ] + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-spread-element/new-spread-first/actual.js b/test/fixtures/esprima/es2015-spread-element/new-spread-first/actual.js new file mode 100644 index 0000000000..359da277a9 --- /dev/null +++ b/test/fixtures/esprima/es2015-spread-element/new-spread-first/actual.js @@ -0,0 +1 @@ +new f(...x, y, z); diff --git a/test/fixtures/esprima/es2015-spread-element/new-spread-first/expected.json b/test/fixtures/esprima/es2015-spread-element/new-spread-first/expected.json new file mode 100644 index 0000000000..7075fa833c --- /dev/null +++ b/test/fixtures/esprima/es2015-spread-element/new-spread-first/expected.json @@ -0,0 +1,144 @@ +{ + "type": "File", + "start": 0, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "expression": { + "type": "NewExpression", + "start": 0, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "callee": { + "type": "Identifier", + "start": 4, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "name": "f" + }, + "arguments": [ + { + "type": "SpreadElement", + "start": 6, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "argument": { + "type": "Identifier", + "start": 9, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "name": "x" + } + }, + { + "type": "Identifier", + "start": 12, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 12 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "name": "y" + }, + { + "type": "Identifier", + "start": 15, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "name": "z" + } + ] + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-spread-element/new-spread-number/actual.js b/test/fixtures/esprima/es2015-spread-element/new-spread-number/actual.js new file mode 100644 index 0000000000..3c55719805 --- /dev/null +++ b/test/fixtures/esprima/es2015-spread-element/new-spread-number/actual.js @@ -0,0 +1 @@ +new f(....5); diff --git a/test/fixtures/esprima/es2015-spread-element/new-spread-number/expected.json b/test/fixtures/esprima/es2015-spread-element/new-spread-number/expected.json new file mode 100644 index 0000000000..f0ce7bb220 --- /dev/null +++ b/test/fixtures/esprima/es2015-spread-element/new-spread-number/expected.json @@ -0,0 +1,114 @@ +{ + "type": "File", + "start": 0, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "expression": { + "type": "NewExpression", + "start": 0, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "callee": { + "type": "Identifier", + "start": 4, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "name": "f" + }, + "arguments": [ + { + "type": "SpreadElement", + "start": 6, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "argument": { + "type": "Literal", + "start": 9, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "value": 0.5, + "rawValue": 0.5, + "raw": ".5" + } + } + ] + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-spread-element/new-spread/actual.js b/test/fixtures/esprima/es2015-spread-element/new-spread/actual.js new file mode 100644 index 0000000000..316f810403 --- /dev/null +++ b/test/fixtures/esprima/es2015-spread-element/new-spread/actual.js @@ -0,0 +1 @@ +new f(...g); diff --git a/test/fixtures/esprima/es2015-spread-element/new-spread/expected.json b/test/fixtures/esprima/es2015-spread-element/new-spread/expected.json new file mode 100644 index 0000000000..a5a4974201 --- /dev/null +++ b/test/fixtures/esprima/es2015-spread-element/new-spread/expected.json @@ -0,0 +1,112 @@ +{ + "type": "File", + "start": 0, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "expression": { + "type": "NewExpression", + "start": 0, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "callee": { + "type": "Identifier", + "start": 4, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "name": "f" + }, + "arguments": [ + { + "type": "SpreadElement", + "start": 6, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "argument": { + "type": "Identifier", + "start": 9, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "name": "g" + } + } + ] + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-super-property/arrow_super/actual.js b/test/fixtures/esprima/es2015-super-property/arrow_super/actual.js new file mode 100644 index 0000000000..016e8d4d7f --- /dev/null +++ b/test/fixtures/esprima/es2015-super-property/arrow_super/actual.js @@ -0,0 +1,5 @@ +class A extends B { + constructor() { + () => super() + } +} diff --git a/test/fixtures/esprima/es2015-super-property/arrow_super/expected.json b/test/fixtures/esprima/es2015-super-property/arrow_super/expected.json new file mode 100644 index 0000000000..b94e426219 --- /dev/null +++ b/test/fixtures/esprima/es2015-super-property/arrow_super/expected.json @@ -0,0 +1,232 @@ +{ + "type": "File", + "start": 0, + "end": 69, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 5, + "column": 1 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 69, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 5, + "column": 1 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ClassDeclaration", + "start": 0, + "end": 69, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 5, + "column": 1 + } + }, + "id": { + "type": "Identifier", + "start": 6, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "name": "A" + }, + "superClass": { + "type": "Identifier", + "start": 16, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 16 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "name": "B" + }, + "body": { + "type": "ClassBody", + "start": 18, + "end": 69, + "loc": { + "start": { + "line": 1, + "column": 18 + }, + "end": { + "line": 5, + "column": 1 + } + }, + "body": [ + { + "type": "MethodDefinition", + "start": 24, + "end": 67, + "loc": { + "start": { + "line": 2, + "column": 4 + }, + "end": { + "line": 4, + "column": 5 + } + }, + "computed": false, + "key": { + "type": "Identifier", + "start": 24, + "end": 35, + "loc": { + "start": { + "line": 2, + "column": 4 + }, + "end": { + "line": 2, + "column": 15 + } + }, + "name": "constructor" + }, + "static": false, + "kind": "constructor", + "value": { + "type": "FunctionExpression", + "start": 35, + "end": 67, + "loc": { + "start": { + "line": 2, + "column": 15 + }, + "end": { + "line": 4, + "column": 5 + } + }, + "id": null, + "generator": false, + "expression": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 38, + "end": 67, + "loc": { + "start": { + "line": 2, + "column": 18 + }, + "end": { + "line": 4, + "column": 5 + } + }, + "body": [ + { + "type": "ExpressionStatement", + "start": 48, + "end": 61, + "loc": { + "start": { + "line": 3, + "column": 8 + }, + "end": { + "line": 3, + "column": 21 + } + }, + "expression": { + "type": "ArrowFunctionExpression", + "start": 48, + "end": 61, + "loc": { + "start": { + "line": 3, + "column": 8 + }, + "end": { + "line": 3, + "column": 21 + } + }, + "id": null, + "generator": false, + "expression": true, + "params": [], + "body": { + "type": "CallExpression", + "start": 54, + "end": 61, + "loc": { + "start": { + "line": 3, + "column": 14 + }, + "end": { + "line": 3, + "column": 21 + } + }, + "callee": { + "type": "Super", + "start": 54, + "end": 59, + "loc": { + "start": { + "line": 3, + "column": 14 + }, + "end": { + "line": 3, + "column": 19 + } + } + }, + "arguments": [] + } + } + } + ] + } + } + } + ] + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-super-property/constructor_super/actual.js b/test/fixtures/esprima/es2015-super-property/constructor_super/actual.js new file mode 100644 index 0000000000..ed6fbc8212 --- /dev/null +++ b/test/fixtures/esprima/es2015-super-property/constructor_super/actual.js @@ -0,0 +1,5 @@ +class A extends B { + constructor() { + super(); + } +} diff --git a/test/fixtures/esprima/es2015-super-property/constructor_super/expected.json b/test/fixtures/esprima/es2015-super-property/constructor_super/expected.json new file mode 100644 index 0000000000..dd99c7bb8e --- /dev/null +++ b/test/fixtures/esprima/es2015-super-property/constructor_super/expected.json @@ -0,0 +1,213 @@ +{ + "type": "File", + "start": 0, + "end": 64, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 5, + "column": 1 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 64, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 5, + "column": 1 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ClassDeclaration", + "start": 0, + "end": 64, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 5, + "column": 1 + } + }, + "id": { + "type": "Identifier", + "start": 6, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "name": "A" + }, + "superClass": { + "type": "Identifier", + "start": 16, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 16 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "name": "B" + }, + "body": { + "type": "ClassBody", + "start": 18, + "end": 64, + "loc": { + "start": { + "line": 1, + "column": 18 + }, + "end": { + "line": 5, + "column": 1 + } + }, + "body": [ + { + "type": "MethodDefinition", + "start": 24, + "end": 62, + "loc": { + "start": { + "line": 2, + "column": 4 + }, + "end": { + "line": 4, + "column": 5 + } + }, + "computed": false, + "key": { + "type": "Identifier", + "start": 24, + "end": 35, + "loc": { + "start": { + "line": 2, + "column": 4 + }, + "end": { + "line": 2, + "column": 15 + } + }, + "name": "constructor" + }, + "static": false, + "kind": "constructor", + "value": { + "type": "FunctionExpression", + "start": 35, + "end": 62, + "loc": { + "start": { + "line": 2, + "column": 15 + }, + "end": { + "line": 4, + "column": 5 + } + }, + "id": null, + "generator": false, + "expression": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 38, + "end": 62, + "loc": { + "start": { + "line": 2, + "column": 18 + }, + "end": { + "line": 4, + "column": 5 + } + }, + "body": [ + { + "type": "ExpressionStatement", + "start": 48, + "end": 56, + "loc": { + "start": { + "line": 3, + "column": 8 + }, + "end": { + "line": 3, + "column": 16 + } + }, + "expression": { + "type": "CallExpression", + "start": 48, + "end": 55, + "loc": { + "start": { + "line": 3, + "column": 8 + }, + "end": { + "line": 3, + "column": 15 + } + }, + "callee": { + "type": "Super", + "start": 48, + "end": 53, + "loc": { + "start": { + "line": 3, + "column": 8 + }, + "end": { + "line": 3, + "column": 13 + } + } + }, + "arguments": [] + } + } + ] + } + } + } + ] + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-super-property/invalid_super_access/actual.js b/test/fixtures/esprima/es2015-super-property/invalid_super_access/actual.js new file mode 100644 index 0000000000..ddff2f376c --- /dev/null +++ b/test/fixtures/esprima/es2015-super-property/invalid_super_access/actual.js @@ -0,0 +1,5 @@ +class A extends B { + constructor() { + (super)(); + } +} diff --git a/test/fixtures/esprima/es2015-super-property/invalid_super_access/options.json b/test/fixtures/esprima/es2015-super-property/invalid_super_access/options.json new file mode 100644 index 0000000000..18fe6d12a8 --- /dev/null +++ b/test/fixtures/esprima/es2015-super-property/invalid_super_access/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Unexpected super (3:9)" +} diff --git a/test/fixtures/esprima/es2015-super-property/invalid_super_id/actual.js b/test/fixtures/esprima/es2015-super-property/invalid_super_id/actual.js new file mode 100644 index 0000000000..bf4f139b2b --- /dev/null +++ b/test/fixtures/esprima/es2015-super-property/invalid_super_id/actual.js @@ -0,0 +1,3 @@ +class A { + foo() { new super + 3 } +} diff --git a/test/fixtures/esprima/es2015-super-property/invalid_super_id/expected.json b/test/fixtures/esprima/es2015-super-property/invalid_super_id/expected.json new file mode 100644 index 0000000000..9f101bba08 --- /dev/null +++ b/test/fixtures/esprima/es2015-super-property/invalid_super_id/expected.json @@ -0,0 +1,232 @@ +{ + "type": "File", + "start": 0, + "end": 39, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 3, + "column": 1 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 39, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 3, + "column": 1 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ClassDeclaration", + "start": 0, + "end": 39, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 3, + "column": 1 + } + }, + "id": { + "type": "Identifier", + "start": 6, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "name": "A" + }, + "superClass": null, + "body": { + "type": "ClassBody", + "start": 8, + "end": 39, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 3, + "column": 1 + } + }, + "body": [ + { + "type": "MethodDefinition", + "start": 14, + "end": 37, + "loc": { + "start": { + "line": 2, + "column": 4 + }, + "end": { + "line": 2, + "column": 27 + } + }, + "computed": false, + "key": { + "type": "Identifier", + "start": 14, + "end": 17, + "loc": { + "start": { + "line": 2, + "column": 4 + }, + "end": { + "line": 2, + "column": 7 + } + }, + "name": "foo" + }, + "static": false, + "kind": "method", + "value": { + "type": "FunctionExpression", + "start": 17, + "end": 37, + "loc": { + "start": { + "line": 2, + "column": 7 + }, + "end": { + "line": 2, + "column": 27 + } + }, + "id": null, + "generator": false, + "expression": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 20, + "end": 37, + "loc": { + "start": { + "line": 2, + "column": 10 + }, + "end": { + "line": 2, + "column": 27 + } + }, + "body": [ + { + "type": "ExpressionStatement", + "start": 22, + "end": 35, + "loc": { + "start": { + "line": 2, + "column": 12 + }, + "end": { + "line": 2, + "column": 25 + } + }, + "expression": { + "type": "BinaryExpression", + "start": 22, + "end": 35, + "loc": { + "start": { + "line": 2, + "column": 12 + }, + "end": { + "line": 2, + "column": 25 + } + }, + "left": { + "type": "NewExpression", + "start": 22, + "end": 31, + "loc": { + "start": { + "line": 2, + "column": 12 + }, + "end": { + "line": 2, + "column": 21 + } + }, + "callee": { + "type": "Super", + "start": 26, + "end": 31, + "loc": { + "start": { + "line": 2, + "column": 16 + }, + "end": { + "line": 2, + "column": 21 + } + } + }, + "arguments": [] + }, + "operator": "+", + "right": { + "type": "Literal", + "start": 34, + "end": 35, + "loc": { + "start": { + "line": 2, + "column": 24 + }, + "end": { + "line": 2, + "column": 25 + } + }, + "value": 3, + "rawValue": 3, + "raw": "3" + } + } + } + ] + } + } + } + ] + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-super-property/invalid_super_id/options.json b/test/fixtures/esprima/es2015-super-property/invalid_super_id/options.json new file mode 100644 index 0000000000..2479ccfd69 --- /dev/null +++ b/test/fixtures/esprima/es2015-super-property/invalid_super_id/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Unexpected super (2:16)" +} diff --git a/test/fixtures/esprima/es2015-super-property/invalid_super_not_inside_function/actual.js b/test/fixtures/esprima/es2015-super-property/invalid_super_not_inside_function/actual.js new file mode 100644 index 0000000000..37fcf41ca3 --- /dev/null +++ b/test/fixtures/esprima/es2015-super-property/invalid_super_not_inside_function/actual.js @@ -0,0 +1 @@ +var x = super(); diff --git a/test/fixtures/esprima/es2015-super-property/invalid_super_not_inside_function/options.json b/test/fixtures/esprima/es2015-super-property/invalid_super_not_inside_function/options.json new file mode 100644 index 0000000000..1518a5e3fe --- /dev/null +++ b/test/fixtures/esprima/es2015-super-property/invalid_super_not_inside_function/options.json @@ -0,0 +1,3 @@ +{ + "throws": "'super' outside of function or class (1:8)" +} \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-super-property/new_super/actual.js b/test/fixtures/esprima/es2015-super-property/new_super/actual.js new file mode 100644 index 0000000000..ec0be4ed6a --- /dev/null +++ b/test/fixtures/esprima/es2015-super-property/new_super/actual.js @@ -0,0 +1,5 @@ +class A extends B { + foo() { + new super.bar() + } +} diff --git a/test/fixtures/esprima/es2015-super-property/new_super/expected.json b/test/fixtures/esprima/es2015-super-property/new_super/expected.json new file mode 100644 index 0000000000..d86a834f70 --- /dev/null +++ b/test/fixtures/esprima/es2015-super-property/new_super/expected.json @@ -0,0 +1,245 @@ +{ + "type": "File", + "start": 0, + "end": 63, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 5, + "column": 1 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 63, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 5, + "column": 1 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ClassDeclaration", + "start": 0, + "end": 63, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 5, + "column": 1 + } + }, + "id": { + "type": "Identifier", + "start": 6, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "name": "A" + }, + "superClass": { + "type": "Identifier", + "start": 16, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 16 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "name": "B" + }, + "body": { + "type": "ClassBody", + "start": 18, + "end": 63, + "loc": { + "start": { + "line": 1, + "column": 18 + }, + "end": { + "line": 5, + "column": 1 + } + }, + "body": [ + { + "type": "MethodDefinition", + "start": 24, + "end": 61, + "loc": { + "start": { + "line": 2, + "column": 4 + }, + "end": { + "line": 4, + "column": 5 + } + }, + "computed": false, + "key": { + "type": "Identifier", + "start": 24, + "end": 27, + "loc": { + "start": { + "line": 2, + "column": 4 + }, + "end": { + "line": 2, + "column": 7 + } + }, + "name": "foo" + }, + "static": false, + "kind": "method", + "value": { + "type": "FunctionExpression", + "start": 27, + "end": 61, + "loc": { + "start": { + "line": 2, + "column": 7 + }, + "end": { + "line": 4, + "column": 5 + } + }, + "id": null, + "generator": false, + "expression": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 30, + "end": 61, + "loc": { + "start": { + "line": 2, + "column": 10 + }, + "end": { + "line": 4, + "column": 5 + } + }, + "body": [ + { + "type": "ExpressionStatement", + "start": 40, + "end": 55, + "loc": { + "start": { + "line": 3, + "column": 8 + }, + "end": { + "line": 3, + "column": 23 + } + }, + "expression": { + "type": "NewExpression", + "start": 40, + "end": 55, + "loc": { + "start": { + "line": 3, + "column": 8 + }, + "end": { + "line": 3, + "column": 23 + } + }, + "callee": { + "type": "MemberExpression", + "start": 44, + "end": 53, + "loc": { + "start": { + "line": 3, + "column": 12 + }, + "end": { + "line": 3, + "column": 21 + } + }, + "object": { + "type": "Super", + "start": 44, + "end": 49, + "loc": { + "start": { + "line": 3, + "column": 12 + }, + "end": { + "line": 3, + "column": 17 + } + } + }, + "property": { + "type": "Identifier", + "start": 50, + "end": 53, + "loc": { + "start": { + "line": 3, + "column": 18 + }, + "end": { + "line": 3, + "column": 21 + } + }, + "name": "bar" + }, + "computed": false + }, + "arguments": [] + } + } + ] + } + } + } + ] + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-super-property/super_computed/actual.js b/test/fixtures/esprima/es2015-super-property/super_computed/actual.js new file mode 100644 index 0000000000..02b6d22d2f --- /dev/null +++ b/test/fixtures/esprima/es2015-super-property/super_computed/actual.js @@ -0,0 +1,5 @@ +class A extends B { + X() { + return super[1] + } +} diff --git a/test/fixtures/esprima/es2015-super-property/super_computed/expected.json b/test/fixtures/esprima/es2015-super-property/super_computed/expected.json new file mode 100644 index 0000000000..ff1ee7f02a --- /dev/null +++ b/test/fixtures/esprima/es2015-super-property/super_computed/expected.json @@ -0,0 +1,231 @@ +{ + "type": "File", + "start": 0, + "end": 61, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 5, + "column": 1 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 61, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 5, + "column": 1 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ClassDeclaration", + "start": 0, + "end": 61, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 5, + "column": 1 + } + }, + "id": { + "type": "Identifier", + "start": 6, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "name": "A" + }, + "superClass": { + "type": "Identifier", + "start": 16, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 16 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "name": "B" + }, + "body": { + "type": "ClassBody", + "start": 18, + "end": 61, + "loc": { + "start": { + "line": 1, + "column": 18 + }, + "end": { + "line": 5, + "column": 1 + } + }, + "body": [ + { + "type": "MethodDefinition", + "start": 24, + "end": 59, + "loc": { + "start": { + "line": 2, + "column": 4 + }, + "end": { + "line": 4, + "column": 5 + } + }, + "computed": false, + "key": { + "type": "Identifier", + "start": 24, + "end": 25, + "loc": { + "start": { + "line": 2, + "column": 4 + }, + "end": { + "line": 2, + "column": 5 + } + }, + "name": "X" + }, + "static": false, + "kind": "method", + "value": { + "type": "FunctionExpression", + "start": 25, + "end": 59, + "loc": { + "start": { + "line": 2, + "column": 5 + }, + "end": { + "line": 4, + "column": 5 + } + }, + "id": null, + "generator": false, + "expression": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 28, + "end": 59, + "loc": { + "start": { + "line": 2, + "column": 8 + }, + "end": { + "line": 4, + "column": 5 + } + }, + "body": [ + { + "type": "ReturnStatement", + "start": 38, + "end": 53, + "loc": { + "start": { + "line": 3, + "column": 8 + }, + "end": { + "line": 3, + "column": 23 + } + }, + "argument": { + "type": "MemberExpression", + "start": 45, + "end": 53, + "loc": { + "start": { + "line": 3, + "column": 15 + }, + "end": { + "line": 3, + "column": 23 + } + }, + "object": { + "type": "Super", + "start": 45, + "end": 50, + "loc": { + "start": { + "line": 3, + "column": 15 + }, + "end": { + "line": 3, + "column": 20 + } + } + }, + "property": { + "type": "Literal", + "start": 51, + "end": 52, + "loc": { + "start": { + "line": 3, + "column": 21 + }, + "end": { + "line": 3, + "column": 22 + } + }, + "value": 1, + "rawValue": 1, + "raw": "1" + }, + "computed": true + } + } + ] + } + } + } + ] + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-super-property/super_member/actual.js b/test/fixtures/esprima/es2015-super-property/super_member/actual.js new file mode 100644 index 0000000000..28e4ea0e62 --- /dev/null +++ b/test/fixtures/esprima/es2015-super-property/super_member/actual.js @@ -0,0 +1,5 @@ +class A extends B { + X() { + return super.y + } +} diff --git a/test/fixtures/esprima/es2015-super-property/super_member/expected.json b/test/fixtures/esprima/es2015-super-property/super_member/expected.json new file mode 100644 index 0000000000..ad4ef9c6c4 --- /dev/null +++ b/test/fixtures/esprima/es2015-super-property/super_member/expected.json @@ -0,0 +1,229 @@ +{ + "type": "File", + "start": 0, + "end": 60, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 5, + "column": 1 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 60, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 5, + "column": 1 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ClassDeclaration", + "start": 0, + "end": 60, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 5, + "column": 1 + } + }, + "id": { + "type": "Identifier", + "start": 6, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "name": "A" + }, + "superClass": { + "type": "Identifier", + "start": 16, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 16 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "name": "B" + }, + "body": { + "type": "ClassBody", + "start": 18, + "end": 60, + "loc": { + "start": { + "line": 1, + "column": 18 + }, + "end": { + "line": 5, + "column": 1 + } + }, + "body": [ + { + "type": "MethodDefinition", + "start": 24, + "end": 58, + "loc": { + "start": { + "line": 2, + "column": 4 + }, + "end": { + "line": 4, + "column": 5 + } + }, + "computed": false, + "key": { + "type": "Identifier", + "start": 24, + "end": 25, + "loc": { + "start": { + "line": 2, + "column": 4 + }, + "end": { + "line": 2, + "column": 5 + } + }, + "name": "X" + }, + "static": false, + "kind": "method", + "value": { + "type": "FunctionExpression", + "start": 25, + "end": 58, + "loc": { + "start": { + "line": 2, + "column": 5 + }, + "end": { + "line": 4, + "column": 5 + } + }, + "id": null, + "generator": false, + "expression": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 28, + "end": 58, + "loc": { + "start": { + "line": 2, + "column": 8 + }, + "end": { + "line": 4, + "column": 5 + } + }, + "body": [ + { + "type": "ReturnStatement", + "start": 38, + "end": 52, + "loc": { + "start": { + "line": 3, + "column": 8 + }, + "end": { + "line": 3, + "column": 22 + } + }, + "argument": { + "type": "MemberExpression", + "start": 45, + "end": 52, + "loc": { + "start": { + "line": 3, + "column": 15 + }, + "end": { + "line": 3, + "column": 22 + } + }, + "object": { + "type": "Super", + "start": 45, + "end": 50, + "loc": { + "start": { + "line": 3, + "column": 15 + }, + "end": { + "line": 3, + "column": 20 + } + } + }, + "property": { + "type": "Identifier", + "start": 51, + "end": 52, + "loc": { + "start": { + "line": 3, + "column": 21 + }, + "end": { + "line": 3, + "column": 22 + } + }, + "name": "y" + }, + "computed": false + } + } + ] + } + } + } + ] + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-template-literals/after-switch/actual.js b/test/fixtures/esprima/es2015-template-literals/after-switch/actual.js new file mode 100644 index 0000000000..951b889322 --- /dev/null +++ b/test/fixtures/esprima/es2015-template-literals/after-switch/actual.js @@ -0,0 +1 @@ +switch `test` diff --git a/test/fixtures/esprima/es2015-template-literals/after-switch/options.json b/test/fixtures/esprima/es2015-template-literals/after-switch/options.json new file mode 100644 index 0000000000..167116741e --- /dev/null +++ b/test/fixtures/esprima/es2015-template-literals/after-switch/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Unexpected token (1:7)" +} \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-template-literals/dollar-sign/actual.js b/test/fixtures/esprima/es2015-template-literals/dollar-sign/actual.js new file mode 100644 index 0000000000..ecfd22dd77 --- /dev/null +++ b/test/fixtures/esprima/es2015-template-literals/dollar-sign/actual.js @@ -0,0 +1 @@ +`$` diff --git a/test/fixtures/esprima/es2015-template-literals/dollar-sign/expected.json b/test/fixtures/esprima/es2015-template-literals/dollar-sign/expected.json new file mode 100644 index 0000000000..094ec18811 --- /dev/null +++ b/test/fixtures/esprima/es2015-template-literals/dollar-sign/expected.json @@ -0,0 +1,86 @@ +{ + "type": "File", + "start": 0, + "end": 3, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 3 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 3, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 3 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 3, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 3 + } + }, + "expression": { + "type": "TemplateLiteral", + "start": 0, + "end": 3, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 3 + } + }, + "expressions": [], + "quasis": [ + { + "type": "TemplateElement", + "start": 1, + "end": 2, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 2 + } + }, + "value": { + "raw": "$", + "cooked": "$" + }, + "tail": true + } + ] + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-template-literals/escape-sequences/actual.js b/test/fixtures/esprima/es2015-template-literals/escape-sequences/actual.js new file mode 100644 index 0000000000..2f6bc5fc68 --- /dev/null +++ b/test/fixtures/esprima/es2015-template-literals/escape-sequences/actual.js @@ -0,0 +1 @@ +var source = '`\\n\\r\\b\\v\\t\\f\\\n\\\r\n`'; diff --git a/test/fixtures/esprima/es2015-template-literals/escape-sequences/expected.json b/test/fixtures/esprima/es2015-template-literals/escape-sequences/expected.json new file mode 100644 index 0000000000..0dade7f955 --- /dev/null +++ b/test/fixtures/esprima/es2015-template-literals/escape-sequences/expected.json @@ -0,0 +1,100 @@ +{ + "type": "File", + "start": 0, + "end": 46, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 46 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 46, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 46 + } + }, + "sourceType": "script", + "body": [ + { + "type": "VariableDeclaration", + "start": 0, + "end": 46, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 46 + } + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 4, + "end": 45, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 45 + } + }, + "id": { + "type": "Identifier", + "start": 4, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "name": "source" + }, + "init": { + "type": "Literal", + "start": 13, + "end": 45, + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 1, + "column": 45 + } + }, + "value": "`\\n\\r\\b\\v\\t\\f\\\n\\\r\n`", + "rawValue": "`\\n\\r\\b\\v\\t\\f\\\n\\\r\n`", + "raw": "'`\\\\n\\\\r\\\\b\\\\v\\\\t\\\\f\\\\\\n\\\\\\r\\n`'" + } + } + ], + "kind": "var" + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-template-literals/invalid-escape/actual.js b/test/fixtures/esprima/es2015-template-literals/invalid-escape/actual.js new file mode 100644 index 0000000000..8d9106f9c8 --- /dev/null +++ b/test/fixtures/esprima/es2015-template-literals/invalid-escape/actual.js @@ -0,0 +1 @@ +`\1`; diff --git a/test/fixtures/esprima/es2015-template-literals/invalid-escape/options.json b/test/fixtures/esprima/es2015-template-literals/invalid-escape/options.json new file mode 100644 index 0000000000..857b44ba21 --- /dev/null +++ b/test/fixtures/esprima/es2015-template-literals/invalid-escape/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Octal literal in strict mode (1:1)" +} \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-template-literals/line-terminators/actual.js b/test/fixtures/esprima/es2015-template-literals/line-terminators/actual.js new file mode 100644 index 0000000000..c5468af67d --- /dev/null +++ b/test/fixtures/esprima/es2015-template-literals/line-terminators/actual.js @@ -0,0 +1 @@ +var source = '`\n\r\n`'; diff --git a/test/fixtures/esprima/es2015-template-literals/line-terminators/expected.json b/test/fixtures/esprima/es2015-template-literals/line-terminators/expected.json new file mode 100644 index 0000000000..a2c5419a32 --- /dev/null +++ b/test/fixtures/esprima/es2015-template-literals/line-terminators/expected.json @@ -0,0 +1,100 @@ +{ + "type": "File", + "start": 0, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 24 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 24 + } + }, + "sourceType": "script", + "body": [ + { + "type": "VariableDeclaration", + "start": 0, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 24 + } + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 4, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "id": { + "type": "Identifier", + "start": 4, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "name": "source" + }, + "init": { + "type": "Literal", + "start": 13, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "value": "`\n\r\n`", + "rawValue": "`\n\r\n`", + "raw": "'`\\n\\r\\n`'" + } + } + ], + "kind": "var" + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-template-literals/literal-escape-sequences/actual.js b/test/fixtures/esprima/es2015-template-literals/literal-escape-sequences/actual.js new file mode 100644 index 0000000000..f8f6e9a34e --- /dev/null +++ b/test/fixtures/esprima/es2015-template-literals/literal-escape-sequences/actual.js @@ -0,0 +1 @@ +var source = '`\\u{000042}\\u0042\\x42\\u0\\A\\0`'; diff --git a/test/fixtures/esprima/es2015-template-literals/literal-escape-sequences/expected.json b/test/fixtures/esprima/es2015-template-literals/literal-escape-sequences/expected.json new file mode 100644 index 0000000000..aa36f4ccae --- /dev/null +++ b/test/fixtures/esprima/es2015-template-literals/literal-escape-sequences/expected.json @@ -0,0 +1,100 @@ +{ + "type": "File", + "start": 0, + "end": 51, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 51 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 51, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 51 + } + }, + "sourceType": "script", + "body": [ + { + "type": "VariableDeclaration", + "start": 0, + "end": 51, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 51 + } + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 4, + "end": 50, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 50 + } + }, + "id": { + "type": "Identifier", + "start": 4, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "name": "source" + }, + "init": { + "type": "Literal", + "start": 13, + "end": 50, + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 1, + "column": 50 + } + }, + "value": "`\\u{000042}\\u0042\\x42\\u0\\A\\0`", + "rawValue": "`\\u{000042}\\u0042\\x42\\u0\\A\\0`", + "raw": "'`\\\\u{000042}\\\\u0042\\\\x42\\\\u0\\\\A\\\\0`'" + } + } + ], + "kind": "var" + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-template-literals/new-expression/actual.js b/test/fixtures/esprima/es2015-template-literals/new-expression/actual.js new file mode 100644 index 0000000000..0309ceb6c1 --- /dev/null +++ b/test/fixtures/esprima/es2015-template-literals/new-expression/actual.js @@ -0,0 +1 @@ +new raw`42` diff --git a/test/fixtures/esprima/es2015-template-literals/new-expression/expected.json b/test/fixtures/esprima/es2015-template-literals/new-expression/expected.json new file mode 100644 index 0000000000..08da84c059 --- /dev/null +++ b/test/fixtures/esprima/es2015-template-literals/new-expression/expected.json @@ -0,0 +1,133 @@ +{ + "type": "File", + "start": 0, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "expression": { + "type": "NewExpression", + "start": 0, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "callee": { + "type": "TaggedTemplateExpression", + "start": 4, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "tag": { + "type": "Identifier", + "start": 4, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "name": "raw" + }, + "quasi": { + "type": "TemplateLiteral", + "start": 7, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "expressions": [], + "quasis": [ + { + "type": "TemplateElement", + "start": 8, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "value": { + "raw": "42", + "cooked": "42" + }, + "tail": true + } + ] + } + }, + "arguments": [] + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-template-literals/octal-literal/actual.js b/test/fixtures/esprima/es2015-template-literals/octal-literal/actual.js new file mode 100644 index 0000000000..84db0a12ca --- /dev/null +++ b/test/fixtures/esprima/es2015-template-literals/octal-literal/actual.js @@ -0,0 +1 @@ +`\00`; diff --git a/test/fixtures/esprima/es2015-template-literals/octal-literal/expected.json b/test/fixtures/esprima/es2015-template-literals/octal-literal/expected.json new file mode 100644 index 0000000000..9ebd9cc590 --- /dev/null +++ b/test/fixtures/esprima/es2015-template-literals/octal-literal/expected.json @@ -0,0 +1,86 @@ +{ + "type": "File", + "start": 0, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "expression": { + "type": "TemplateLiteral", + "start": 0, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "expressions": [], + "quasis": [ + { + "type": "TemplateElement", + "start": 1, + "end": 4, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 4 + } + }, + "value": { + "raw": "\\00", + "cooked": "\u0000" + }, + "tail": true + } + ] + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-template-literals/octal-literal/options.json b/test/fixtures/esprima/es2015-template-literals/octal-literal/options.json new file mode 100644 index 0000000000..04b967a2ee --- /dev/null +++ b/test/fixtures/esprima/es2015-template-literals/octal-literal/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Unexpected token (1:1)" +} \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-template-literals/strict-octal-literal/actual.js b/test/fixtures/esprima/es2015-template-literals/strict-octal-literal/actual.js new file mode 100644 index 0000000000..b3c8c9645f --- /dev/null +++ b/test/fixtures/esprima/es2015-template-literals/strict-octal-literal/actual.js @@ -0,0 +1 @@ +'use strict'; `\00`; diff --git a/test/fixtures/esprima/es2015-template-literals/strict-octal-literal/expected.json b/test/fixtures/esprima/es2015-template-literals/strict-octal-literal/expected.json new file mode 100644 index 0000000000..7ffc243c53 --- /dev/null +++ b/test/fixtures/esprima/es2015-template-literals/strict-octal-literal/expected.json @@ -0,0 +1,119 @@ +{ + "type": "File", + "start": 0, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "expression": { + "type": "Literal", + "start": 0, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "value": "use strict", + "rawValue": "use strict", + "raw": "'use strict'" + } + }, + { + "type": "ExpressionStatement", + "start": 14, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 14 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "expression": { + "type": "TemplateLiteral", + "start": 14, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 14 + }, + "end": { + "line": 1, + "column": 19 + } + }, + "expressions": [], + "quasis": [ + { + "type": "TemplateElement", + "start": 15, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "value": { + "raw": "\\00", + "cooked": "\u0000" + }, + "tail": true + } + ] + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-template-literals/strict-octal-literal/options.json b/test/fixtures/esprima/es2015-template-literals/strict-octal-literal/options.json new file mode 100644 index 0000000000..51c483f3d3 --- /dev/null +++ b/test/fixtures/esprima/es2015-template-literals/strict-octal-literal/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Unexpected token (1:14)" +} \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-template-literals/tagged-interpolation/actual.js b/test/fixtures/esprima/es2015-template-literals/tagged-interpolation/actual.js new file mode 100644 index 0000000000..eb544f2df4 --- /dev/null +++ b/test/fixtures/esprima/es2015-template-literals/tagged-interpolation/actual.js @@ -0,0 +1 @@ +raw`hello ${name}` diff --git a/test/fixtures/esprima/es2015-template-literals/tagged-interpolation/expected.json b/test/fixtures/esprima/es2015-template-literals/tagged-interpolation/expected.json new file mode 100644 index 0000000000..1308a48aaa --- /dev/null +++ b/test/fixtures/esprima/es2015-template-literals/tagged-interpolation/expected.json @@ -0,0 +1,154 @@ +{ + "type": "File", + "start": 0, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "expression": { + "type": "TaggedTemplateExpression", + "start": 0, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "tag": { + "type": "Identifier", + "start": 0, + "end": 3, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 3 + } + }, + "name": "raw" + }, + "quasi": { + "type": "TemplateLiteral", + "start": 3, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 3 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "expressions": [ + { + "type": "Identifier", + "start": 12, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 12 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "name": "name" + } + ], + "quasis": [ + { + "type": "TemplateElement", + "start": 4, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "value": { + "raw": "hello ", + "cooked": "hello " + }, + "tail": false + }, + { + "type": "TemplateElement", + "start": 17, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 17 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "value": { + "raw": "", + "cooked": "" + }, + "tail": true + } + ] + } + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-template-literals/tagged-nested-with-object-literal/actual.js b/test/fixtures/esprima/es2015-template-literals/tagged-nested-with-object-literal/actual.js new file mode 100644 index 0000000000..9e7b600b59 --- /dev/null +++ b/test/fixtures/esprima/es2015-template-literals/tagged-nested-with-object-literal/actual.js @@ -0,0 +1 @@ +raw`token ${`nested ${`deeply` + {}} blah`}` diff --git a/test/fixtures/esprima/es2015-template-literals/tagged-nested-with-object-literal/expected.json b/test/fixtures/esprima/es2015-template-literals/tagged-nested-with-object-literal/expected.json new file mode 100644 index 0000000000..dd145facf5 --- /dev/null +++ b/test/fixtures/esprima/es2015-template-literals/tagged-nested-with-object-literal/expected.json @@ -0,0 +1,267 @@ +{ + "type": "File", + "start": 0, + "end": 44, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 44 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 44, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 44 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 44, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 44 + } + }, + "expression": { + "type": "TaggedTemplateExpression", + "start": 0, + "end": 44, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 44 + } + }, + "tag": { + "type": "Identifier", + "start": 0, + "end": 3, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 3 + } + }, + "name": "raw" + }, + "quasi": { + "type": "TemplateLiteral", + "start": 3, + "end": 44, + "loc": { + "start": { + "line": 1, + "column": 3 + }, + "end": { + "line": 1, + "column": 44 + } + }, + "expressions": [ + { + "type": "TemplateLiteral", + "start": 12, + "end": 42, + "loc": { + "start": { + "line": 1, + "column": 12 + }, + "end": { + "line": 1, + "column": 42 + } + }, + "expressions": [ + { + "type": "BinaryExpression", + "start": 22, + "end": 35, + "loc": { + "start": { + "line": 1, + "column": 22 + }, + "end": { + "line": 1, + "column": 35 + } + }, + "left": { + "type": "TemplateLiteral", + "start": 22, + "end": 30, + "loc": { + "start": { + "line": 1, + "column": 22 + }, + "end": { + "line": 1, + "column": 30 + } + }, + "expressions": [], + "quasis": [ + { + "type": "TemplateElement", + "start": 23, + "end": 29, + "loc": { + "start": { + "line": 1, + "column": 23 + }, + "end": { + "line": 1, + "column": 29 + } + }, + "value": { + "raw": "deeply", + "cooked": "deeply" + }, + "tail": true + } + ] + }, + "operator": "+", + "right": { + "type": "ObjectExpression", + "start": 33, + "end": 35, + "loc": { + "start": { + "line": 1, + "column": 33 + }, + "end": { + "line": 1, + "column": 35 + } + }, + "properties": [] + } + } + ], + "quasis": [ + { + "type": "TemplateElement", + "start": 13, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "value": { + "raw": "nested ", + "cooked": "nested " + }, + "tail": false + }, + { + "type": "TemplateElement", + "start": 36, + "end": 41, + "loc": { + "start": { + "line": 1, + "column": 36 + }, + "end": { + "line": 1, + "column": 41 + } + }, + "value": { + "raw": " blah", + "cooked": " blah" + }, + "tail": true + } + ] + } + ], + "quasis": [ + { + "type": "TemplateElement", + "start": 4, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "value": { + "raw": "token ", + "cooked": "token " + }, + "tail": false + }, + { + "type": "TemplateElement", + "start": 43, + "end": 43, + "loc": { + "start": { + "line": 1, + "column": 43 + }, + "end": { + "line": 1, + "column": 43 + } + }, + "value": { + "raw": "", + "cooked": "" + }, + "tail": true + } + ] + } + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-template-literals/tagged/actual.js b/test/fixtures/esprima/es2015-template-literals/tagged/actual.js new file mode 100644 index 0000000000..756b976d06 --- /dev/null +++ b/test/fixtures/esprima/es2015-template-literals/tagged/actual.js @@ -0,0 +1 @@ +raw`42` diff --git a/test/fixtures/esprima/es2015-template-literals/tagged/expected.json b/test/fixtures/esprima/es2015-template-literals/tagged/expected.json new file mode 100644 index 0000000000..3eabcd73c8 --- /dev/null +++ b/test/fixtures/esprima/es2015-template-literals/tagged/expected.json @@ -0,0 +1,117 @@ +{ + "type": "File", + "start": 0, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "expression": { + "type": "TaggedTemplateExpression", + "start": 0, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "tag": { + "type": "Identifier", + "start": 0, + "end": 3, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 3 + } + }, + "name": "raw" + }, + "quasi": { + "type": "TemplateLiteral", + "start": 3, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 3 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "expressions": [], + "quasis": [ + { + "type": "TemplateElement", + "start": 4, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "value": { + "raw": "42", + "cooked": "42" + }, + "tail": true + } + ] + } + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-template-literals/unclosed-interpolation/actual.js b/test/fixtures/esprima/es2015-template-literals/unclosed-interpolation/actual.js new file mode 100644 index 0000000000..1847ed1bd5 --- /dev/null +++ b/test/fixtures/esprima/es2015-template-literals/unclosed-interpolation/actual.js @@ -0,0 +1 @@ +`hello ${10;test` diff --git a/test/fixtures/esprima/es2015-template-literals/unclosed-interpolation/options.json b/test/fixtures/esprima/es2015-template-literals/unclosed-interpolation/options.json new file mode 100644 index 0000000000..3e33f7730f --- /dev/null +++ b/test/fixtures/esprima/es2015-template-literals/unclosed-interpolation/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Unexpected token (1:11)" +} \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-template-literals/unclosed-nested/actual.js b/test/fixtures/esprima/es2015-template-literals/unclosed-nested/actual.js new file mode 100644 index 0000000000..4bcb8f1efd --- /dev/null +++ b/test/fixtures/esprima/es2015-template-literals/unclosed-nested/actual.js @@ -0,0 +1 @@ +`hello ${10 `test` diff --git a/test/fixtures/esprima/es2015-template-literals/unclosed-nested/options.json b/test/fixtures/esprima/es2015-template-literals/unclosed-nested/options.json new file mode 100644 index 0000000000..2a73699bc2 --- /dev/null +++ b/test/fixtures/esprima/es2015-template-literals/unclosed-nested/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Unexpected token (1:18)" +} \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-template-literals/unclosed/actual.js b/test/fixtures/esprima/es2015-template-literals/unclosed/actual.js new file mode 100644 index 0000000000..4885e202ae --- /dev/null +++ b/test/fixtures/esprima/es2015-template-literals/unclosed/actual.js @@ -0,0 +1 @@ +`test diff --git a/test/fixtures/esprima/es2015-template-literals/unclosed/options.json b/test/fixtures/esprima/es2015-template-literals/unclosed/options.json new file mode 100644 index 0000000000..182d155159 --- /dev/null +++ b/test/fixtures/esprima/es2015-template-literals/unclosed/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Unterminated template (1:1)" +} \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-template-literals/untagged/actual.js b/test/fixtures/esprima/es2015-template-literals/untagged/actual.js new file mode 100644 index 0000000000..e1b8fa68e9 --- /dev/null +++ b/test/fixtures/esprima/es2015-template-literals/untagged/actual.js @@ -0,0 +1 @@ +`42` diff --git a/test/fixtures/esprima/es2015-template-literals/untagged/expected.json b/test/fixtures/esprima/es2015-template-literals/untagged/expected.json new file mode 100644 index 0000000000..f0f8b0bf3c --- /dev/null +++ b/test/fixtures/esprima/es2015-template-literals/untagged/expected.json @@ -0,0 +1,86 @@ +{ + "type": "File", + "start": 0, + "end": 4, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 4 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 4, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 4 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 4, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 4 + } + }, + "expression": { + "type": "TemplateLiteral", + "start": 0, + "end": 4, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 4 + } + }, + "expressions": [], + "quasis": [ + { + "type": "TemplateElement", + "start": 1, + "end": 3, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 3 + } + }, + "value": { + "raw": "42", + "cooked": "42" + }, + "tail": true + } + ] + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-unicode-code-point-escape-sequence/migrated_0000/actual.js b/test/fixtures/esprima/es2015-unicode-code-point-escape-sequence/migrated_0000/actual.js new file mode 100644 index 0000000000..1d5ecf6f7c --- /dev/null +++ b/test/fixtures/esprima/es2015-unicode-code-point-escape-sequence/migrated_0000/actual.js @@ -0,0 +1 @@ +var source = '"\\u{714E}\\u{8336}"'; diff --git a/test/fixtures/esprima/es2015-unicode-code-point-escape-sequence/migrated_0000/expected.json b/test/fixtures/esprima/es2015-unicode-code-point-escape-sequence/migrated_0000/expected.json new file mode 100644 index 0000000000..8572ac41d4 --- /dev/null +++ b/test/fixtures/esprima/es2015-unicode-code-point-escape-sequence/migrated_0000/expected.json @@ -0,0 +1,100 @@ +{ + "type": "File", + "start": 0, + "end": 36, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 36 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 36, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 36 + } + }, + "sourceType": "script", + "body": [ + { + "type": "VariableDeclaration", + "start": 0, + "end": 36, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 36 + } + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 4, + "end": 35, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 35 + } + }, + "id": { + "type": "Identifier", + "start": 4, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "name": "source" + }, + "init": { + "type": "Literal", + "start": 13, + "end": 35, + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 1, + "column": 35 + } + }, + "value": "\"\\u{714E}\\u{8336}\"", + "rawValue": "\"\\u{714E}\\u{8336}\"", + "raw": "'\"\\\\u{714E}\\\\u{8336}\"'" + } + } + ], + "kind": "var" + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-unicode-code-point-escape-sequence/migrated_0001/actual.js b/test/fixtures/esprima/es2015-unicode-code-point-escape-sequence/migrated_0001/actual.js new file mode 100644 index 0000000000..fd2a94179a --- /dev/null +++ b/test/fixtures/esprima/es2015-unicode-code-point-escape-sequence/migrated_0001/actual.js @@ -0,0 +1 @@ +var source = '"\\u{20BB7}\\u{91CE}\\u{5BB6}"'; diff --git a/test/fixtures/esprima/es2015-unicode-code-point-escape-sequence/migrated_0001/expected.json b/test/fixtures/esprima/es2015-unicode-code-point-escape-sequence/migrated_0001/expected.json new file mode 100644 index 0000000000..0192886854 --- /dev/null +++ b/test/fixtures/esprima/es2015-unicode-code-point-escape-sequence/migrated_0001/expected.json @@ -0,0 +1,100 @@ +{ + "type": "File", + "start": 0, + "end": 46, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 46 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 46, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 46 + } + }, + "sourceType": "script", + "body": [ + { + "type": "VariableDeclaration", + "start": 0, + "end": 46, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 46 + } + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 4, + "end": 45, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 45 + } + }, + "id": { + "type": "Identifier", + "start": 4, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "name": "source" + }, + "init": { + "type": "Literal", + "start": 13, + "end": 45, + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 1, + "column": 45 + } + }, + "value": "\"\\u{20BB7}\\u{91CE}\\u{5BB6}\"", + "rawValue": "\"\\u{20BB7}\\u{91CE}\\u{5BB6}\"", + "raw": "'\"\\\\u{20BB7}\\\\u{91CE}\\\\u{5BB6}\"'" + } + } + ], + "kind": "var" + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-unicode-code-point-escape-sequence/migrated_0002/actual.js b/test/fixtures/esprima/es2015-unicode-code-point-escape-sequence/migrated_0002/actual.js new file mode 100644 index 0000000000..582b9f3ab9 --- /dev/null +++ b/test/fixtures/esprima/es2015-unicode-code-point-escape-sequence/migrated_0002/actual.js @@ -0,0 +1 @@ +var source = '"\\u{00000000034}"'; diff --git a/test/fixtures/esprima/es2015-unicode-code-point-escape-sequence/migrated_0002/expected.json b/test/fixtures/esprima/es2015-unicode-code-point-escape-sequence/migrated_0002/expected.json new file mode 100644 index 0000000000..965abbf51a --- /dev/null +++ b/test/fixtures/esprima/es2015-unicode-code-point-escape-sequence/migrated_0002/expected.json @@ -0,0 +1,100 @@ +{ + "type": "File", + "start": 0, + "end": 34, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 34 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 34, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 34 + } + }, + "sourceType": "script", + "body": [ + { + "type": "VariableDeclaration", + "start": 0, + "end": 34, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 34 + } + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 4, + "end": 33, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 33 + } + }, + "id": { + "type": "Identifier", + "start": 4, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "name": "source" + }, + "init": { + "type": "Literal", + "start": 13, + "end": 33, + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 1, + "column": 33 + } + }, + "value": "\"\\u{00000000034}\"", + "rawValue": "\"\\u{00000000034}\"", + "raw": "'\"\\\\u{00000000034}\"'" + } + } + ], + "kind": "var" + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-yield/invalid-yield-binding-property/actual.js b/test/fixtures/esprima/es2015-yield/invalid-yield-binding-property/actual.js new file mode 100644 index 0000000000..e6d7b0640a --- /dev/null +++ b/test/fixtures/esprima/es2015-yield/invalid-yield-binding-property/actual.js @@ -0,0 +1 @@ +var {x: y = yield 3} = z; diff --git a/test/fixtures/esprima/es2015-yield/invalid-yield-binding-property/options.json b/test/fixtures/esprima/es2015-yield/invalid-yield-binding-property/options.json new file mode 100644 index 0000000000..2a73699bc2 --- /dev/null +++ b/test/fixtures/esprima/es2015-yield/invalid-yield-binding-property/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Unexpected token (1:18)" +} \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-yield/invalid-yield-expression/actual.js b/test/fixtures/esprima/es2015-yield/invalid-yield-expression/actual.js new file mode 100644 index 0000000000..e88270d51d --- /dev/null +++ b/test/fixtures/esprima/es2015-yield/invalid-yield-expression/actual.js @@ -0,0 +1 @@ +(function() { yield 3; }) diff --git a/test/fixtures/esprima/es2015-yield/invalid-yield-expression/options.json b/test/fixtures/esprima/es2015-yield/invalid-yield-expression/options.json new file mode 100644 index 0000000000..aca079ee39 --- /dev/null +++ b/test/fixtures/esprima/es2015-yield/invalid-yield-expression/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Unexpected token (1:20)" +} \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-yield/invalid-yield-generator-arrow-default/actual.js b/test/fixtures/esprima/es2015-yield/invalid-yield-generator-arrow-default/actual.js new file mode 100644 index 0000000000..88b9947a8a --- /dev/null +++ b/test/fixtures/esprima/es2015-yield/invalid-yield-generator-arrow-default/actual.js @@ -0,0 +1 @@ +function* g() { (x = yield 42) => {} } diff --git a/test/fixtures/esprima/es2015-yield/invalid-yield-generator-arrow-default/expected.json b/test/fixtures/esprima/es2015-yield/invalid-yield-generator-arrow-default/expected.json new file mode 100644 index 0000000000..dd6a552b65 --- /dev/null +++ b/test/fixtures/esprima/es2015-yield/invalid-yield-generator-arrow-default/expected.json @@ -0,0 +1,200 @@ +{ + "type": "File", + "start": 0, + "end": 38, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 38 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 38, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 38 + } + }, + "sourceType": "script", + "body": [ + { + "type": "FunctionDeclaration", + "start": 0, + "end": 38, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 38 + } + }, + "id": { + "type": "Identifier", + "start": 10, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "name": "g" + }, + "generator": true, + "expression": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 14, + "end": 38, + "loc": { + "start": { + "line": 1, + "column": 14 + }, + "end": { + "line": 1, + "column": 38 + } + }, + "body": [ + { + "type": "ExpressionStatement", + "start": 16, + "end": 36, + "loc": { + "start": { + "line": 1, + "column": 16 + }, + "end": { + "line": 1, + "column": 36 + } + }, + "expression": { + "type": "ArrowFunctionExpression", + "start": 16, + "end": 36, + "loc": { + "start": { + "line": 1, + "column": 16 + }, + "end": { + "line": 1, + "column": 36 + } + }, + "id": null, + "generator": false, + "expression": false, + "params": [ + { + "type": "AssignmentPattern", + "start": 17, + "end": 29, + "loc": { + "start": { + "line": 1, + "column": 17 + }, + "end": { + "line": 1, + "column": 29 + } + }, + "left": { + "type": "Identifier", + "start": 17, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 17 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "name": "x" + }, + "right": { + "type": "YieldExpression", + "start": 21, + "end": 29, + "loc": { + "start": { + "line": 1, + "column": 21 + }, + "end": { + "line": 1, + "column": 29 + } + }, + "delegate": false, + "argument": { + "type": "Literal", + "start": 27, + "end": 29, + "loc": { + "start": { + "line": 1, + "column": 27 + }, + "end": { + "line": 1, + "column": 29 + } + }, + "value": 42, + "rawValue": 42, + "raw": "42" + } + } + } + ], + "body": { + "type": "BlockStatement", + "start": 34, + "end": 36, + "loc": { + "start": { + "line": 1, + "column": 34 + }, + "end": { + "line": 1, + "column": 36 + } + }, + "body": [] + } + } + } + ] + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-yield/invalid-yield-generator-arrow-default/options.json b/test/fixtures/esprima/es2015-yield/invalid-yield-generator-arrow-default/options.json new file mode 100644 index 0000000000..cbc444ce90 --- /dev/null +++ b/test/fixtures/esprima/es2015-yield/invalid-yield-generator-arrow-default/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Unexpected token (1:32)" +} \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-yield/invalid-yield-generator-arrow-parameter/actual.js b/test/fixtures/esprima/es2015-yield/invalid-yield-generator-arrow-parameter/actual.js new file mode 100644 index 0000000000..974d4e4b49 --- /dev/null +++ b/test/fixtures/esprima/es2015-yield/invalid-yield-generator-arrow-parameter/actual.js @@ -0,0 +1 @@ +function *g(){ (yield) => 42 } diff --git a/test/fixtures/esprima/es2015-yield/invalid-yield-generator-arrow-parameter/options.json b/test/fixtures/esprima/es2015-yield/invalid-yield-generator-arrow-parameter/options.json new file mode 100644 index 0000000000..b7fab4d126 --- /dev/null +++ b/test/fixtures/esprima/es2015-yield/invalid-yield-generator-arrow-parameter/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Assigning to rvalue (1:16)" +} \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-yield/invalid-yield-generator-arrow-parameters/actual.js b/test/fixtures/esprima/es2015-yield/invalid-yield-generator-arrow-parameters/actual.js new file mode 100644 index 0000000000..e9aafb3633 --- /dev/null +++ b/test/fixtures/esprima/es2015-yield/invalid-yield-generator-arrow-parameters/actual.js @@ -0,0 +1 @@ +function *g(){ (a, b, c, yield) => 42 } diff --git a/test/fixtures/esprima/es2015-yield/invalid-yield-generator-arrow-parameters/options.json b/test/fixtures/esprima/es2015-yield/invalid-yield-generator-arrow-parameters/options.json new file mode 100644 index 0000000000..b38eacd757 --- /dev/null +++ b/test/fixtures/esprima/es2015-yield/invalid-yield-generator-arrow-parameters/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Assigning to rvalue (1:25)" +} \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-yield/invalid-yield-generator-catch/actual.js b/test/fixtures/esprima/es2015-yield/invalid-yield-generator-catch/actual.js new file mode 100644 index 0000000000..f2891b80cd --- /dev/null +++ b/test/fixtures/esprima/es2015-yield/invalid-yield-generator-catch/actual.js @@ -0,0 +1 @@ +function *g() { try {} catch (yield) {} } diff --git a/test/fixtures/esprima/es2015-yield/invalid-yield-generator-catch/expected.json b/test/fixtures/esprima/es2015-yield/invalid-yield-generator-catch/expected.json new file mode 100644 index 0000000000..53cf8c221f --- /dev/null +++ b/test/fixtures/esprima/es2015-yield/invalid-yield-generator-catch/expected.json @@ -0,0 +1,164 @@ +{ + "type": "File", + "start": 0, + "end": 41, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 41 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 41, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 41 + } + }, + "sourceType": "script", + "body": [ + { + "type": "FunctionDeclaration", + "start": 0, + "end": 41, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 41 + } + }, + "id": { + "type": "Identifier", + "start": 10, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "name": "g" + }, + "generator": true, + "expression": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 14, + "end": 41, + "loc": { + "start": { + "line": 1, + "column": 14 + }, + "end": { + "line": 1, + "column": 41 + } + }, + "body": [ + { + "type": "TryStatement", + "start": 16, + "end": 39, + "loc": { + "start": { + "line": 1, + "column": 16 + }, + "end": { + "line": 1, + "column": 39 + } + }, + "block": { + "type": "BlockStatement", + "start": 20, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 20 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "body": [] + }, + "handler": { + "type": "CatchClause", + "start": 23, + "end": 39, + "loc": { + "start": { + "line": 1, + "column": 23 + }, + "end": { + "line": 1, + "column": 39 + } + }, + "param": { + "type": "Identifier", + "start": 30, + "end": 35, + "loc": { + "start": { + "line": 1, + "column": 30 + }, + "end": { + "line": 1, + "column": 35 + } + }, + "name": "yield" + }, + "body": { + "type": "BlockStatement", + "start": 37, + "end": 39, + "loc": { + "start": { + "line": 1, + "column": 37 + }, + "end": { + "line": 1, + "column": 39 + } + }, + "body": [] + } + }, + "guardedHandlers": [], + "finalizer": null + } + ] + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-yield/invalid-yield-generator-catch/options.json b/test/fixtures/esprima/es2015-yield/invalid-yield-generator-catch/options.json new file mode 100644 index 0000000000..7b7329bb7e --- /dev/null +++ b/test/fixtures/esprima/es2015-yield/invalid-yield-generator-catch/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Unexpected token (1:30)" +} \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-yield/invalid-yield-generator-declaration/actual.js b/test/fixtures/esprima/es2015-yield/invalid-yield-generator-declaration/actual.js new file mode 100644 index 0000000000..8093fc9b88 --- /dev/null +++ b/test/fixtures/esprima/es2015-yield/invalid-yield-generator-declaration/actual.js @@ -0,0 +1 @@ +function *g() { function *yield(){} } diff --git a/test/fixtures/esprima/es2015-yield/invalid-yield-generator-declaration/options.json b/test/fixtures/esprima/es2015-yield/invalid-yield-generator-declaration/options.json new file mode 100644 index 0000000000..00b62a33f8 --- /dev/null +++ b/test/fixtures/esprima/es2015-yield/invalid-yield-generator-declaration/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Unexpected token (1:26)" +} \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-yield/invalid-yield-generator-export-default/actual.js b/test/fixtures/esprima/es2015-yield/invalid-yield-generator-export-default/actual.js new file mode 100644 index 0000000000..e925fcfee9 --- /dev/null +++ b/test/fixtures/esprima/es2015-yield/invalid-yield-generator-export-default/actual.js @@ -0,0 +1 @@ +export default function *yield() {} diff --git a/test/fixtures/esprima/es2015-yield/invalid-yield-generator-export-default/options.json b/test/fixtures/esprima/es2015-yield/invalid-yield-generator-export-default/options.json new file mode 100644 index 0000000000..53ee186d1b --- /dev/null +++ b/test/fixtures/esprima/es2015-yield/invalid-yield-generator-export-default/options.json @@ -0,0 +1,3 @@ +{ + "throws": "'import' and 'export' may appear only with 'sourceType: module' (1:0)" +} \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-yield/invalid-yield-generator-expression-name/actual.js b/test/fixtures/esprima/es2015-yield/invalid-yield-generator-expression-name/actual.js new file mode 100644 index 0000000000..0fdfd886f2 --- /dev/null +++ b/test/fixtures/esprima/es2015-yield/invalid-yield-generator-expression-name/actual.js @@ -0,0 +1 @@ +(function*yield(){}) diff --git a/test/fixtures/esprima/es2015-yield/invalid-yield-generator-expression-name/expected.json b/test/fixtures/esprima/es2015-yield/invalid-yield-generator-expression-name/expected.json new file mode 100644 index 0000000000..608a26d547 --- /dev/null +++ b/test/fixtures/esprima/es2015-yield/invalid-yield-generator-expression-name/expected.json @@ -0,0 +1,99 @@ +{ + "type": "File", + "start": 0, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "expression": { + "type": "FunctionExpression", + "start": 1, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 19 + } + }, + "id": { + "type": "Identifier", + "start": 10, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "name": "yield" + }, + "generator": true, + "expression": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 17, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 17 + }, + "end": { + "line": 1, + "column": 19 + } + }, + "body": [] + }, + "parenthesizedExpression": true + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-yield/invalid-yield-generator-expression-name/options.json b/test/fixtures/esprima/es2015-yield/invalid-yield-generator-expression-name/options.json new file mode 100644 index 0000000000..328b1ddde8 --- /dev/null +++ b/test/fixtures/esprima/es2015-yield/invalid-yield-generator-expression-name/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Unexpected token (1:10)" +} \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-yield/invalid-yield-generator-expression-parameter/actual.js b/test/fixtures/esprima/es2015-yield/invalid-yield-generator-expression-parameter/actual.js new file mode 100644 index 0000000000..d36903158a --- /dev/null +++ b/test/fixtures/esprima/es2015-yield/invalid-yield-generator-expression-parameter/actual.js @@ -0,0 +1 @@ +(function *(yield){}) diff --git a/test/fixtures/esprima/es2015-yield/invalid-yield-generator-expression-parameter/expected.json b/test/fixtures/esprima/es2015-yield/invalid-yield-generator-expression-parameter/expected.json new file mode 100644 index 0000000000..df826e036e --- /dev/null +++ b/test/fixtures/esprima/es2015-yield/invalid-yield-generator-expression-parameter/expected.json @@ -0,0 +1,101 @@ +{ + "type": "File", + "start": 0, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 21 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 21 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 21 + } + }, + "expression": { + "type": "FunctionExpression", + "start": 1, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "id": null, + "generator": true, + "expression": false, + "params": [ + { + "type": "Identifier", + "start": 12, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 12 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "name": "yield" + } + ], + "body": { + "type": "BlockStatement", + "start": 18, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 18 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "body": [] + }, + "parenthesizedExpression": true + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-yield/invalid-yield-generator-expression-parameter/options.json b/test/fixtures/esprima/es2015-yield/invalid-yield-generator-expression-parameter/options.json new file mode 100644 index 0000000000..358068a16a --- /dev/null +++ b/test/fixtures/esprima/es2015-yield/invalid-yield-generator-expression-parameter/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Unexpected token (1:12)" +} \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-yield/invalid-yield-generator-expression-rest/actual.js b/test/fixtures/esprima/es2015-yield/invalid-yield-generator-expression-rest/actual.js new file mode 100644 index 0000000000..1982701745 --- /dev/null +++ b/test/fixtures/esprima/es2015-yield/invalid-yield-generator-expression-rest/actual.js @@ -0,0 +1 @@ +(function *(x, ...yield){}) diff --git a/test/fixtures/esprima/es2015-yield/invalid-yield-generator-expression-rest/expected.json b/test/fixtures/esprima/es2015-yield/invalid-yield-generator-expression-rest/expected.json new file mode 100644 index 0000000000..e99f09b954 --- /dev/null +++ b/test/fixtures/esprima/es2015-yield/invalid-yield-generator-expression-rest/expected.json @@ -0,0 +1,132 @@ +{ + "type": "File", + "start": 0, + "end": 27, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 27 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 27, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 27 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 27, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 27 + } + }, + "expression": { + "type": "FunctionExpression", + "start": 1, + "end": 26, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 26 + } + }, + "id": null, + "generator": true, + "expression": false, + "params": [ + { + "type": "Identifier", + "start": 12, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 12 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "name": "x" + }, + { + "type": "RestElement", + "start": 15, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "argument": { + "type": "Identifier", + "start": 18, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 18 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "name": "yield" + } + } + ], + "body": { + "type": "BlockStatement", + "start": 24, + "end": 26, + "loc": { + "start": { + "line": 1, + "column": 24 + }, + "end": { + "line": 1, + "column": 26 + } + }, + "body": [] + }, + "parenthesizedExpression": true + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-yield/invalid-yield-generator-expression-rest/options.json b/test/fixtures/esprima/es2015-yield/invalid-yield-generator-expression-rest/options.json new file mode 100644 index 0000000000..2a73699bc2 --- /dev/null +++ b/test/fixtures/esprima/es2015-yield/invalid-yield-generator-expression-rest/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Unexpected token (1:18)" +} \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-yield/invalid-yield-generator-function-declaration/actual.js b/test/fixtures/esprima/es2015-yield/invalid-yield-generator-function-declaration/actual.js new file mode 100644 index 0000000000..45ef943364 --- /dev/null +++ b/test/fixtures/esprima/es2015-yield/invalid-yield-generator-function-declaration/actual.js @@ -0,0 +1 @@ +function *g() { function yield() {} } diff --git a/test/fixtures/esprima/es2015-yield/invalid-yield-generator-function-declaration/options.json b/test/fixtures/esprima/es2015-yield/invalid-yield-generator-function-declaration/options.json new file mode 100644 index 0000000000..b242442b4c --- /dev/null +++ b/test/fixtures/esprima/es2015-yield/invalid-yield-generator-function-declaration/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Unexpected token (1:25)" +} \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-yield/invalid-yield-generator-lexical-declaration/actual.js b/test/fixtures/esprima/es2015-yield/invalid-yield-generator-lexical-declaration/actual.js new file mode 100644 index 0000000000..c977c7c980 --- /dev/null +++ b/test/fixtures/esprima/es2015-yield/invalid-yield-generator-lexical-declaration/actual.js @@ -0,0 +1 @@ +function *g() { let yield; } diff --git a/test/fixtures/esprima/es2015-yield/invalid-yield-generator-lexical-declaration/options.json b/test/fixtures/esprima/es2015-yield/invalid-yield-generator-lexical-declaration/options.json new file mode 100644 index 0000000000..aca079ee39 --- /dev/null +++ b/test/fixtures/esprima/es2015-yield/invalid-yield-generator-lexical-declaration/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Unexpected token (1:20)" +} \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-yield/invalid-yield-generator-member-expression/actual.js b/test/fixtures/esprima/es2015-yield/invalid-yield-generator-member-expression/actual.js new file mode 100644 index 0000000000..6d4eb10367 --- /dev/null +++ b/test/fixtures/esprima/es2015-yield/invalid-yield-generator-member-expression/actual.js @@ -0,0 +1 @@ +function *g() { return yield.x; } diff --git a/test/fixtures/esprima/es2015-yield/invalid-yield-generator-member-expression/options.json b/test/fixtures/esprima/es2015-yield/invalid-yield-generator-member-expression/options.json new file mode 100644 index 0000000000..f55830c1c3 --- /dev/null +++ b/test/fixtures/esprima/es2015-yield/invalid-yield-generator-member-expression/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Unexpected token (1:28)" +} \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-yield/invalid-yield-generator-parameter/actual.js b/test/fixtures/esprima/es2015-yield/invalid-yield-generator-parameter/actual.js new file mode 100644 index 0000000000..572f574f1f --- /dev/null +++ b/test/fixtures/esprima/es2015-yield/invalid-yield-generator-parameter/actual.js @@ -0,0 +1 @@ +function *g(yield){} diff --git a/test/fixtures/esprima/es2015-yield/invalid-yield-generator-parameter/expected.json b/test/fixtures/esprima/es2015-yield/invalid-yield-generator-parameter/expected.json new file mode 100644 index 0000000000..a5588e4e19 --- /dev/null +++ b/test/fixtures/esprima/es2015-yield/invalid-yield-generator-parameter/expected.json @@ -0,0 +1,100 @@ +{ + "type": "File", + "start": 0, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "sourceType": "script", + "body": [ + { + "type": "FunctionDeclaration", + "start": 0, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "id": { + "type": "Identifier", + "start": 10, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "name": "g" + }, + "generator": true, + "expression": false, + "params": [ + { + "type": "Identifier", + "start": 12, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 12 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "name": "yield" + } + ], + "body": { + "type": "BlockStatement", + "start": 18, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 18 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "body": [] + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-yield/invalid-yield-generator-parameter/options.json b/test/fixtures/esprima/es2015-yield/invalid-yield-generator-parameter/options.json new file mode 100644 index 0000000000..358068a16a --- /dev/null +++ b/test/fixtures/esprima/es2015-yield/invalid-yield-generator-parameter/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Unexpected token (1:12)" +} \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-yield/invalid-yield-generator-rest/actual.js b/test/fixtures/esprima/es2015-yield/invalid-yield-generator-rest/actual.js new file mode 100644 index 0000000000..7a23544ebd --- /dev/null +++ b/test/fixtures/esprima/es2015-yield/invalid-yield-generator-rest/actual.js @@ -0,0 +1 @@ +function *g(a, b, c, ...yield){} diff --git a/test/fixtures/esprima/es2015-yield/invalid-yield-generator-rest/expected.json b/test/fixtures/esprima/es2015-yield/invalid-yield-generator-rest/expected.json new file mode 100644 index 0000000000..eb042938fb --- /dev/null +++ b/test/fixtures/esprima/es2015-yield/invalid-yield-generator-rest/expected.json @@ -0,0 +1,163 @@ +{ + "type": "File", + "start": 0, + "end": 32, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 32 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 32, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 32 + } + }, + "sourceType": "script", + "body": [ + { + "type": "FunctionDeclaration", + "start": 0, + "end": 32, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 32 + } + }, + "id": { + "type": "Identifier", + "start": 10, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "name": "g" + }, + "generator": true, + "expression": false, + "params": [ + { + "type": "Identifier", + "start": 12, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 12 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "name": "a" + }, + { + "type": "Identifier", + "start": 15, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "name": "b" + }, + { + "type": "Identifier", + "start": 18, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 18 + }, + "end": { + "line": 1, + "column": 19 + } + }, + "name": "c" + }, + { + "type": "RestElement", + "start": 21, + "end": 29, + "loc": { + "start": { + "line": 1, + "column": 21 + }, + "end": { + "line": 1, + "column": 29 + } + }, + "argument": { + "type": "Identifier", + "start": 24, + "end": 29, + "loc": { + "start": { + "line": 1, + "column": 24 + }, + "end": { + "line": 1, + "column": 29 + } + }, + "name": "yield" + } + } + ], + "body": { + "type": "BlockStatement", + "start": 30, + "end": 32, + "loc": { + "start": { + "line": 1, + "column": 30 + }, + "end": { + "line": 1, + "column": 32 + } + }, + "body": [] + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-yield/invalid-yield-generator-rest/options.json b/test/fixtures/esprima/es2015-yield/invalid-yield-generator-rest/options.json new file mode 100644 index 0000000000..0c5f4deed6 --- /dev/null +++ b/test/fixtures/esprima/es2015-yield/invalid-yield-generator-rest/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Unexpected token (1:24)" +} \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-yield/invalid-yield-generator-strict-function-expression/actual.js b/test/fixtures/esprima/es2015-yield/invalid-yield-generator-strict-function-expression/actual.js new file mode 100644 index 0000000000..980df04f8d --- /dev/null +++ b/test/fixtures/esprima/es2015-yield/invalid-yield-generator-strict-function-expression/actual.js @@ -0,0 +1 @@ +"use strict"; function *g(){ var y = function yield(){}; } diff --git a/test/fixtures/esprima/es2015-yield/invalid-yield-generator-strict-function-expression/options.json b/test/fixtures/esprima/es2015-yield/invalid-yield-generator-strict-function-expression/options.json new file mode 100644 index 0000000000..d34690fa60 --- /dev/null +++ b/test/fixtures/esprima/es2015-yield/invalid-yield-generator-strict-function-expression/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Unexpected token (1:46)" +} \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-yield/invalid-yield-generator-strict-function-parameter/actual.js b/test/fixtures/esprima/es2015-yield/invalid-yield-generator-strict-function-parameter/actual.js new file mode 100644 index 0000000000..ed19c76d04 --- /dev/null +++ b/test/fixtures/esprima/es2015-yield/invalid-yield-generator-strict-function-parameter/actual.js @@ -0,0 +1 @@ +"use strict"; function *g() { var z = function(yield) {} } diff --git a/test/fixtures/esprima/es2015-yield/invalid-yield-generator-strict-function-parameter/options.json b/test/fixtures/esprima/es2015-yield/invalid-yield-generator-strict-function-parameter/options.json new file mode 100644 index 0000000000..c9ba88af97 --- /dev/null +++ b/test/fixtures/esprima/es2015-yield/invalid-yield-generator-strict-function-parameter/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Unexpected token (1:47)" +} \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-yield/invalid-yield-generator-variable-declaration/actual.js b/test/fixtures/esprima/es2015-yield/invalid-yield-generator-variable-declaration/actual.js new file mode 100644 index 0000000000..786e859b64 --- /dev/null +++ b/test/fixtures/esprima/es2015-yield/invalid-yield-generator-variable-declaration/actual.js @@ -0,0 +1 @@ +function *g() { var yield; } diff --git a/test/fixtures/esprima/es2015-yield/invalid-yield-generator-variable-declaration/expected.json b/test/fixtures/esprima/es2015-yield/invalid-yield-generator-variable-declaration/expected.json new file mode 100644 index 0000000000..a4876b5487 --- /dev/null +++ b/test/fixtures/esprima/es2015-yield/invalid-yield-generator-variable-declaration/expected.json @@ -0,0 +1,134 @@ +{ + "type": "File", + "start": 0, + "end": 28, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 28 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 28, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 28 + } + }, + "sourceType": "script", + "body": [ + { + "type": "FunctionDeclaration", + "start": 0, + "end": 28, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 28 + } + }, + "id": { + "type": "Identifier", + "start": 10, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "name": "g" + }, + "generator": true, + "expression": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 14, + "end": 28, + "loc": { + "start": { + "line": 1, + "column": 14 + }, + "end": { + "line": 1, + "column": 28 + } + }, + "body": [ + { + "type": "VariableDeclaration", + "start": 16, + "end": 26, + "loc": { + "start": { + "line": 1, + "column": 16 + }, + "end": { + "line": 1, + "column": 26 + } + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 20, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 20 + }, + "end": { + "line": 1, + "column": 25 + } + }, + "id": { + "type": "Identifier", + "start": 20, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 20 + }, + "end": { + "line": 1, + "column": 25 + } + }, + "name": "yield" + }, + "init": null + } + ], + "kind": "var" + } + ] + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-yield/invalid-yield-generator-variable-declaration/options.json b/test/fixtures/esprima/es2015-yield/invalid-yield-generator-variable-declaration/options.json new file mode 100644 index 0000000000..aca079ee39 --- /dev/null +++ b/test/fixtures/esprima/es2015-yield/invalid-yield-generator-variable-declaration/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Unexpected token (1:20)" +} \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-yield/invalid-yield-strict-array-pattern/actual.js b/test/fixtures/esprima/es2015-yield/invalid-yield-strict-array-pattern/actual.js new file mode 100644 index 0000000000..71fa5c54c7 --- /dev/null +++ b/test/fixtures/esprima/es2015-yield/invalid-yield-strict-array-pattern/actual.js @@ -0,0 +1 @@ +"use strict"; ([yield] = x) diff --git a/test/fixtures/esprima/es2015-yield/invalid-yield-strict-array-pattern/options.json b/test/fixtures/esprima/es2015-yield/invalid-yield-strict-array-pattern/options.json new file mode 100644 index 0000000000..8fee4a64fa --- /dev/null +++ b/test/fixtures/esprima/es2015-yield/invalid-yield-strict-array-pattern/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Assigning to yield in strict mode (1:16)" +} \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-yield/invalid-yield-strict-arrow-parameter-default/actual.js b/test/fixtures/esprima/es2015-yield/invalid-yield-strict-arrow-parameter-default/actual.js new file mode 100644 index 0000000000..f1e4209b9b --- /dev/null +++ b/test/fixtures/esprima/es2015-yield/invalid-yield-strict-arrow-parameter-default/actual.js @@ -0,0 +1 @@ +"use strict"; (x = yield) => {} diff --git a/test/fixtures/esprima/es2015-yield/invalid-yield-strict-arrow-parameter-default/expected.json b/test/fixtures/esprima/es2015-yield/invalid-yield-strict-arrow-parameter-default/expected.json new file mode 100644 index 0000000000..cab8ff9322 --- /dev/null +++ b/test/fixtures/esprima/es2015-yield/invalid-yield-strict-arrow-parameter-default/expected.json @@ -0,0 +1,164 @@ +{ + "type": "File", + "start": 0, + "end": 31, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 31 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 31, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 31 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "expression": { + "type": "Literal", + "start": 0, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "value": "use strict", + "rawValue": "use strict", + "raw": "\"use strict\"" + } + }, + { + "type": "ExpressionStatement", + "start": 14, + "end": 31, + "loc": { + "start": { + "line": 1, + "column": 14 + }, + "end": { + "line": 1, + "column": 31 + } + }, + "expression": { + "type": "ArrowFunctionExpression", + "start": 14, + "end": 31, + "loc": { + "start": { + "line": 1, + "column": 14 + }, + "end": { + "line": 1, + "column": 31 + } + }, + "id": null, + "generator": false, + "expression": false, + "params": [ + { + "type": "AssignmentPattern", + "start": 15, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 24 + } + }, + "left": { + "type": "Identifier", + "start": 15, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "name": "x" + }, + "right": { + "type": "Identifier", + "start": 19, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 19 + }, + "end": { + "line": 1, + "column": 24 + } + }, + "name": "yield" + } + } + ], + "body": { + "type": "BlockStatement", + "start": 29, + "end": 31, + "loc": { + "start": { + "line": 1, + "column": 29 + }, + "end": { + "line": 1, + "column": 31 + } + }, + "body": [] + } + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-yield/invalid-yield-strict-arrow-parameter-default/options.json b/test/fixtures/esprima/es2015-yield/invalid-yield-strict-arrow-parameter-default/options.json new file mode 100644 index 0000000000..aca079ee39 --- /dev/null +++ b/test/fixtures/esprima/es2015-yield/invalid-yield-strict-arrow-parameter-default/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Unexpected token (1:20)" +} \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-yield/invalid-yield-strict-arrow-parameter-name/actual.js b/test/fixtures/esprima/es2015-yield/invalid-yield-strict-arrow-parameter-name/actual.js new file mode 100644 index 0000000000..f24afff7d9 --- /dev/null +++ b/test/fixtures/esprima/es2015-yield/invalid-yield-strict-arrow-parameter-name/actual.js @@ -0,0 +1 @@ +"use strict"; (yield) => 42 diff --git a/test/fixtures/esprima/es2015-yield/invalid-yield-strict-arrow-parameter-name/options.json b/test/fixtures/esprima/es2015-yield/invalid-yield-strict-arrow-parameter-name/options.json new file mode 100644 index 0000000000..c72d3f77b2 --- /dev/null +++ b/test/fixtures/esprima/es2015-yield/invalid-yield-strict-arrow-parameter-name/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Binding yield in strict mode (1:15)" +} \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-yield/invalid-yield-strict-binding-element/actual.js b/test/fixtures/esprima/es2015-yield/invalid-yield-strict-binding-element/actual.js new file mode 100644 index 0000000000..f2d5c1f89b --- /dev/null +++ b/test/fixtures/esprima/es2015-yield/invalid-yield-strict-binding-element/actual.js @@ -0,0 +1 @@ +"use strict"; var { x: yield } = foo; diff --git a/test/fixtures/esprima/es2015-yield/invalid-yield-strict-binding-element/options.json b/test/fixtures/esprima/es2015-yield/invalid-yield-strict-binding-element/options.json new file mode 100644 index 0000000000..2ddc9e708f --- /dev/null +++ b/test/fixtures/esprima/es2015-yield/invalid-yield-strict-binding-element/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Unexpected token (1:23)" +} \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-yield/invalid-yield-strict-catch-parameter/actual.js b/test/fixtures/esprima/es2015-yield/invalid-yield-strict-catch-parameter/actual.js new file mode 100644 index 0000000000..f7734c9a28 --- /dev/null +++ b/test/fixtures/esprima/es2015-yield/invalid-yield-strict-catch-parameter/actual.js @@ -0,0 +1 @@ +"use strict"; try {} catch (yield) {} diff --git a/test/fixtures/esprima/es2015-yield/invalid-yield-strict-catch-parameter/options.json b/test/fixtures/esprima/es2015-yield/invalid-yield-strict-catch-parameter/options.json new file mode 100644 index 0000000000..f55830c1c3 --- /dev/null +++ b/test/fixtures/esprima/es2015-yield/invalid-yield-strict-catch-parameter/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Unexpected token (1:28)" +} \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-yield/invalid-yield-strict-formal-parameter/actual.js b/test/fixtures/esprima/es2015-yield/invalid-yield-strict-formal-parameter/actual.js new file mode 100644 index 0000000000..333040f339 --- /dev/null +++ b/test/fixtures/esprima/es2015-yield/invalid-yield-strict-formal-parameter/actual.js @@ -0,0 +1 @@ +"use strict"; function f(yield) {} diff --git a/test/fixtures/esprima/es2015-yield/invalid-yield-strict-formal-parameter/options.json b/test/fixtures/esprima/es2015-yield/invalid-yield-strict-formal-parameter/options.json new file mode 100644 index 0000000000..b242442b4c --- /dev/null +++ b/test/fixtures/esprima/es2015-yield/invalid-yield-strict-formal-parameter/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Unexpected token (1:25)" +} \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-yield/invalid-yield-strict-function-declaration/actual.js b/test/fixtures/esprima/es2015-yield/invalid-yield-strict-function-declaration/actual.js new file mode 100644 index 0000000000..01909ba03e --- /dev/null +++ b/test/fixtures/esprima/es2015-yield/invalid-yield-strict-function-declaration/actual.js @@ -0,0 +1 @@ +function yield(){ "use strict"; } diff --git a/test/fixtures/esprima/es2015-yield/invalid-yield-strict-function-declaration/expected.json b/test/fixtures/esprima/es2015-yield/invalid-yield-strict-function-declaration/expected.json new file mode 100644 index 0000000000..83a78a03c2 --- /dev/null +++ b/test/fixtures/esprima/es2015-yield/invalid-yield-strict-function-declaration/expected.json @@ -0,0 +1,117 @@ +{ + "type": "File", + "start": 0, + "end": 33, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 33 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 33, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 33 + } + }, + "sourceType": "script", + "body": [ + { + "type": "FunctionDeclaration", + "start": 0, + "end": 33, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 33 + } + }, + "id": { + "type": "Identifier", + "start": 9, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "name": "yield" + }, + "generator": false, + "expression": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 16, + "end": 33, + "loc": { + "start": { + "line": 1, + "column": 16 + }, + "end": { + "line": 1, + "column": 33 + } + }, + "body": [ + { + "type": "ExpressionStatement", + "start": 18, + "end": 31, + "loc": { + "start": { + "line": 1, + "column": 18 + }, + "end": { + "line": 1, + "column": 31 + } + }, + "expression": { + "type": "Literal", + "start": 18, + "end": 30, + "loc": { + "start": { + "line": 1, + "column": 18 + }, + "end": { + "line": 1, + "column": 30 + } + }, + "value": "use strict", + "rawValue": "use strict", + "raw": "\"use strict\"" + } + } + ] + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-yield/invalid-yield-strict-function-declaration/options.json b/test/fixtures/esprima/es2015-yield/invalid-yield-strict-function-declaration/options.json new file mode 100644 index 0000000000..ce6a7da479 --- /dev/null +++ b/test/fixtures/esprima/es2015-yield/invalid-yield-strict-function-declaration/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Binding yield in strict mode (1:9)" +} diff --git a/test/fixtures/esprima/es2015-yield/invalid-yield-strict-function-expression/actual.js b/test/fixtures/esprima/es2015-yield/invalid-yield-strict-function-expression/actual.js new file mode 100644 index 0000000000..e0b8151268 --- /dev/null +++ b/test/fixtures/esprima/es2015-yield/invalid-yield-strict-function-expression/actual.js @@ -0,0 +1 @@ +(function yield(){ "use strict"; }) diff --git a/test/fixtures/esprima/es2015-yield/invalid-yield-strict-function-expression/expected.json b/test/fixtures/esprima/es2015-yield/invalid-yield-strict-function-expression/expected.json new file mode 100644 index 0000000000..a12316ae59 --- /dev/null +++ b/test/fixtures/esprima/es2015-yield/invalid-yield-strict-function-expression/expected.json @@ -0,0 +1,133 @@ +{ + "type": "File", + "start": 0, + "end": 35, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 35 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 35, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 35 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 35, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 35 + } + }, + "expression": { + "type": "FunctionExpression", + "start": 1, + "end": 34, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 34 + } + }, + "id": { + "type": "Identifier", + "start": 10, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "name": "yield" + }, + "generator": false, + "expression": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 17, + "end": 34, + "loc": { + "start": { + "line": 1, + "column": 17 + }, + "end": { + "line": 1, + "column": 34 + } + }, + "body": [ + { + "type": "ExpressionStatement", + "start": 19, + "end": 32, + "loc": { + "start": { + "line": 1, + "column": 19 + }, + "end": { + "line": 1, + "column": 32 + } + }, + "expression": { + "type": "Literal", + "start": 19, + "end": 31, + "loc": { + "start": { + "line": 1, + "column": 19 + }, + "end": { + "line": 1, + "column": 31 + } + }, + "value": "use strict", + "rawValue": "use strict", + "raw": "\"use strict\"" + } + } + ] + }, + "parenthesizedExpression": true + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-yield/invalid-yield-strict-function-expression/options.json b/test/fixtures/esprima/es2015-yield/invalid-yield-strict-function-expression/options.json new file mode 100644 index 0000000000..95d52f45f5 --- /dev/null +++ b/test/fixtures/esprima/es2015-yield/invalid-yield-strict-function-expression/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Binding yield in strict mode (1:10)" +} diff --git a/test/fixtures/esprima/es2015-yield/invalid-yield-strict-identifier/actual.js b/test/fixtures/esprima/es2015-yield/invalid-yield-strict-identifier/actual.js new file mode 100644 index 0000000000..bba51e2706 --- /dev/null +++ b/test/fixtures/esprima/es2015-yield/invalid-yield-strict-identifier/actual.js @@ -0,0 +1 @@ +"use strict"; function f() { yield } diff --git a/test/fixtures/esprima/es2015-yield/invalid-yield-strict-identifier/options.json b/test/fixtures/esprima/es2015-yield/invalid-yield-strict-identifier/options.json new file mode 100644 index 0000000000..6079f138a6 --- /dev/null +++ b/test/fixtures/esprima/es2015-yield/invalid-yield-strict-identifier/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Unexpected token (1:29)" +} diff --git a/test/fixtures/esprima/es2015-yield/invalid-yield-strict-lexical-declaration/actual.js b/test/fixtures/esprima/es2015-yield/invalid-yield-strict-lexical-declaration/actual.js new file mode 100644 index 0000000000..71917f956c --- /dev/null +++ b/test/fixtures/esprima/es2015-yield/invalid-yield-strict-lexical-declaration/actual.js @@ -0,0 +1 @@ +"use strict"; let yield = 42; diff --git a/test/fixtures/esprima/es2015-yield/invalid-yield-strict-lexical-declaration/options.json b/test/fixtures/esprima/es2015-yield/invalid-yield-strict-lexical-declaration/options.json new file mode 100644 index 0000000000..2a73699bc2 --- /dev/null +++ b/test/fixtures/esprima/es2015-yield/invalid-yield-strict-lexical-declaration/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Unexpected token (1:18)" +} \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-yield/invalid-yield-strict-rest-parameter/actual.js b/test/fixtures/esprima/es2015-yield/invalid-yield-strict-rest-parameter/actual.js new file mode 100644 index 0000000000..d9d63622bb --- /dev/null +++ b/test/fixtures/esprima/es2015-yield/invalid-yield-strict-rest-parameter/actual.js @@ -0,0 +1 @@ +"use strict"; function f(...yield) {} diff --git a/test/fixtures/esprima/es2015-yield/invalid-yield-strict-rest-parameter/options.json b/test/fixtures/esprima/es2015-yield/invalid-yield-strict-rest-parameter/options.json new file mode 100644 index 0000000000..f55830c1c3 --- /dev/null +++ b/test/fixtures/esprima/es2015-yield/invalid-yield-strict-rest-parameter/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Unexpected token (1:28)" +} \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-yield/invalid-yield-strict-variable-declaration/actual.js b/test/fixtures/esprima/es2015-yield/invalid-yield-strict-variable-declaration/actual.js new file mode 100644 index 0000000000..455ea8aa00 --- /dev/null +++ b/test/fixtures/esprima/es2015-yield/invalid-yield-strict-variable-declaration/actual.js @@ -0,0 +1 @@ +"use strict"; var yield; diff --git a/test/fixtures/esprima/es2015-yield/invalid-yield-strict-variable-declaration/options.json b/test/fixtures/esprima/es2015-yield/invalid-yield-strict-variable-declaration/options.json new file mode 100644 index 0000000000..2a73699bc2 --- /dev/null +++ b/test/fixtures/esprima/es2015-yield/invalid-yield-strict-variable-declaration/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Unexpected token (1:18)" +} \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-yield/yield-array-pattern/actual.js b/test/fixtures/esprima/es2015-yield/yield-array-pattern/actual.js new file mode 100644 index 0000000000..f4a21e5ac5 --- /dev/null +++ b/test/fixtures/esprima/es2015-yield/yield-array-pattern/actual.js @@ -0,0 +1 @@ +([yield] = x) diff --git a/test/fixtures/esprima/es2015-yield/yield-array-pattern/expected.json b/test/fixtures/esprima/es2015-yield/yield-array-pattern/expected.json new file mode 100644 index 0000000000..5a8f717350 --- /dev/null +++ b/test/fixtures/esprima/es2015-yield/yield-array-pattern/expected.json @@ -0,0 +1,114 @@ +{ + "type": "File", + "start": 0, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "expression": { + "type": "AssignmentExpression", + "start": 1, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "operator": "=", + "left": { + "type": "ArrayPattern", + "start": 1, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "elements": [ + { + "type": "Identifier", + "start": 2, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 2 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "name": "yield" + } + ] + }, + "right": { + "type": "Identifier", + "start": 11, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 11 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "name": "x" + }, + "parenthesizedExpression": true + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-yield/yield-arrow-concise-body/actual.js b/test/fixtures/esprima/es2015-yield/yield-arrow-concise-body/actual.js new file mode 100644 index 0000000000..e6844e30f5 --- /dev/null +++ b/test/fixtures/esprima/es2015-yield/yield-arrow-concise-body/actual.js @@ -0,0 +1 @@ +(x) => x * yield; diff --git a/test/fixtures/esprima/es2015-yield/yield-arrow-concise-body/expected.json b/test/fixtures/esprima/es2015-yield/yield-arrow-concise-body/expected.json new file mode 100644 index 0000000000..81505c98aa --- /dev/null +++ b/test/fixtures/esprima/es2015-yield/yield-arrow-concise-body/expected.json @@ -0,0 +1,132 @@ +{ + "type": "File", + "start": 0, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "expression": { + "type": "ArrowFunctionExpression", + "start": 0, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "id": null, + "generator": false, + "expression": true, + "params": [ + { + "type": "Identifier", + "start": 1, + "end": 2, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 2 + } + }, + "name": "x" + } + ], + "body": { + "type": "BinaryExpression", + "start": 7, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "left": { + "type": "Identifier", + "start": 7, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "name": "x" + }, + "operator": "*", + "right": { + "type": "Identifier", + "start": 11, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 11 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "name": "yield" + } + } + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-yield/yield-arrow-function-body/actual.js b/test/fixtures/esprima/es2015-yield/yield-arrow-function-body/actual.js new file mode 100644 index 0000000000..b8c73aaa9c --- /dev/null +++ b/test/fixtures/esprima/es2015-yield/yield-arrow-function-body/actual.js @@ -0,0 +1 @@ +(z) => { yield + z }; diff --git a/test/fixtures/esprima/es2015-yield/yield-arrow-function-body/expected.json b/test/fixtures/esprima/es2015-yield/yield-arrow-function-body/expected.json new file mode 100644 index 0000000000..524a90fb9e --- /dev/null +++ b/test/fixtures/esprima/es2015-yield/yield-arrow-function-body/expected.json @@ -0,0 +1,164 @@ +{ + "type": "File", + "start": 0, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 21 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 21 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 21 + } + }, + "expression": { + "type": "ArrowFunctionExpression", + "start": 0, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "id": null, + "generator": false, + "expression": false, + "params": [ + { + "type": "Identifier", + "start": 1, + "end": 2, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 2 + } + }, + "name": "z" + } + ], + "body": { + "type": "BlockStatement", + "start": 7, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "body": [ + { + "type": "ExpressionStatement", + "start": 9, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "expression": { + "type": "BinaryExpression", + "start": 9, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "left": { + "type": "Identifier", + "start": 9, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "name": "yield" + }, + "operator": "+", + "right": { + "type": "Identifier", + "start": 17, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 17 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "name": "z" + } + } + } + ] + } + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-yield/yield-arrow-parameter-default/actual.js b/test/fixtures/esprima/es2015-yield/yield-arrow-parameter-default/actual.js new file mode 100644 index 0000000000..e4bd6e2eb5 --- /dev/null +++ b/test/fixtures/esprima/es2015-yield/yield-arrow-parameter-default/actual.js @@ -0,0 +1 @@ +(x = yield) => {} diff --git a/test/fixtures/esprima/es2015-yield/yield-arrow-parameter-default/expected.json b/test/fixtures/esprima/es2015-yield/yield-arrow-parameter-default/expected.json new file mode 100644 index 0000000000..2058074918 --- /dev/null +++ b/test/fixtures/esprima/es2015-yield/yield-arrow-parameter-default/expected.json @@ -0,0 +1,131 @@ +{ + "type": "File", + "start": 0, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "expression": { + "type": "ArrowFunctionExpression", + "start": 0, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "id": null, + "generator": false, + "expression": false, + "params": [ + { + "type": "AssignmentPattern", + "start": 1, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "left": { + "type": "Identifier", + "start": 1, + "end": 2, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 2 + } + }, + "name": "x" + }, + "right": { + "type": "Identifier", + "start": 5, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "name": "yield" + } + } + ], + "body": { + "type": "BlockStatement", + "start": 15, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "body": [] + } + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-yield/yield-arrow-parameter-name/actual.js b/test/fixtures/esprima/es2015-yield/yield-arrow-parameter-name/actual.js new file mode 100644 index 0000000000..db130ff82d --- /dev/null +++ b/test/fixtures/esprima/es2015-yield/yield-arrow-parameter-name/actual.js @@ -0,0 +1 @@ +(yield) => 42; diff --git a/test/fixtures/esprima/es2015-yield/yield-arrow-parameter-name/expected.json b/test/fixtures/esprima/es2015-yield/yield-arrow-parameter-name/expected.json new file mode 100644 index 0000000000..4fdb12deff --- /dev/null +++ b/test/fixtures/esprima/es2015-yield/yield-arrow-parameter-name/expected.json @@ -0,0 +1,102 @@ +{ + "type": "File", + "start": 0, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "expression": { + "type": "ArrowFunctionExpression", + "start": 0, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "id": null, + "generator": false, + "expression": true, + "params": [ + { + "type": "Identifier", + "start": 1, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "name": "yield" + } + ], + "body": { + "type": "Literal", + "start": 11, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 11 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "value": 42, + "rawValue": 42, + "raw": "42" + } + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-yield/yield-binding-element/actual.js b/test/fixtures/esprima/es2015-yield/yield-binding-element/actual.js new file mode 100644 index 0000000000..4e915ae558 --- /dev/null +++ b/test/fixtures/esprima/es2015-yield/yield-binding-element/actual.js @@ -0,0 +1 @@ +var { x: yield } = foo; diff --git a/test/fixtures/esprima/es2015-yield/yield-binding-element/expected.json b/test/fixtures/esprima/es2015-yield/yield-binding-element/expected.json new file mode 100644 index 0000000000..350b3f3ac2 --- /dev/null +++ b/test/fixtures/esprima/es2015-yield/yield-binding-element/expected.json @@ -0,0 +1,150 @@ +{ + "type": "File", + "start": 0, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "sourceType": "script", + "body": [ + { + "type": "VariableDeclaration", + "start": 0, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 4, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "id": { + "type": "ObjectPattern", + "start": 4, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "properties": [ + { + "type": "Property", + "start": 6, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "method": false, + "shorthand": false, + "computed": false, + "key": { + "type": "Identifier", + "start": 6, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "name": "x" + }, + "value": { + "type": "Identifier", + "start": 9, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "name": "yield" + }, + "kind": "init" + } + ] + }, + "init": { + "type": "Identifier", + "start": 19, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 19 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "name": "foo" + } + } + ], + "kind": "var" + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-yield/yield-binding-property/actual.js b/test/fixtures/esprima/es2015-yield/yield-binding-property/actual.js new file mode 100644 index 0000000000..2387b61668 --- /dev/null +++ b/test/fixtures/esprima/es2015-yield/yield-binding-property/actual.js @@ -0,0 +1 @@ +var { yield: x } = foo; diff --git a/test/fixtures/esprima/es2015-yield/yield-binding-property/expected.json b/test/fixtures/esprima/es2015-yield/yield-binding-property/expected.json new file mode 100644 index 0000000000..65944e5be1 --- /dev/null +++ b/test/fixtures/esprima/es2015-yield/yield-binding-property/expected.json @@ -0,0 +1,150 @@ +{ + "type": "File", + "start": 0, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "sourceType": "script", + "body": [ + { + "type": "VariableDeclaration", + "start": 0, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 4, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "id": { + "type": "ObjectPattern", + "start": 4, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "properties": [ + { + "type": "Property", + "start": 6, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "method": false, + "shorthand": false, + "computed": false, + "key": { + "type": "Identifier", + "start": 6, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "name": "yield" + }, + "value": { + "type": "Identifier", + "start": 13, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "name": "x" + }, + "kind": "init" + } + ] + }, + "init": { + "type": "Identifier", + "start": 19, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 19 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "name": "foo" + } + } + ], + "kind": "var" + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-yield/yield-call-expression-property/actual.js b/test/fixtures/esprima/es2015-yield/yield-call-expression-property/actual.js new file mode 100644 index 0000000000..3faf4147c7 --- /dev/null +++ b/test/fixtures/esprima/es2015-yield/yield-call-expression-property/actual.js @@ -0,0 +1 @@ +function *g() { obj.yield(); } diff --git a/test/fixtures/esprima/es2015-yield/yield-call-expression-property/expected.json b/test/fixtures/esprima/es2015-yield/yield-call-expression-property/expected.json new file mode 100644 index 0000000000..2e11c61b3c --- /dev/null +++ b/test/fixtures/esprima/es2015-yield/yield-call-expression-property/expected.json @@ -0,0 +1,163 @@ +{ + "type": "File", + "start": 0, + "end": 30, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 30 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 30, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 30 + } + }, + "sourceType": "script", + "body": [ + { + "type": "FunctionDeclaration", + "start": 0, + "end": 30, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 30 + } + }, + "id": { + "type": "Identifier", + "start": 10, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "name": "g" + }, + "generator": true, + "expression": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 14, + "end": 30, + "loc": { + "start": { + "line": 1, + "column": 14 + }, + "end": { + "line": 1, + "column": 30 + } + }, + "body": [ + { + "type": "ExpressionStatement", + "start": 16, + "end": 28, + "loc": { + "start": { + "line": 1, + "column": 16 + }, + "end": { + "line": 1, + "column": 28 + } + }, + "expression": { + "type": "CallExpression", + "start": 16, + "end": 27, + "loc": { + "start": { + "line": 1, + "column": 16 + }, + "end": { + "line": 1, + "column": 27 + } + }, + "callee": { + "type": "MemberExpression", + "start": 16, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 16 + }, + "end": { + "line": 1, + "column": 25 + } + }, + "object": { + "type": "Identifier", + "start": 16, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 16 + }, + "end": { + "line": 1, + "column": 19 + } + }, + "name": "obj" + }, + "property": { + "type": "Identifier", + "start": 20, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 20 + }, + "end": { + "line": 1, + "column": 25 + } + }, + "name": "yield" + }, + "computed": false + }, + "arguments": [] + } + } + ] + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-yield/yield-catch-parameter/actual.js b/test/fixtures/esprima/es2015-yield/yield-catch-parameter/actual.js new file mode 100644 index 0000000000..42c9869dc1 --- /dev/null +++ b/test/fixtures/esprima/es2015-yield/yield-catch-parameter/actual.js @@ -0,0 +1 @@ +try {} catch (yield) {} diff --git a/test/fixtures/esprima/es2015-yield/yield-catch-parameter/expected.json b/test/fixtures/esprima/es2015-yield/yield-catch-parameter/expected.json new file mode 100644 index 0000000000..3cba41671f --- /dev/null +++ b/test/fixtures/esprima/es2015-yield/yield-catch-parameter/expected.json @@ -0,0 +1,113 @@ +{ + "type": "File", + "start": 0, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "sourceType": "script", + "body": [ + { + "type": "TryStatement", + "start": 0, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "block": { + "type": "BlockStatement", + "start": 4, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "body": [] + }, + "handler": { + "type": "CatchClause", + "start": 7, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "param": { + "type": "Identifier", + "start": 14, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 14 + }, + "end": { + "line": 1, + "column": 19 + } + }, + "name": "yield" + }, + "body": { + "type": "BlockStatement", + "start": 21, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 21 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "body": [] + } + }, + "guardedHandlers": [], + "finalizer": null + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-yield/yield-expression-precedence/actual.js b/test/fixtures/esprima/es2015-yield/yield-expression-precedence/actual.js new file mode 100644 index 0000000000..5dca227228 --- /dev/null +++ b/test/fixtures/esprima/es2015-yield/yield-expression-precedence/actual.js @@ -0,0 +1 @@ +function *g() { yield a=b, yield* c=d, e } diff --git a/test/fixtures/esprima/es2015-yield/yield-expression-precedence/expected.json b/test/fixtures/esprima/es2015-yield/yield-expression-precedence/expected.json new file mode 100644 index 0000000000..8a39ff485d --- /dev/null +++ b/test/fixtures/esprima/es2015-yield/yield-expression-precedence/expected.json @@ -0,0 +1,260 @@ +{ + "type": "File", + "start": 0, + "end": 42, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 42 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 42, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 42 + } + }, + "sourceType": "script", + "body": [ + { + "type": "FunctionDeclaration", + "start": 0, + "end": 42, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 42 + } + }, + "id": { + "type": "Identifier", + "start": 10, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "name": "g" + }, + "generator": true, + "expression": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 14, + "end": 42, + "loc": { + "start": { + "line": 1, + "column": 14 + }, + "end": { + "line": 1, + "column": 42 + } + }, + "body": [ + { + "type": "ExpressionStatement", + "start": 16, + "end": 40, + "loc": { + "start": { + "line": 1, + "column": 16 + }, + "end": { + "line": 1, + "column": 40 + } + }, + "expression": { + "type": "SequenceExpression", + "start": 16, + "end": 40, + "loc": { + "start": { + "line": 1, + "column": 16 + }, + "end": { + "line": 1, + "column": 40 + } + }, + "expressions": [ + { + "type": "YieldExpression", + "start": 16, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 16 + }, + "end": { + "line": 1, + "column": 25 + } + }, + "delegate": false, + "argument": { + "type": "AssignmentExpression", + "start": 22, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 22 + }, + "end": { + "line": 1, + "column": 25 + } + }, + "operator": "=", + "left": { + "type": "Identifier", + "start": 22, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 22 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "name": "a" + }, + "right": { + "type": "Identifier", + "start": 24, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 24 + }, + "end": { + "line": 1, + "column": 25 + } + }, + "name": "b" + } + } + }, + { + "type": "YieldExpression", + "start": 27, + "end": 37, + "loc": { + "start": { + "line": 1, + "column": 27 + }, + "end": { + "line": 1, + "column": 37 + } + }, + "delegate": true, + "argument": { + "type": "AssignmentExpression", + "start": 34, + "end": 37, + "loc": { + "start": { + "line": 1, + "column": 34 + }, + "end": { + "line": 1, + "column": 37 + } + }, + "operator": "=", + "left": { + "type": "Identifier", + "start": 34, + "end": 35, + "loc": { + "start": { + "line": 1, + "column": 34 + }, + "end": { + "line": 1, + "column": 35 + } + }, + "name": "c" + }, + "right": { + "type": "Identifier", + "start": 36, + "end": 37, + "loc": { + "start": { + "line": 1, + "column": 36 + }, + "end": { + "line": 1, + "column": 37 + } + }, + "name": "d" + } + } + }, + { + "type": "Identifier", + "start": 39, + "end": 40, + "loc": { + "start": { + "line": 1, + "column": 39 + }, + "end": { + "line": 1, + "column": 40 + } + }, + "name": "e" + } + ] + } + } + ] + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-yield/yield-function-declaration-formal-parameter/actual.js b/test/fixtures/esprima/es2015-yield/yield-function-declaration-formal-parameter/actual.js new file mode 100644 index 0000000000..0f1d08ca70 --- /dev/null +++ b/test/fixtures/esprima/es2015-yield/yield-function-declaration-formal-parameter/actual.js @@ -0,0 +1 @@ +function f(yield) {} diff --git a/test/fixtures/esprima/es2015-yield/yield-function-declaration-formal-parameter/expected.json b/test/fixtures/esprima/es2015-yield/yield-function-declaration-formal-parameter/expected.json new file mode 100644 index 0000000000..f16d4b50a4 --- /dev/null +++ b/test/fixtures/esprima/es2015-yield/yield-function-declaration-formal-parameter/expected.json @@ -0,0 +1,100 @@ +{ + "type": "File", + "start": 0, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "sourceType": "script", + "body": [ + { + "type": "FunctionDeclaration", + "start": 0, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "id": { + "type": "Identifier", + "start": 9, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "name": "f" + }, + "generator": false, + "expression": false, + "params": [ + { + "type": "Identifier", + "start": 11, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 11 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "name": "yield" + } + ], + "body": { + "type": "BlockStatement", + "start": 18, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 18 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "body": [] + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-yield/yield-function-declaration/actual.js b/test/fixtures/esprima/es2015-yield/yield-function-declaration/actual.js new file mode 100644 index 0000000000..fe8a313f26 --- /dev/null +++ b/test/fixtures/esprima/es2015-yield/yield-function-declaration/actual.js @@ -0,0 +1 @@ +function yield(){} diff --git a/test/fixtures/esprima/es2015-yield/yield-function-declaration/expected.json b/test/fixtures/esprima/es2015-yield/yield-function-declaration/expected.json new file mode 100644 index 0000000000..18ef7bd43a --- /dev/null +++ b/test/fixtures/esprima/es2015-yield/yield-function-declaration/expected.json @@ -0,0 +1,83 @@ +{ + "type": "File", + "start": 0, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "sourceType": "script", + "body": [ + { + "type": "FunctionDeclaration", + "start": 0, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "id": { + "type": "Identifier", + "start": 9, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "name": "yield" + }, + "generator": false, + "expression": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 16, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 16 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "body": [] + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-yield/yield-function-expression-parameter/actual.js b/test/fixtures/esprima/es2015-yield/yield-function-expression-parameter/actual.js new file mode 100644 index 0000000000..0f2ffa39ca --- /dev/null +++ b/test/fixtures/esprima/es2015-yield/yield-function-expression-parameter/actual.js @@ -0,0 +1 @@ +(function(yield) {}) diff --git a/test/fixtures/esprima/es2015-yield/yield-function-expression-parameter/expected.json b/test/fixtures/esprima/es2015-yield/yield-function-expression-parameter/expected.json new file mode 100644 index 0000000000..be34ece5b3 --- /dev/null +++ b/test/fixtures/esprima/es2015-yield/yield-function-expression-parameter/expected.json @@ -0,0 +1,101 @@ +{ + "type": "File", + "start": 0, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "expression": { + "type": "FunctionExpression", + "start": 1, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 19 + } + }, + "id": null, + "generator": false, + "expression": false, + "params": [ + { + "type": "Identifier", + "start": 10, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "name": "yield" + } + ], + "body": { + "type": "BlockStatement", + "start": 17, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 17 + }, + "end": { + "line": 1, + "column": 19 + } + }, + "body": [] + }, + "parenthesizedExpression": true + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-yield/yield-function-expression/actual.js b/test/fixtures/esprima/es2015-yield/yield-function-expression/actual.js new file mode 100644 index 0000000000..d8d03fa6de --- /dev/null +++ b/test/fixtures/esprima/es2015-yield/yield-function-expression/actual.js @@ -0,0 +1 @@ +(function yield(){}) diff --git a/test/fixtures/esprima/es2015-yield/yield-function-expression/expected.json b/test/fixtures/esprima/es2015-yield/yield-function-expression/expected.json new file mode 100644 index 0000000000..03c3926cb0 --- /dev/null +++ b/test/fixtures/esprima/es2015-yield/yield-function-expression/expected.json @@ -0,0 +1,99 @@ +{ + "type": "File", + "start": 0, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "expression": { + "type": "FunctionExpression", + "start": 1, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 19 + } + }, + "id": { + "type": "Identifier", + "start": 10, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "name": "yield" + }, + "generator": false, + "expression": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 17, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 17 + }, + "end": { + "line": 1, + "column": 19 + } + }, + "body": [] + }, + "parenthesizedExpression": true + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-yield/yield-generator-arrow-concise-body/actual.js b/test/fixtures/esprima/es2015-yield/yield-generator-arrow-concise-body/actual.js new file mode 100644 index 0000000000..9d1bde8dd6 --- /dev/null +++ b/test/fixtures/esprima/es2015-yield/yield-generator-arrow-concise-body/actual.js @@ -0,0 +1 @@ +function *g() { (x) => x * yield; } diff --git a/test/fixtures/esprima/es2015-yield/yield-generator-arrow-concise-body/expected.json b/test/fixtures/esprima/es2015-yield/yield-generator-arrow-concise-body/expected.json new file mode 100644 index 0000000000..4887c0fc44 --- /dev/null +++ b/test/fixtures/esprima/es2015-yield/yield-generator-arrow-concise-body/expected.json @@ -0,0 +1,183 @@ +{ + "type": "File", + "start": 0, + "end": 35, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 35 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 35, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 35 + } + }, + "sourceType": "script", + "body": [ + { + "type": "FunctionDeclaration", + "start": 0, + "end": 35, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 35 + } + }, + "id": { + "type": "Identifier", + "start": 10, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "name": "g" + }, + "generator": true, + "expression": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 14, + "end": 35, + "loc": { + "start": { + "line": 1, + "column": 14 + }, + "end": { + "line": 1, + "column": 35 + } + }, + "body": [ + { + "type": "ExpressionStatement", + "start": 16, + "end": 33, + "loc": { + "start": { + "line": 1, + "column": 16 + }, + "end": { + "line": 1, + "column": 33 + } + }, + "expression": { + "type": "ArrowFunctionExpression", + "start": 16, + "end": 32, + "loc": { + "start": { + "line": 1, + "column": 16 + }, + "end": { + "line": 1, + "column": 32 + } + }, + "id": null, + "generator": false, + "expression": true, + "params": [ + { + "type": "Identifier", + "start": 17, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 17 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "name": "x" + } + ], + "body": { + "type": "BinaryExpression", + "start": 23, + "end": 32, + "loc": { + "start": { + "line": 1, + "column": 23 + }, + "end": { + "line": 1, + "column": 32 + } + }, + "left": { + "type": "Identifier", + "start": 23, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 23 + }, + "end": { + "line": 1, + "column": 24 + } + }, + "name": "x" + }, + "operator": "*", + "right": { + "type": "Identifier", + "start": 27, + "end": 32, + "loc": { + "start": { + "line": 1, + "column": 27 + }, + "end": { + "line": 1, + "column": 32 + } + }, + "name": "yield" + } + } + } + } + ] + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-yield/yield-generator-arrow-default/actual.js b/test/fixtures/esprima/es2015-yield/yield-generator-arrow-default/actual.js new file mode 100644 index 0000000000..fafac7f806 --- /dev/null +++ b/test/fixtures/esprima/es2015-yield/yield-generator-arrow-default/actual.js @@ -0,0 +1 @@ +function *g() { (x = yield) => {} } diff --git a/test/fixtures/esprima/es2015-yield/yield-generator-arrow-default/expected.json b/test/fixtures/esprima/es2015-yield/yield-generator-arrow-default/expected.json new file mode 100644 index 0000000000..f9c4899032 --- /dev/null +++ b/test/fixtures/esprima/es2015-yield/yield-generator-arrow-default/expected.json @@ -0,0 +1,183 @@ +{ + "type": "File", + "start": 0, + "end": 35, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 35 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 35, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 35 + } + }, + "sourceType": "script", + "body": [ + { + "type": "FunctionDeclaration", + "start": 0, + "end": 35, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 35 + } + }, + "id": { + "type": "Identifier", + "start": 10, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "name": "g" + }, + "generator": true, + "expression": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 14, + "end": 35, + "loc": { + "start": { + "line": 1, + "column": 14 + }, + "end": { + "line": 1, + "column": 35 + } + }, + "body": [ + { + "type": "ExpressionStatement", + "start": 16, + "end": 33, + "loc": { + "start": { + "line": 1, + "column": 16 + }, + "end": { + "line": 1, + "column": 33 + } + }, + "expression": { + "type": "ArrowFunctionExpression", + "start": 16, + "end": 33, + "loc": { + "start": { + "line": 1, + "column": 16 + }, + "end": { + "line": 1, + "column": 33 + } + }, + "id": null, + "generator": false, + "expression": false, + "params": [ + { + "type": "AssignmentPattern", + "start": 17, + "end": 26, + "loc": { + "start": { + "line": 1, + "column": 17 + }, + "end": { + "line": 1, + "column": 26 + } + }, + "left": { + "type": "Identifier", + "start": 17, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 17 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "name": "x" + }, + "right": { + "type": "YieldExpression", + "start": 21, + "end": 26, + "loc": { + "start": { + "line": 1, + "column": 21 + }, + "end": { + "line": 1, + "column": 26 + } + }, + "delegate": false, + "argument": null + } + } + ], + "body": { + "type": "BlockStatement", + "start": 31, + "end": 33, + "loc": { + "start": { + "line": 1, + "column": 31 + }, + "end": { + "line": 1, + "column": 33 + } + }, + "body": [] + } + } + } + ] + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-yield/yield-generator-arrow-function-body/actual.js b/test/fixtures/esprima/es2015-yield/yield-generator-arrow-function-body/actual.js new file mode 100644 index 0000000000..7f27722f51 --- /dev/null +++ b/test/fixtures/esprima/es2015-yield/yield-generator-arrow-function-body/actual.js @@ -0,0 +1 @@ +function *g() { (z) => { yield + z }; } diff --git a/test/fixtures/esprima/es2015-yield/yield-generator-arrow-function-body/expected.json b/test/fixtures/esprima/es2015-yield/yield-generator-arrow-function-body/expected.json new file mode 100644 index 0000000000..8ee47195d3 --- /dev/null +++ b/test/fixtures/esprima/es2015-yield/yield-generator-arrow-function-body/expected.json @@ -0,0 +1,215 @@ +{ + "type": "File", + "start": 0, + "end": 39, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 39 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 39, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 39 + } + }, + "sourceType": "script", + "body": [ + { + "type": "FunctionDeclaration", + "start": 0, + "end": 39, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 39 + } + }, + "id": { + "type": "Identifier", + "start": 10, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "name": "g" + }, + "generator": true, + "expression": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 14, + "end": 39, + "loc": { + "start": { + "line": 1, + "column": 14 + }, + "end": { + "line": 1, + "column": 39 + } + }, + "body": [ + { + "type": "ExpressionStatement", + "start": 16, + "end": 37, + "loc": { + "start": { + "line": 1, + "column": 16 + }, + "end": { + "line": 1, + "column": 37 + } + }, + "expression": { + "type": "ArrowFunctionExpression", + "start": 16, + "end": 36, + "loc": { + "start": { + "line": 1, + "column": 16 + }, + "end": { + "line": 1, + "column": 36 + } + }, + "id": null, + "generator": false, + "expression": false, + "params": [ + { + "type": "Identifier", + "start": 17, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 17 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "name": "z" + } + ], + "body": { + "type": "BlockStatement", + "start": 23, + "end": 36, + "loc": { + "start": { + "line": 1, + "column": 23 + }, + "end": { + "line": 1, + "column": 36 + } + }, + "body": [ + { + "type": "ExpressionStatement", + "start": 25, + "end": 34, + "loc": { + "start": { + "line": 1, + "column": 25 + }, + "end": { + "line": 1, + "column": 34 + } + }, + "expression": { + "type": "BinaryExpression", + "start": 25, + "end": 34, + "loc": { + "start": { + "line": 1, + "column": 25 + }, + "end": { + "line": 1, + "column": 34 + } + }, + "left": { + "type": "Identifier", + "start": 25, + "end": 30, + "loc": { + "start": { + "line": 1, + "column": 25 + }, + "end": { + "line": 1, + "column": 30 + } + }, + "name": "yield" + }, + "operator": "+", + "right": { + "type": "Identifier", + "start": 33, + "end": 34, + "loc": { + "start": { + "line": 1, + "column": 33 + }, + "end": { + "line": 1, + "column": 34 + } + }, + "name": "z" + } + } + } + ] + } + } + } + ] + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-yield/yield-generator-declaration/actual.js b/test/fixtures/esprima/es2015-yield/yield-generator-declaration/actual.js new file mode 100644 index 0000000000..be10f1b197 --- /dev/null +++ b/test/fixtures/esprima/es2015-yield/yield-generator-declaration/actual.js @@ -0,0 +1 @@ +function *yield(){} diff --git a/test/fixtures/esprima/es2015-yield/yield-generator-declaration/expected.json b/test/fixtures/esprima/es2015-yield/yield-generator-declaration/expected.json new file mode 100644 index 0000000000..76d7225d05 --- /dev/null +++ b/test/fixtures/esprima/es2015-yield/yield-generator-declaration/expected.json @@ -0,0 +1,83 @@ +{ + "type": "File", + "start": 0, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 19 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 19 + } + }, + "sourceType": "script", + "body": [ + { + "type": "FunctionDeclaration", + "start": 0, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 19 + } + }, + "id": { + "type": "Identifier", + "start": 10, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "name": "yield" + }, + "generator": true, + "expression": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 17, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 17 + }, + "end": { + "line": 1, + "column": 19 + } + }, + "body": [] + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-yield/yield-generator-default-parameter/actual.js b/test/fixtures/esprima/es2015-yield/yield-generator-default-parameter/actual.js new file mode 100644 index 0000000000..98b544c1c1 --- /dev/null +++ b/test/fixtures/esprima/es2015-yield/yield-generator-default-parameter/actual.js @@ -0,0 +1 @@ +function *g(x = yield){} diff --git a/test/fixtures/esprima/es2015-yield/yield-generator-default-parameter/expected.json b/test/fixtures/esprima/es2015-yield/yield-generator-default-parameter/expected.json new file mode 100644 index 0000000000..272c0b0c3d --- /dev/null +++ b/test/fixtures/esprima/es2015-yield/yield-generator-default-parameter/expected.json @@ -0,0 +1,131 @@ +{ + "type": "File", + "start": 0, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 24 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 24 + } + }, + "sourceType": "script", + "body": [ + { + "type": "FunctionDeclaration", + "start": 0, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 24 + } + }, + "id": { + "type": "Identifier", + "start": 10, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "name": "g" + }, + "generator": true, + "expression": false, + "params": [ + { + "type": "AssignmentPattern", + "start": 12, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 12 + }, + "end": { + "line": 1, + "column": 21 + } + }, + "left": { + "type": "Identifier", + "start": 12, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 12 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "name": "x" + }, + "right": { + "type": "Identifier", + "start": 16, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 16 + }, + "end": { + "line": 1, + "column": 21 + } + }, + "name": "yield" + } + } + ], + "body": { + "type": "BlockStatement", + "start": 22, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 22 + }, + "end": { + "line": 1, + "column": 24 + } + }, + "body": [] + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-yield/yield-generator-function-expression/actual.js b/test/fixtures/esprima/es2015-yield/yield-generator-function-expression/actual.js new file mode 100644 index 0000000000..be9d93e137 --- /dev/null +++ b/test/fixtures/esprima/es2015-yield/yield-generator-function-expression/actual.js @@ -0,0 +1 @@ +function *g(){ var y = function yield(){}; } diff --git a/test/fixtures/esprima/es2015-yield/yield-generator-function-parameter/actual.js b/test/fixtures/esprima/es2015-yield/yield-generator-function-parameter/actual.js new file mode 100644 index 0000000000..95cb17aad9 --- /dev/null +++ b/test/fixtures/esprima/es2015-yield/yield-generator-function-parameter/actual.js @@ -0,0 +1 @@ +function *g() { var z = function(yield) {} } diff --git a/test/fixtures/esprima/es2015-yield/yield-generator-function-parameter/expected.json b/test/fixtures/esprima/es2015-yield/yield-generator-function-parameter/expected.json new file mode 100644 index 0000000000..e8b2f8224a --- /dev/null +++ b/test/fixtures/esprima/es2015-yield/yield-generator-function-parameter/expected.json @@ -0,0 +1,185 @@ +{ + "type": "File", + "start": 0, + "end": 44, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 44 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 44, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 44 + } + }, + "sourceType": "script", + "body": [ + { + "type": "FunctionDeclaration", + "start": 0, + "end": 44, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 44 + } + }, + "id": { + "type": "Identifier", + "start": 10, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "name": "g" + }, + "generator": true, + "expression": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 14, + "end": 44, + "loc": { + "start": { + "line": 1, + "column": 14 + }, + "end": { + "line": 1, + "column": 44 + } + }, + "body": [ + { + "type": "VariableDeclaration", + "start": 16, + "end": 42, + "loc": { + "start": { + "line": 1, + "column": 16 + }, + "end": { + "line": 1, + "column": 42 + } + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 20, + "end": 42, + "loc": { + "start": { + "line": 1, + "column": 20 + }, + "end": { + "line": 1, + "column": 42 + } + }, + "id": { + "type": "Identifier", + "start": 20, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 20 + }, + "end": { + "line": 1, + "column": 21 + } + }, + "name": "z" + }, + "init": { + "type": "FunctionExpression", + "start": 24, + "end": 42, + "loc": { + "start": { + "line": 1, + "column": 24 + }, + "end": { + "line": 1, + "column": 42 + } + }, + "id": null, + "generator": false, + "expression": false, + "params": [ + { + "type": "Identifier", + "start": 33, + "end": 38, + "loc": { + "start": { + "line": 1, + "column": 33 + }, + "end": { + "line": 1, + "column": 38 + } + }, + "name": "yield" + } + ], + "body": { + "type": "BlockStatement", + "start": 40, + "end": 42, + "loc": { + "start": { + "line": 1, + "column": 40 + }, + "end": { + "line": 1, + "column": 42 + } + }, + "body": [] + } + } + } + ], + "kind": "var" + } + ] + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-yield/yield-generator-method/actual.js b/test/fixtures/esprima/es2015-yield/yield-generator-method/actual.js new file mode 100644 index 0000000000..09daccad90 --- /dev/null +++ b/test/fixtures/esprima/es2015-yield/yield-generator-method/actual.js @@ -0,0 +1 @@ +({ *yield() {} }) diff --git a/test/fixtures/esprima/es2015-yield/yield-generator-method/expected.json b/test/fixtures/esprima/es2015-yield/yield-generator-method/expected.json new file mode 100644 index 0000000000..9260f06278 --- /dev/null +++ b/test/fixtures/esprima/es2015-yield/yield-generator-method/expected.json @@ -0,0 +1,136 @@ +{ + "type": "File", + "start": 0, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "expression": { + "type": "ObjectExpression", + "start": 1, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "properties": [ + { + "type": "Property", + "start": 3, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 3 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "method": true, + "shorthand": false, + "computed": false, + "key": { + "type": "Identifier", + "start": 4, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "name": "yield" + }, + "kind": "init", + "value": { + "type": "FunctionExpression", + "start": 9, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "id": null, + "generator": true, + "expression": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 12, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 12 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "body": [] + } + } + } + ], + "parenthesizedExpression": true + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-yield/yield-generator-parameter-object-pattern/actual.js b/test/fixtures/esprima/es2015-yield/yield-generator-parameter-object-pattern/actual.js new file mode 100644 index 0000000000..a97e6379c4 --- /dev/null +++ b/test/fixtures/esprima/es2015-yield/yield-generator-parameter-object-pattern/actual.js @@ -0,0 +1 @@ +function *g({yield: y}){} diff --git a/test/fixtures/esprima/es2015-yield/yield-generator-parameter-object-pattern/expected.json b/test/fixtures/esprima/es2015-yield/yield-generator-parameter-object-pattern/expected.json new file mode 100644 index 0000000000..f491ff04fd --- /dev/null +++ b/test/fixtures/esprima/es2015-yield/yield-generator-parameter-object-pattern/expected.json @@ -0,0 +1,152 @@ +{ + "type": "File", + "start": 0, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 25 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 25 + } + }, + "sourceType": "script", + "body": [ + { + "type": "FunctionDeclaration", + "start": 0, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 25 + } + }, + "id": { + "type": "Identifier", + "start": 10, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "name": "g" + }, + "generator": true, + "expression": false, + "params": [ + { + "type": "ObjectPattern", + "start": 12, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 12 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "properties": [ + { + "type": "Property", + "start": 13, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 1, + "column": 21 + } + }, + "method": false, + "shorthand": false, + "computed": false, + "key": { + "type": "Identifier", + "start": 13, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "name": "yield" + }, + "value": { + "type": "Identifier", + "start": 20, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 20 + }, + "end": { + "line": 1, + "column": 21 + } + }, + "name": "y" + }, + "kind": "init" + } + ] + } + ], + "body": { + "type": "BlockStatement", + "start": 23, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 23 + }, + "end": { + "line": 1, + "column": 25 + } + }, + "body": [] + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-yield/yield-lexical-declaration/actual.js b/test/fixtures/esprima/es2015-yield/yield-lexical-declaration/actual.js new file mode 100644 index 0000000000..f2faf618ec --- /dev/null +++ b/test/fixtures/esprima/es2015-yield/yield-lexical-declaration/actual.js @@ -0,0 +1 @@ +let yield = 42; diff --git a/test/fixtures/esprima/es2015-yield/yield-lexical-declaration/expected.json b/test/fixtures/esprima/es2015-yield/yield-lexical-declaration/expected.json new file mode 100644 index 0000000000..dec93c479a --- /dev/null +++ b/test/fixtures/esprima/es2015-yield/yield-lexical-declaration/expected.json @@ -0,0 +1,100 @@ +{ + "type": "File", + "start": 0, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "sourceType": "script", + "body": [ + { + "type": "VariableDeclaration", + "start": 0, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 4, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "id": { + "type": "Identifier", + "start": 4, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "name": "yield" + }, + "init": { + "type": "Literal", + "start": 12, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 12 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "value": 42, + "rawValue": 42, + "raw": "42" + } + } + ], + "kind": "var" + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-yield/yield-member-expression-property/actual.js b/test/fixtures/esprima/es2015-yield/yield-member-expression-property/actual.js new file mode 100644 index 0000000000..aa6e4c82e6 --- /dev/null +++ b/test/fixtures/esprima/es2015-yield/yield-member-expression-property/actual.js @@ -0,0 +1 @@ +function *g() { yield obj.yield; } diff --git a/test/fixtures/esprima/es2015-yield/yield-member-expression-property/expected.json b/test/fixtures/esprima/es2015-yield/yield-member-expression-property/expected.json new file mode 100644 index 0000000000..091dac5d5d --- /dev/null +++ b/test/fixtures/esprima/es2015-yield/yield-member-expression-property/expected.json @@ -0,0 +1,163 @@ +{ + "type": "File", + "start": 0, + "end": 34, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 34 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 34, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 34 + } + }, + "sourceType": "script", + "body": [ + { + "type": "FunctionDeclaration", + "start": 0, + "end": 34, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 34 + } + }, + "id": { + "type": "Identifier", + "start": 10, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "name": "g" + }, + "generator": true, + "expression": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 14, + "end": 34, + "loc": { + "start": { + "line": 1, + "column": 14 + }, + "end": { + "line": 1, + "column": 34 + } + }, + "body": [ + { + "type": "ExpressionStatement", + "start": 16, + "end": 32, + "loc": { + "start": { + "line": 1, + "column": 16 + }, + "end": { + "line": 1, + "column": 32 + } + }, + "expression": { + "type": "YieldExpression", + "start": 16, + "end": 31, + "loc": { + "start": { + "line": 1, + "column": 16 + }, + "end": { + "line": 1, + "column": 31 + } + }, + "delegate": false, + "argument": { + "type": "MemberExpression", + "start": 22, + "end": 31, + "loc": { + "start": { + "line": 1, + "column": 22 + }, + "end": { + "line": 1, + "column": 31 + } + }, + "object": { + "type": "Identifier", + "start": 22, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 22 + }, + "end": { + "line": 1, + "column": 25 + } + }, + "name": "obj" + }, + "property": { + "type": "Identifier", + "start": 26, + "end": 31, + "loc": { + "start": { + "line": 1, + "column": 26 + }, + "end": { + "line": 1, + "column": 31 + } + }, + "name": "yield" + }, + "computed": false + } + } + } + ] + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-yield/yield-method/actual.js b/test/fixtures/esprima/es2015-yield/yield-method/actual.js new file mode 100644 index 0000000000..fe2070884e --- /dev/null +++ b/test/fixtures/esprima/es2015-yield/yield-method/actual.js @@ -0,0 +1 @@ +({ yield() {} }) diff --git a/test/fixtures/esprima/es2015-yield/yield-method/expected.json b/test/fixtures/esprima/es2015-yield/yield-method/expected.json new file mode 100644 index 0000000000..7a4f9cbf39 --- /dev/null +++ b/test/fixtures/esprima/es2015-yield/yield-method/expected.json @@ -0,0 +1,136 @@ +{ + "type": "File", + "start": 0, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "expression": { + "type": "ObjectExpression", + "start": 1, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "properties": [ + { + "type": "Property", + "start": 3, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 3 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "method": true, + "shorthand": false, + "computed": false, + "key": { + "type": "Identifier", + "start": 3, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 3 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "name": "yield" + }, + "kind": "init", + "value": { + "type": "FunctionExpression", + "start": 8, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "id": null, + "generator": false, + "expression": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 11, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 11 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "body": [] + } + } + } + ], + "parenthesizedExpression": true + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-yield/yield-parameter-object-pattern/actual.js b/test/fixtures/esprima/es2015-yield/yield-parameter-object-pattern/actual.js new file mode 100644 index 0000000000..fe3cb6d854 --- /dev/null +++ b/test/fixtures/esprima/es2015-yield/yield-parameter-object-pattern/actual.js @@ -0,0 +1 @@ +function f({yield: y}){} diff --git a/test/fixtures/esprima/es2015-yield/yield-parameter-object-pattern/expected.json b/test/fixtures/esprima/es2015-yield/yield-parameter-object-pattern/expected.json new file mode 100644 index 0000000000..68bee782bd --- /dev/null +++ b/test/fixtures/esprima/es2015-yield/yield-parameter-object-pattern/expected.json @@ -0,0 +1,152 @@ +{ + "type": "File", + "start": 0, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 24 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 24 + } + }, + "sourceType": "script", + "body": [ + { + "type": "FunctionDeclaration", + "start": 0, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 24 + } + }, + "id": { + "type": "Identifier", + "start": 9, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "name": "f" + }, + "generator": false, + "expression": false, + "params": [ + { + "type": "ObjectPattern", + "start": 11, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 11 + }, + "end": { + "line": 1, + "column": 21 + } + }, + "properties": [ + { + "type": "Property", + "start": 12, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 12 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "method": false, + "shorthand": false, + "computed": false, + "key": { + "type": "Identifier", + "start": 12, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 12 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "name": "yield" + }, + "value": { + "type": "Identifier", + "start": 19, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 19 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "name": "y" + }, + "kind": "init" + } + ] + } + ], + "body": { + "type": "BlockStatement", + "start": 22, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 22 + }, + "end": { + "line": 1, + "column": 24 + } + }, + "body": [] + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-yield/yield-rest-parameter/actual.js b/test/fixtures/esprima/es2015-yield/yield-rest-parameter/actual.js new file mode 100644 index 0000000000..0a895a5c11 --- /dev/null +++ b/test/fixtures/esprima/es2015-yield/yield-rest-parameter/actual.js @@ -0,0 +1 @@ +function f(...yield) {} diff --git a/test/fixtures/esprima/es2015-yield/yield-rest-parameter/expected.json b/test/fixtures/esprima/es2015-yield/yield-rest-parameter/expected.json new file mode 100644 index 0000000000..bfd5f8f9d2 --- /dev/null +++ b/test/fixtures/esprima/es2015-yield/yield-rest-parameter/expected.json @@ -0,0 +1,115 @@ +{ + "type": "File", + "start": 0, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "sourceType": "script", + "body": [ + { + "type": "FunctionDeclaration", + "start": 0, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "id": { + "type": "Identifier", + "start": 9, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "name": "f" + }, + "generator": false, + "expression": false, + "params": [ + { + "type": "RestElement", + "start": 11, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 11 + }, + "end": { + "line": 1, + "column": 19 + } + }, + "argument": { + "type": "Identifier", + "start": 14, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 14 + }, + "end": { + "line": 1, + "column": 19 + } + }, + "name": "yield" + } + } + ], + "body": { + "type": "BlockStatement", + "start": 21, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 21 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "body": [] + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-yield/yield-strict-binding-property/actual.js b/test/fixtures/esprima/es2015-yield/yield-strict-binding-property/actual.js new file mode 100644 index 0000000000..b90497633b --- /dev/null +++ b/test/fixtures/esprima/es2015-yield/yield-strict-binding-property/actual.js @@ -0,0 +1 @@ +"use strict"; var { yield: x } = foo; diff --git a/test/fixtures/esprima/es2015-yield/yield-strict-binding-property/expected.json b/test/fixtures/esprima/es2015-yield/yield-strict-binding-property/expected.json new file mode 100644 index 0000000000..cff6332edb --- /dev/null +++ b/test/fixtures/esprima/es2015-yield/yield-strict-binding-property/expected.json @@ -0,0 +1,183 @@ +{ + "type": "File", + "start": 0, + "end": 37, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 37 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 37, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 37 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "expression": { + "type": "Literal", + "start": 0, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "value": "use strict", + "rawValue": "use strict", + "raw": "\"use strict\"" + } + }, + { + "type": "VariableDeclaration", + "start": 14, + "end": 37, + "loc": { + "start": { + "line": 1, + "column": 14 + }, + "end": { + "line": 1, + "column": 37 + } + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 18, + "end": 36, + "loc": { + "start": { + "line": 1, + "column": 18 + }, + "end": { + "line": 1, + "column": 36 + } + }, + "id": { + "type": "ObjectPattern", + "start": 18, + "end": 30, + "loc": { + "start": { + "line": 1, + "column": 18 + }, + "end": { + "line": 1, + "column": 30 + } + }, + "properties": [ + { + "type": "Property", + "start": 20, + "end": 28, + "loc": { + "start": { + "line": 1, + "column": 20 + }, + "end": { + "line": 1, + "column": 28 + } + }, + "method": false, + "shorthand": false, + "computed": false, + "key": { + "type": "Identifier", + "start": 20, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 20 + }, + "end": { + "line": 1, + "column": 25 + } + }, + "name": "yield" + }, + "value": { + "type": "Identifier", + "start": 27, + "end": 28, + "loc": { + "start": { + "line": 1, + "column": 27 + }, + "end": { + "line": 1, + "column": 28 + } + }, + "name": "x" + }, + "kind": "init" + } + ] + }, + "init": { + "type": "Identifier", + "start": 33, + "end": 36, + "loc": { + "start": { + "line": 1, + "column": 33 + }, + "end": { + "line": 1, + "column": 36 + } + }, + "name": "foo" + } + } + ], + "kind": "var" + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-yield/yield-strict-method/actual.js b/test/fixtures/esprima/es2015-yield/yield-strict-method/actual.js new file mode 100644 index 0000000000..a24661b935 --- /dev/null +++ b/test/fixtures/esprima/es2015-yield/yield-strict-method/actual.js @@ -0,0 +1 @@ +"use strict"; ({ yield() {} }) diff --git a/test/fixtures/esprima/es2015-yield/yield-strict-method/expected.json b/test/fixtures/esprima/es2015-yield/yield-strict-method/expected.json new file mode 100644 index 0000000000..73ba30aca8 --- /dev/null +++ b/test/fixtures/esprima/es2015-yield/yield-strict-method/expected.json @@ -0,0 +1,169 @@ +{ + "type": "File", + "start": 0, + "end": 30, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 30 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 30, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 30 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "expression": { + "type": "Literal", + "start": 0, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "value": "use strict", + "rawValue": "use strict", + "raw": "\"use strict\"" + } + }, + { + "type": "ExpressionStatement", + "start": 14, + "end": 30, + "loc": { + "start": { + "line": 1, + "column": 14 + }, + "end": { + "line": 1, + "column": 30 + } + }, + "expression": { + "type": "ObjectExpression", + "start": 15, + "end": 29, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 29 + } + }, + "properties": [ + { + "type": "Property", + "start": 17, + "end": 27, + "loc": { + "start": { + "line": 1, + "column": 17 + }, + "end": { + "line": 1, + "column": 27 + } + }, + "method": true, + "shorthand": false, + "computed": false, + "key": { + "type": "Identifier", + "start": 17, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 17 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "name": "yield" + }, + "kind": "init", + "value": { + "type": "FunctionExpression", + "start": 22, + "end": 27, + "loc": { + "start": { + "line": 1, + "column": 22 + }, + "end": { + "line": 1, + "column": 27 + } + }, + "id": null, + "generator": false, + "expression": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 25, + "end": 27, + "loc": { + "start": { + "line": 1, + "column": 25 + }, + "end": { + "line": 1, + "column": 27 + } + }, + "body": [] + } + } + } + ], + "parenthesizedExpression": true + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-yield/yield-super-property/actual.js b/test/fixtures/esprima/es2015-yield/yield-super-property/actual.js new file mode 100644 index 0000000000..d3a2c77709 --- /dev/null +++ b/test/fixtures/esprima/es2015-yield/yield-super-property/actual.js @@ -0,0 +1 @@ +class A extends B { X() { super.yield } } diff --git a/test/fixtures/esprima/es2015-yield/yield-super-property/expected.json b/test/fixtures/esprima/es2015-yield/yield-super-property/expected.json new file mode 100644 index 0000000000..4e179ca792 --- /dev/null +++ b/test/fixtures/esprima/es2015-yield/yield-super-property/expected.json @@ -0,0 +1,229 @@ +{ + "type": "File", + "start": 0, + "end": 41, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 41 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 41, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 41 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ClassDeclaration", + "start": 0, + "end": 41, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 41 + } + }, + "id": { + "type": "Identifier", + "start": 6, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "name": "A" + }, + "superClass": { + "type": "Identifier", + "start": 16, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 16 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "name": "B" + }, + "body": { + "type": "ClassBody", + "start": 18, + "end": 41, + "loc": { + "start": { + "line": 1, + "column": 18 + }, + "end": { + "line": 1, + "column": 41 + } + }, + "body": [ + { + "type": "MethodDefinition", + "start": 20, + "end": 39, + "loc": { + "start": { + "line": 1, + "column": 20 + }, + "end": { + "line": 1, + "column": 39 + } + }, + "computed": false, + "key": { + "type": "Identifier", + "start": 20, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 20 + }, + "end": { + "line": 1, + "column": 21 + } + }, + "name": "X" + }, + "static": false, + "kind": "method", + "value": { + "type": "FunctionExpression", + "start": 21, + "end": 39, + "loc": { + "start": { + "line": 1, + "column": 21 + }, + "end": { + "line": 1, + "column": 39 + } + }, + "id": null, + "generator": false, + "expression": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 24, + "end": 39, + "loc": { + "start": { + "line": 1, + "column": 24 + }, + "end": { + "line": 1, + "column": 39 + } + }, + "body": [ + { + "type": "ExpressionStatement", + "start": 26, + "end": 37, + "loc": { + "start": { + "line": 1, + "column": 26 + }, + "end": { + "line": 1, + "column": 37 + } + }, + "expression": { + "type": "MemberExpression", + "start": 26, + "end": 37, + "loc": { + "start": { + "line": 1, + "column": 26 + }, + "end": { + "line": 1, + "column": 37 + } + }, + "object": { + "type": "Super", + "start": 26, + "end": 31, + "loc": { + "start": { + "line": 1, + "column": 26 + }, + "end": { + "line": 1, + "column": 31 + } + } + }, + "property": { + "type": "Identifier", + "start": 32, + "end": 37, + "loc": { + "start": { + "line": 1, + "column": 32 + }, + "end": { + "line": 1, + "column": 37 + } + }, + "name": "yield" + }, + "computed": false + } + } + ] + } + } + } + ] + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-yield/yield-variable-declaration/actual.js b/test/fixtures/esprima/es2015-yield/yield-variable-declaration/actual.js new file mode 100644 index 0000000000..1d02d76086 --- /dev/null +++ b/test/fixtures/esprima/es2015-yield/yield-variable-declaration/actual.js @@ -0,0 +1 @@ +var yield; diff --git a/test/fixtures/esprima/es2015-yield/yield-variable-declaration/expected.json b/test/fixtures/esprima/es2015-yield/yield-variable-declaration/expected.json new file mode 100644 index 0000000000..2c21f2ba38 --- /dev/null +++ b/test/fixtures/esprima/es2015-yield/yield-variable-declaration/expected.json @@ -0,0 +1,83 @@ +{ + "type": "File", + "start": 0, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "sourceType": "script", + "body": [ + { + "type": "VariableDeclaration", + "start": 0, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 4, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "id": { + "type": "Identifier", + "start": 4, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "name": "yield" + }, + "init": null + } + ], + "kind": "var" + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-yield/yield-yield-expression-delegate/actual.js b/test/fixtures/esprima/es2015-yield/yield-yield-expression-delegate/actual.js new file mode 100644 index 0000000000..800c8c7f34 --- /dev/null +++ b/test/fixtures/esprima/es2015-yield/yield-yield-expression-delegate/actual.js @@ -0,0 +1 @@ +function *g() { yield *yield } diff --git a/test/fixtures/esprima/es2015-yield/yield-yield-expression-delegate/expected.json b/test/fixtures/esprima/es2015-yield/yield-yield-expression-delegate/expected.json new file mode 100644 index 0000000000..be7cde28c8 --- /dev/null +++ b/test/fixtures/esprima/es2015-yield/yield-yield-expression-delegate/expected.json @@ -0,0 +1,132 @@ +{ + "type": "File", + "start": 0, + "end": 30, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 30 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 30, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 30 + } + }, + "sourceType": "script", + "body": [ + { + "type": "FunctionDeclaration", + "start": 0, + "end": 30, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 30 + } + }, + "id": { + "type": "Identifier", + "start": 10, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "name": "g" + }, + "generator": true, + "expression": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 14, + "end": 30, + "loc": { + "start": { + "line": 1, + "column": 14 + }, + "end": { + "line": 1, + "column": 30 + } + }, + "body": [ + { + "type": "ExpressionStatement", + "start": 16, + "end": 28, + "loc": { + "start": { + "line": 1, + "column": 16 + }, + "end": { + "line": 1, + "column": 28 + } + }, + "expression": { + "type": "YieldExpression", + "start": 16, + "end": 28, + "loc": { + "start": { + "line": 1, + "column": 16 + }, + "end": { + "line": 1, + "column": 28 + } + }, + "delegate": true, + "argument": { + "type": "YieldExpression", + "start": 23, + "end": 28, + "loc": { + "start": { + "line": 1, + "column": 23 + }, + "end": { + "line": 1, + "column": 28 + } + }, + "delegate": false, + "argument": null + } + } + } + ] + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-yield/yield-yield-expression/actual.js b/test/fixtures/esprima/es2015-yield/yield-yield-expression/actual.js new file mode 100644 index 0000000000..205c792662 --- /dev/null +++ b/test/fixtures/esprima/es2015-yield/yield-yield-expression/actual.js @@ -0,0 +1 @@ +function *g() { yield yield } diff --git a/test/fixtures/esprima/es2015-yield/yield-yield-expression/expected.json b/test/fixtures/esprima/es2015-yield/yield-yield-expression/expected.json new file mode 100644 index 0000000000..299cd23813 --- /dev/null +++ b/test/fixtures/esprima/es2015-yield/yield-yield-expression/expected.json @@ -0,0 +1,132 @@ +{ + "type": "File", + "start": 0, + "end": 29, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 29 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 29, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 29 + } + }, + "sourceType": "script", + "body": [ + { + "type": "FunctionDeclaration", + "start": 0, + "end": 29, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 29 + } + }, + "id": { + "type": "Identifier", + "start": 10, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "name": "g" + }, + "generator": true, + "expression": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 14, + "end": 29, + "loc": { + "start": { + "line": 1, + "column": 14 + }, + "end": { + "line": 1, + "column": 29 + } + }, + "body": [ + { + "type": "ExpressionStatement", + "start": 16, + "end": 27, + "loc": { + "start": { + "line": 1, + "column": 16 + }, + "end": { + "line": 1, + "column": 27 + } + }, + "expression": { + "type": "YieldExpression", + "start": 16, + "end": 27, + "loc": { + "start": { + "line": 1, + "column": 16 + }, + "end": { + "line": 1, + "column": 27 + } + }, + "delegate": false, + "argument": { + "type": "YieldExpression", + "start": 22, + "end": 27, + "loc": { + "start": { + "line": 1, + "column": 22 + }, + "end": { + "line": 1, + "column": 27 + } + }, + "delegate": false, + "argument": null + } + } + } + ] + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/expression-additive/migrated_0000/actual.js b/test/fixtures/esprima/expression-additive/migrated_0000/actual.js new file mode 100644 index 0000000000..beeb1e5903 --- /dev/null +++ b/test/fixtures/esprima/expression-additive/migrated_0000/actual.js @@ -0,0 +1 @@ +x + y diff --git a/test/fixtures/esprima/expression-additive/migrated_0000/expected.json b/test/fixtures/esprima/expression-additive/migrated_0000/expected.json new file mode 100644 index 0000000000..951a2c8573 --- /dev/null +++ b/test/fixtures/esprima/expression-additive/migrated_0000/expected.json @@ -0,0 +1,96 @@ +{ + "type": "File", + "start": 0, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "expression": { + "type": "BinaryExpression", + "start": 0, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "left": { + "type": "Identifier", + "start": 0, + "end": 1, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + } + }, + "name": "x" + }, + "operator": "+", + "right": { + "type": "Identifier", + "start": 4, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "name": "y" + } + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/expression-additive/migrated_0001/actual.js b/test/fixtures/esprima/expression-additive/migrated_0001/actual.js new file mode 100644 index 0000000000..82b2d8de84 --- /dev/null +++ b/test/fixtures/esprima/expression-additive/migrated_0001/actual.js @@ -0,0 +1 @@ +x - y diff --git a/test/fixtures/esprima/expression-additive/migrated_0001/expected.json b/test/fixtures/esprima/expression-additive/migrated_0001/expected.json new file mode 100644 index 0000000000..4be8cd12bf --- /dev/null +++ b/test/fixtures/esprima/expression-additive/migrated_0001/expected.json @@ -0,0 +1,96 @@ +{ + "type": "File", + "start": 0, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "expression": { + "type": "BinaryExpression", + "start": 0, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "left": { + "type": "Identifier", + "start": 0, + "end": 1, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + } + }, + "name": "x" + }, + "operator": "-", + "right": { + "type": "Identifier", + "start": 4, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "name": "y" + } + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/expression-additive/migrated_0002/actual.js b/test/fixtures/esprima/expression-additive/migrated_0002/actual.js new file mode 100644 index 0000000000..dcc0e169ca --- /dev/null +++ b/test/fixtures/esprima/expression-additive/migrated_0002/actual.js @@ -0,0 +1 @@ +"use strict" + 42 diff --git a/test/fixtures/esprima/expression-additive/migrated_0002/expected.json b/test/fixtures/esprima/expression-additive/migrated_0002/expected.json new file mode 100644 index 0000000000..d3ad9d674b --- /dev/null +++ b/test/fixtures/esprima/expression-additive/migrated_0002/expected.json @@ -0,0 +1,100 @@ +{ + "type": "File", + "start": 0, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "expression": { + "type": "BinaryExpression", + "start": 0, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "left": { + "type": "Literal", + "start": 0, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "value": "use strict", + "rawValue": "use strict", + "raw": "\"use strict\"" + }, + "operator": "+", + "right": { + "type": "Literal", + "start": 15, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "value": 42, + "rawValue": 42, + "raw": "42" + } + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/expression-assignment/migrated_0000/actual.js b/test/fixtures/esprima/expression-assignment/migrated_0000/actual.js new file mode 100644 index 0000000000..2d76abaa89 --- /dev/null +++ b/test/fixtures/esprima/expression-assignment/migrated_0000/actual.js @@ -0,0 +1 @@ +x = 42 diff --git a/test/fixtures/esprima/expression-assignment/migrated_0000/expected.json b/test/fixtures/esprima/expression-assignment/migrated_0000/expected.json new file mode 100644 index 0000000000..dcfe85d992 --- /dev/null +++ b/test/fixtures/esprima/expression-assignment/migrated_0000/expected.json @@ -0,0 +1,98 @@ +{ + "type": "File", + "start": 0, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "expression": { + "type": "AssignmentExpression", + "start": 0, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "operator": "=", + "left": { + "type": "Identifier", + "start": 0, + "end": 1, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + } + }, + "name": "x" + }, + "right": { + "type": "Literal", + "start": 4, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "value": 42, + "rawValue": 42, + "raw": "42" + } + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/expression-assignment/migrated_0001/actual.js b/test/fixtures/esprima/expression-assignment/migrated_0001/actual.js new file mode 100644 index 0000000000..ec77db7c41 --- /dev/null +++ b/test/fixtures/esprima/expression-assignment/migrated_0001/actual.js @@ -0,0 +1 @@ +eval = 42 diff --git a/test/fixtures/esprima/expression-assignment/migrated_0001/expected.json b/test/fixtures/esprima/expression-assignment/migrated_0001/expected.json new file mode 100644 index 0000000000..32e9683fad --- /dev/null +++ b/test/fixtures/esprima/expression-assignment/migrated_0001/expected.json @@ -0,0 +1,98 @@ +{ + "type": "File", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "expression": { + "type": "AssignmentExpression", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "operator": "=", + "left": { + "type": "Identifier", + "start": 0, + "end": 4, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 4 + } + }, + "name": "eval" + }, + "right": { + "type": "Literal", + "start": 7, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "value": 42, + "rawValue": 42, + "raw": "42" + } + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/expression-assignment/migrated_0002/actual.js b/test/fixtures/esprima/expression-assignment/migrated_0002/actual.js new file mode 100644 index 0000000000..8915ea9874 --- /dev/null +++ b/test/fixtures/esprima/expression-assignment/migrated_0002/actual.js @@ -0,0 +1 @@ +arguments = 42 diff --git a/test/fixtures/esprima/expression-assignment/migrated_0002/expected.json b/test/fixtures/esprima/expression-assignment/migrated_0002/expected.json new file mode 100644 index 0000000000..aadc603158 --- /dev/null +++ b/test/fixtures/esprima/expression-assignment/migrated_0002/expected.json @@ -0,0 +1,98 @@ +{ + "type": "File", + "start": 0, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "expression": { + "type": "AssignmentExpression", + "start": 0, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "operator": "=", + "left": { + "type": "Identifier", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "name": "arguments" + }, + "right": { + "type": "Literal", + "start": 12, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 12 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "value": 42, + "rawValue": 42, + "raw": "42" + } + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/expression-assignment/migrated_0003/actual.js b/test/fixtures/esprima/expression-assignment/migrated_0003/actual.js new file mode 100644 index 0000000000..800fe89767 --- /dev/null +++ b/test/fixtures/esprima/expression-assignment/migrated_0003/actual.js @@ -0,0 +1 @@ +x *= 42 diff --git a/test/fixtures/esprima/expression-assignment/migrated_0003/expected.json b/test/fixtures/esprima/expression-assignment/migrated_0003/expected.json new file mode 100644 index 0000000000..c68b13b4a8 --- /dev/null +++ b/test/fixtures/esprima/expression-assignment/migrated_0003/expected.json @@ -0,0 +1,98 @@ +{ + "type": "File", + "start": 0, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "expression": { + "type": "AssignmentExpression", + "start": 0, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "operator": "*=", + "left": { + "type": "Identifier", + "start": 0, + "end": 1, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + } + }, + "name": "x" + }, + "right": { + "type": "Literal", + "start": 5, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "value": 42, + "rawValue": 42, + "raw": "42" + } + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/expression-assignment/migrated_0004/actual.js b/test/fixtures/esprima/expression-assignment/migrated_0004/actual.js new file mode 100644 index 0000000000..e6d4af128c --- /dev/null +++ b/test/fixtures/esprima/expression-assignment/migrated_0004/actual.js @@ -0,0 +1 @@ +x /= 42 diff --git a/test/fixtures/esprima/expression-assignment/migrated_0004/expected.json b/test/fixtures/esprima/expression-assignment/migrated_0004/expected.json new file mode 100644 index 0000000000..2a2e320c76 --- /dev/null +++ b/test/fixtures/esprima/expression-assignment/migrated_0004/expected.json @@ -0,0 +1,98 @@ +{ + "type": "File", + "start": 0, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "expression": { + "type": "AssignmentExpression", + "start": 0, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "operator": "/=", + "left": { + "type": "Identifier", + "start": 0, + "end": 1, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + } + }, + "name": "x" + }, + "right": { + "type": "Literal", + "start": 5, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "value": 42, + "rawValue": 42, + "raw": "42" + } + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/expression-assignment/migrated_0005/actual.js b/test/fixtures/esprima/expression-assignment/migrated_0005/actual.js new file mode 100644 index 0000000000..1fdb8c843b --- /dev/null +++ b/test/fixtures/esprima/expression-assignment/migrated_0005/actual.js @@ -0,0 +1 @@ +x %= 42 diff --git a/test/fixtures/esprima/expression-assignment/migrated_0005/expected.json b/test/fixtures/esprima/expression-assignment/migrated_0005/expected.json new file mode 100644 index 0000000000..f61cd91960 --- /dev/null +++ b/test/fixtures/esprima/expression-assignment/migrated_0005/expected.json @@ -0,0 +1,98 @@ +{ + "type": "File", + "start": 0, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "expression": { + "type": "AssignmentExpression", + "start": 0, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "operator": "%=", + "left": { + "type": "Identifier", + "start": 0, + "end": 1, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + } + }, + "name": "x" + }, + "right": { + "type": "Literal", + "start": 5, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "value": 42, + "rawValue": 42, + "raw": "42" + } + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/expression-assignment/migrated_0006/actual.js b/test/fixtures/esprima/expression-assignment/migrated_0006/actual.js new file mode 100644 index 0000000000..76d0126c78 --- /dev/null +++ b/test/fixtures/esprima/expression-assignment/migrated_0006/actual.js @@ -0,0 +1 @@ +x += 42 diff --git a/test/fixtures/esprima/expression-assignment/migrated_0006/expected.json b/test/fixtures/esprima/expression-assignment/migrated_0006/expected.json new file mode 100644 index 0000000000..d87bd7221e --- /dev/null +++ b/test/fixtures/esprima/expression-assignment/migrated_0006/expected.json @@ -0,0 +1,98 @@ +{ + "type": "File", + "start": 0, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "expression": { + "type": "AssignmentExpression", + "start": 0, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "operator": "+=", + "left": { + "type": "Identifier", + "start": 0, + "end": 1, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + } + }, + "name": "x" + }, + "right": { + "type": "Literal", + "start": 5, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "value": 42, + "rawValue": 42, + "raw": "42" + } + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/expression-assignment/migrated_0007/actual.js b/test/fixtures/esprima/expression-assignment/migrated_0007/actual.js new file mode 100644 index 0000000000..9efddfe799 --- /dev/null +++ b/test/fixtures/esprima/expression-assignment/migrated_0007/actual.js @@ -0,0 +1 @@ +x -= 42 diff --git a/test/fixtures/esprima/expression-assignment/migrated_0007/expected.json b/test/fixtures/esprima/expression-assignment/migrated_0007/expected.json new file mode 100644 index 0000000000..58ac4f76d5 --- /dev/null +++ b/test/fixtures/esprima/expression-assignment/migrated_0007/expected.json @@ -0,0 +1,98 @@ +{ + "type": "File", + "start": 0, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "expression": { + "type": "AssignmentExpression", + "start": 0, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "operator": "-=", + "left": { + "type": "Identifier", + "start": 0, + "end": 1, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + } + }, + "name": "x" + }, + "right": { + "type": "Literal", + "start": 5, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "value": 42, + "rawValue": 42, + "raw": "42" + } + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/expression-assignment/migrated_0008/actual.js b/test/fixtures/esprima/expression-assignment/migrated_0008/actual.js new file mode 100644 index 0000000000..0ec003b342 --- /dev/null +++ b/test/fixtures/esprima/expression-assignment/migrated_0008/actual.js @@ -0,0 +1 @@ +x <<= 42 diff --git a/test/fixtures/esprima/expression-assignment/migrated_0008/expected.json b/test/fixtures/esprima/expression-assignment/migrated_0008/expected.json new file mode 100644 index 0000000000..6aec1fd6ae --- /dev/null +++ b/test/fixtures/esprima/expression-assignment/migrated_0008/expected.json @@ -0,0 +1,98 @@ +{ + "type": "File", + "start": 0, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "expression": { + "type": "AssignmentExpression", + "start": 0, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "operator": "<<=", + "left": { + "type": "Identifier", + "start": 0, + "end": 1, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + } + }, + "name": "x" + }, + "right": { + "type": "Literal", + "start": 6, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "value": 42, + "rawValue": 42, + "raw": "42" + } + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/expression-assignment/migrated_0009/actual.js b/test/fixtures/esprima/expression-assignment/migrated_0009/actual.js new file mode 100644 index 0000000000..985184e363 --- /dev/null +++ b/test/fixtures/esprima/expression-assignment/migrated_0009/actual.js @@ -0,0 +1 @@ +x >>= 42 diff --git a/test/fixtures/esprima/expression-assignment/migrated_0009/expected.json b/test/fixtures/esprima/expression-assignment/migrated_0009/expected.json new file mode 100644 index 0000000000..2afa7f1ab0 --- /dev/null +++ b/test/fixtures/esprima/expression-assignment/migrated_0009/expected.json @@ -0,0 +1,98 @@ +{ + "type": "File", + "start": 0, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "expression": { + "type": "AssignmentExpression", + "start": 0, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "operator": ">>=", + "left": { + "type": "Identifier", + "start": 0, + "end": 1, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + } + }, + "name": "x" + }, + "right": { + "type": "Literal", + "start": 6, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "value": 42, + "rawValue": 42, + "raw": "42" + } + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/expression-assignment/migrated_0010/actual.js b/test/fixtures/esprima/expression-assignment/migrated_0010/actual.js new file mode 100644 index 0000000000..4ddbf45b90 --- /dev/null +++ b/test/fixtures/esprima/expression-assignment/migrated_0010/actual.js @@ -0,0 +1 @@ +x >>>= 42 diff --git a/test/fixtures/esprima/expression-assignment/migrated_0010/expected.json b/test/fixtures/esprima/expression-assignment/migrated_0010/expected.json new file mode 100644 index 0000000000..34ae7fde25 --- /dev/null +++ b/test/fixtures/esprima/expression-assignment/migrated_0010/expected.json @@ -0,0 +1,98 @@ +{ + "type": "File", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "expression": { + "type": "AssignmentExpression", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "operator": ">>>=", + "left": { + "type": "Identifier", + "start": 0, + "end": 1, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + } + }, + "name": "x" + }, + "right": { + "type": "Literal", + "start": 7, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "value": 42, + "rawValue": 42, + "raw": "42" + } + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/expression-assignment/migrated_0011/actual.js b/test/fixtures/esprima/expression-assignment/migrated_0011/actual.js new file mode 100644 index 0000000000..021d2208ec --- /dev/null +++ b/test/fixtures/esprima/expression-assignment/migrated_0011/actual.js @@ -0,0 +1 @@ +x &= 42 diff --git a/test/fixtures/esprima/expression-assignment/migrated_0011/expected.json b/test/fixtures/esprima/expression-assignment/migrated_0011/expected.json new file mode 100644 index 0000000000..a97d4cb79e --- /dev/null +++ b/test/fixtures/esprima/expression-assignment/migrated_0011/expected.json @@ -0,0 +1,98 @@ +{ + "type": "File", + "start": 0, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "expression": { + "type": "AssignmentExpression", + "start": 0, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "operator": "&=", + "left": { + "type": "Identifier", + "start": 0, + "end": 1, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + } + }, + "name": "x" + }, + "right": { + "type": "Literal", + "start": 5, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "value": 42, + "rawValue": 42, + "raw": "42" + } + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/expression-assignment/migrated_0012/actual.js b/test/fixtures/esprima/expression-assignment/migrated_0012/actual.js new file mode 100644 index 0000000000..77975a2659 --- /dev/null +++ b/test/fixtures/esprima/expression-assignment/migrated_0012/actual.js @@ -0,0 +1 @@ +x ^= 42 diff --git a/test/fixtures/esprima/expression-assignment/migrated_0012/expected.json b/test/fixtures/esprima/expression-assignment/migrated_0012/expected.json new file mode 100644 index 0000000000..7a092cae1b --- /dev/null +++ b/test/fixtures/esprima/expression-assignment/migrated_0012/expected.json @@ -0,0 +1,98 @@ +{ + "type": "File", + "start": 0, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "expression": { + "type": "AssignmentExpression", + "start": 0, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "operator": "^=", + "left": { + "type": "Identifier", + "start": 0, + "end": 1, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + } + }, + "name": "x" + }, + "right": { + "type": "Literal", + "start": 5, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "value": 42, + "rawValue": 42, + "raw": "42" + } + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/expression-assignment/migrated_0013/actual.js b/test/fixtures/esprima/expression-assignment/migrated_0013/actual.js new file mode 100644 index 0000000000..8bbad8cd9f --- /dev/null +++ b/test/fixtures/esprima/expression-assignment/migrated_0013/actual.js @@ -0,0 +1 @@ +x |= 42 diff --git a/test/fixtures/esprima/expression-assignment/migrated_0013/expected.json b/test/fixtures/esprima/expression-assignment/migrated_0013/expected.json new file mode 100644 index 0000000000..0c297787a4 --- /dev/null +++ b/test/fixtures/esprima/expression-assignment/migrated_0013/expected.json @@ -0,0 +1,98 @@ +{ + "type": "File", + "start": 0, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "expression": { + "type": "AssignmentExpression", + "start": 0, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "operator": "|=", + "left": { + "type": "Identifier", + "start": 0, + "end": 1, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + } + }, + "name": "x" + }, + "right": { + "type": "Literal", + "start": 5, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "value": 42, + "rawValue": 42, + "raw": "42" + } + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/expression-binary-bitwise/migrated_0000/actual.js b/test/fixtures/esprima/expression-binary-bitwise/migrated_0000/actual.js new file mode 100644 index 0000000000..9d87069548 --- /dev/null +++ b/test/fixtures/esprima/expression-binary-bitwise/migrated_0000/actual.js @@ -0,0 +1 @@ +x & y diff --git a/test/fixtures/esprima/expression-binary-bitwise/migrated_0000/expected.json b/test/fixtures/esprima/expression-binary-bitwise/migrated_0000/expected.json new file mode 100644 index 0000000000..a21f7900f7 --- /dev/null +++ b/test/fixtures/esprima/expression-binary-bitwise/migrated_0000/expected.json @@ -0,0 +1,96 @@ +{ + "type": "File", + "start": 0, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "expression": { + "type": "BinaryExpression", + "start": 0, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "left": { + "type": "Identifier", + "start": 0, + "end": 1, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + } + }, + "name": "x" + }, + "operator": "&", + "right": { + "type": "Identifier", + "start": 4, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "name": "y" + } + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/expression-binary-bitwise/migrated_0001/actual.js b/test/fixtures/esprima/expression-binary-bitwise/migrated_0001/actual.js new file mode 100644 index 0000000000..460a89ecfa --- /dev/null +++ b/test/fixtures/esprima/expression-binary-bitwise/migrated_0001/actual.js @@ -0,0 +1 @@ +x ^ y diff --git a/test/fixtures/esprima/expression-binary-bitwise/migrated_0001/expected.json b/test/fixtures/esprima/expression-binary-bitwise/migrated_0001/expected.json new file mode 100644 index 0000000000..9ff129d06b --- /dev/null +++ b/test/fixtures/esprima/expression-binary-bitwise/migrated_0001/expected.json @@ -0,0 +1,96 @@ +{ + "type": "File", + "start": 0, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "expression": { + "type": "BinaryExpression", + "start": 0, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "left": { + "type": "Identifier", + "start": 0, + "end": 1, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + } + }, + "name": "x" + }, + "operator": "^", + "right": { + "type": "Identifier", + "start": 4, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "name": "y" + } + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/expression-binary-bitwise/migrated_0002/actual.js b/test/fixtures/esprima/expression-binary-bitwise/migrated_0002/actual.js new file mode 100644 index 0000000000..07736e61c3 --- /dev/null +++ b/test/fixtures/esprima/expression-binary-bitwise/migrated_0002/actual.js @@ -0,0 +1 @@ +x | y diff --git a/test/fixtures/esprima/expression-binary-bitwise/migrated_0002/expected.json b/test/fixtures/esprima/expression-binary-bitwise/migrated_0002/expected.json new file mode 100644 index 0000000000..2c6c6a71aa --- /dev/null +++ b/test/fixtures/esprima/expression-binary-bitwise/migrated_0002/expected.json @@ -0,0 +1,96 @@ +{ + "type": "File", + "start": 0, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "expression": { + "type": "BinaryExpression", + "start": 0, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "left": { + "type": "Identifier", + "start": 0, + "end": 1, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + } + }, + "name": "x" + }, + "operator": "|", + "right": { + "type": "Identifier", + "start": 4, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "name": "y" + } + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/expression-binary-logical/migrated_0000/actual.js b/test/fixtures/esprima/expression-binary-logical/migrated_0000/actual.js new file mode 100644 index 0000000000..d3891c2c9c --- /dev/null +++ b/test/fixtures/esprima/expression-binary-logical/migrated_0000/actual.js @@ -0,0 +1 @@ +x || y diff --git a/test/fixtures/esprima/expression-binary-logical/migrated_0000/expected.json b/test/fixtures/esprima/expression-binary-logical/migrated_0000/expected.json new file mode 100644 index 0000000000..43821da431 --- /dev/null +++ b/test/fixtures/esprima/expression-binary-logical/migrated_0000/expected.json @@ -0,0 +1,96 @@ +{ + "type": "File", + "start": 0, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "expression": { + "type": "LogicalExpression", + "start": 0, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "left": { + "type": "Identifier", + "start": 0, + "end": 1, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + } + }, + "name": "x" + }, + "operator": "||", + "right": { + "type": "Identifier", + "start": 5, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "name": "y" + } + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/expression-binary-logical/migrated_0001/actual.js b/test/fixtures/esprima/expression-binary-logical/migrated_0001/actual.js new file mode 100644 index 0000000000..7d5be6bfd1 --- /dev/null +++ b/test/fixtures/esprima/expression-binary-logical/migrated_0001/actual.js @@ -0,0 +1 @@ +x && y diff --git a/test/fixtures/esprima/expression-binary-logical/migrated_0001/expected.json b/test/fixtures/esprima/expression-binary-logical/migrated_0001/expected.json new file mode 100644 index 0000000000..7b3dce0fdb --- /dev/null +++ b/test/fixtures/esprima/expression-binary-logical/migrated_0001/expected.json @@ -0,0 +1,96 @@ +{ + "type": "File", + "start": 0, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "expression": { + "type": "LogicalExpression", + "start": 0, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "left": { + "type": "Identifier", + "start": 0, + "end": 1, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + } + }, + "name": "x" + }, + "operator": "&&", + "right": { + "type": "Identifier", + "start": 5, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "name": "y" + } + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/expression-binary-logical/migrated_0002/actual.js b/test/fixtures/esprima/expression-binary-logical/migrated_0002/actual.js new file mode 100644 index 0000000000..90e7cf52f1 --- /dev/null +++ b/test/fixtures/esprima/expression-binary-logical/migrated_0002/actual.js @@ -0,0 +1 @@ +x || y || z diff --git a/test/fixtures/esprima/expression-binary-logical/migrated_0002/expected.json b/test/fixtures/esprima/expression-binary-logical/migrated_0002/expected.json new file mode 100644 index 0000000000..313205c734 --- /dev/null +++ b/test/fixtures/esprima/expression-binary-logical/migrated_0002/expected.json @@ -0,0 +1,128 @@ +{ + "type": "File", + "start": 0, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "expression": { + "type": "LogicalExpression", + "start": 0, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "left": { + "type": "LogicalExpression", + "start": 0, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "left": { + "type": "Identifier", + "start": 0, + "end": 1, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + } + }, + "name": "x" + }, + "operator": "||", + "right": { + "type": "Identifier", + "start": 5, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "name": "y" + } + }, + "operator": "||", + "right": { + "type": "Identifier", + "start": 10, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "name": "z" + } + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/expression-binary-logical/migrated_0003/actual.js b/test/fixtures/esprima/expression-binary-logical/migrated_0003/actual.js new file mode 100644 index 0000000000..3a9c93b39c --- /dev/null +++ b/test/fixtures/esprima/expression-binary-logical/migrated_0003/actual.js @@ -0,0 +1 @@ +x && y && z diff --git a/test/fixtures/esprima/expression-binary-logical/migrated_0003/expected.json b/test/fixtures/esprima/expression-binary-logical/migrated_0003/expected.json new file mode 100644 index 0000000000..076e9826f5 --- /dev/null +++ b/test/fixtures/esprima/expression-binary-logical/migrated_0003/expected.json @@ -0,0 +1,128 @@ +{ + "type": "File", + "start": 0, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "expression": { + "type": "LogicalExpression", + "start": 0, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "left": { + "type": "LogicalExpression", + "start": 0, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "left": { + "type": "Identifier", + "start": 0, + "end": 1, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + } + }, + "name": "x" + }, + "operator": "&&", + "right": { + "type": "Identifier", + "start": 5, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "name": "y" + } + }, + "operator": "&&", + "right": { + "type": "Identifier", + "start": 10, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "name": "z" + } + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/expression-binary-logical/migrated_0004/actual.js b/test/fixtures/esprima/expression-binary-logical/migrated_0004/actual.js new file mode 100644 index 0000000000..ba63b00838 --- /dev/null +++ b/test/fixtures/esprima/expression-binary-logical/migrated_0004/actual.js @@ -0,0 +1 @@ +x || y && z diff --git a/test/fixtures/esprima/expression-binary-logical/migrated_0004/expected.json b/test/fixtures/esprima/expression-binary-logical/migrated_0004/expected.json new file mode 100644 index 0000000000..39a92de27e --- /dev/null +++ b/test/fixtures/esprima/expression-binary-logical/migrated_0004/expected.json @@ -0,0 +1,128 @@ +{ + "type": "File", + "start": 0, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "expression": { + "type": "LogicalExpression", + "start": 0, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "left": { + "type": "Identifier", + "start": 0, + "end": 1, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + } + }, + "name": "x" + }, + "operator": "||", + "right": { + "type": "LogicalExpression", + "start": 5, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "left": { + "type": "Identifier", + "start": 5, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "name": "y" + }, + "operator": "&&", + "right": { + "type": "Identifier", + "start": 10, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "name": "z" + } + } + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/expression-binary-logical/migrated_0005/actual.js b/test/fixtures/esprima/expression-binary-logical/migrated_0005/actual.js new file mode 100644 index 0000000000..6ff43831c6 --- /dev/null +++ b/test/fixtures/esprima/expression-binary-logical/migrated_0005/actual.js @@ -0,0 +1 @@ +x || y ^ z diff --git a/test/fixtures/esprima/expression-binary-logical/migrated_0005/expected.json b/test/fixtures/esprima/expression-binary-logical/migrated_0005/expected.json new file mode 100644 index 0000000000..27399a9c53 --- /dev/null +++ b/test/fixtures/esprima/expression-binary-logical/migrated_0005/expected.json @@ -0,0 +1,128 @@ +{ + "type": "File", + "start": 0, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "expression": { + "type": "LogicalExpression", + "start": 0, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "left": { + "type": "Identifier", + "start": 0, + "end": 1, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + } + }, + "name": "x" + }, + "operator": "||", + "right": { + "type": "BinaryExpression", + "start": 5, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "left": { + "type": "Identifier", + "start": 5, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "name": "y" + }, + "operator": "^", + "right": { + "type": "Identifier", + "start": 9, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "name": "z" + } + } + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/expression-binary/migrated_0000/actual.js b/test/fixtures/esprima/expression-binary/migrated_0000/actual.js new file mode 100644 index 0000000000..ace7e0bf2d --- /dev/null +++ b/test/fixtures/esprima/expression-binary/migrated_0000/actual.js @@ -0,0 +1 @@ +x + y + z diff --git a/test/fixtures/esprima/expression-binary/migrated_0000/expected.json b/test/fixtures/esprima/expression-binary/migrated_0000/expected.json new file mode 100644 index 0000000000..102f5d3d69 --- /dev/null +++ b/test/fixtures/esprima/expression-binary/migrated_0000/expected.json @@ -0,0 +1,128 @@ +{ + "type": "File", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "expression": { + "type": "BinaryExpression", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "left": { + "type": "BinaryExpression", + "start": 0, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "left": { + "type": "Identifier", + "start": 0, + "end": 1, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + } + }, + "name": "x" + }, + "operator": "+", + "right": { + "type": "Identifier", + "start": 4, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "name": "y" + } + }, + "operator": "+", + "right": { + "type": "Identifier", + "start": 8, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "name": "z" + } + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/expression-binary/migrated_0001/actual.js b/test/fixtures/esprima/expression-binary/migrated_0001/actual.js new file mode 100644 index 0000000000..689cb88717 --- /dev/null +++ b/test/fixtures/esprima/expression-binary/migrated_0001/actual.js @@ -0,0 +1 @@ +x - y + z diff --git a/test/fixtures/esprima/expression-binary/migrated_0001/expected.json b/test/fixtures/esprima/expression-binary/migrated_0001/expected.json new file mode 100644 index 0000000000..de56597e6a --- /dev/null +++ b/test/fixtures/esprima/expression-binary/migrated_0001/expected.json @@ -0,0 +1,128 @@ +{ + "type": "File", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "expression": { + "type": "BinaryExpression", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "left": { + "type": "BinaryExpression", + "start": 0, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "left": { + "type": "Identifier", + "start": 0, + "end": 1, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + } + }, + "name": "x" + }, + "operator": "-", + "right": { + "type": "Identifier", + "start": 4, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "name": "y" + } + }, + "operator": "+", + "right": { + "type": "Identifier", + "start": 8, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "name": "z" + } + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/expression-binary/migrated_0002/actual.js b/test/fixtures/esprima/expression-binary/migrated_0002/actual.js new file mode 100644 index 0000000000..89425f9273 --- /dev/null +++ b/test/fixtures/esprima/expression-binary/migrated_0002/actual.js @@ -0,0 +1 @@ +x + y - z diff --git a/test/fixtures/esprima/expression-binary/migrated_0002/expected.json b/test/fixtures/esprima/expression-binary/migrated_0002/expected.json new file mode 100644 index 0000000000..edc0351968 --- /dev/null +++ b/test/fixtures/esprima/expression-binary/migrated_0002/expected.json @@ -0,0 +1,128 @@ +{ + "type": "File", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "expression": { + "type": "BinaryExpression", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "left": { + "type": "BinaryExpression", + "start": 0, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "left": { + "type": "Identifier", + "start": 0, + "end": 1, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + } + }, + "name": "x" + }, + "operator": "+", + "right": { + "type": "Identifier", + "start": 4, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "name": "y" + } + }, + "operator": "-", + "right": { + "type": "Identifier", + "start": 8, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "name": "z" + } + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/expression-binary/migrated_0003/actual.js b/test/fixtures/esprima/expression-binary/migrated_0003/actual.js new file mode 100644 index 0000000000..8e7a45ced7 --- /dev/null +++ b/test/fixtures/esprima/expression-binary/migrated_0003/actual.js @@ -0,0 +1 @@ +x - y - z diff --git a/test/fixtures/esprima/expression-binary/migrated_0003/expected.json b/test/fixtures/esprima/expression-binary/migrated_0003/expected.json new file mode 100644 index 0000000000..74e0ab65b8 --- /dev/null +++ b/test/fixtures/esprima/expression-binary/migrated_0003/expected.json @@ -0,0 +1,128 @@ +{ + "type": "File", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "expression": { + "type": "BinaryExpression", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "left": { + "type": "BinaryExpression", + "start": 0, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "left": { + "type": "Identifier", + "start": 0, + "end": 1, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + } + }, + "name": "x" + }, + "operator": "-", + "right": { + "type": "Identifier", + "start": 4, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "name": "y" + } + }, + "operator": "-", + "right": { + "type": "Identifier", + "start": 8, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "name": "z" + } + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/expression-binary/migrated_0004/actual.js b/test/fixtures/esprima/expression-binary/migrated_0004/actual.js new file mode 100644 index 0000000000..6908de281f --- /dev/null +++ b/test/fixtures/esprima/expression-binary/migrated_0004/actual.js @@ -0,0 +1 @@ +x + y * z diff --git a/test/fixtures/esprima/expression-binary/migrated_0004/expected.json b/test/fixtures/esprima/expression-binary/migrated_0004/expected.json new file mode 100644 index 0000000000..510073e483 --- /dev/null +++ b/test/fixtures/esprima/expression-binary/migrated_0004/expected.json @@ -0,0 +1,128 @@ +{ + "type": "File", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "expression": { + "type": "BinaryExpression", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "left": { + "type": "Identifier", + "start": 0, + "end": 1, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + } + }, + "name": "x" + }, + "operator": "+", + "right": { + "type": "BinaryExpression", + "start": 4, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "left": { + "type": "Identifier", + "start": 4, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "name": "y" + }, + "operator": "*", + "right": { + "type": "Identifier", + "start": 8, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "name": "z" + } + } + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/expression-binary/migrated_0005/actual.js b/test/fixtures/esprima/expression-binary/migrated_0005/actual.js new file mode 100644 index 0000000000..05c8c505cf --- /dev/null +++ b/test/fixtures/esprima/expression-binary/migrated_0005/actual.js @@ -0,0 +1 @@ +x + y / z diff --git a/test/fixtures/esprima/expression-binary/migrated_0005/expected.json b/test/fixtures/esprima/expression-binary/migrated_0005/expected.json new file mode 100644 index 0000000000..5e5fca2313 --- /dev/null +++ b/test/fixtures/esprima/expression-binary/migrated_0005/expected.json @@ -0,0 +1,128 @@ +{ + "type": "File", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "expression": { + "type": "BinaryExpression", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "left": { + "type": "Identifier", + "start": 0, + "end": 1, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + } + }, + "name": "x" + }, + "operator": "+", + "right": { + "type": "BinaryExpression", + "start": 4, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "left": { + "type": "Identifier", + "start": 4, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "name": "y" + }, + "operator": "/", + "right": { + "type": "Identifier", + "start": 8, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "name": "z" + } + } + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/expression-binary/migrated_0006/actual.js b/test/fixtures/esprima/expression-binary/migrated_0006/actual.js new file mode 100644 index 0000000000..4fde298f0f --- /dev/null +++ b/test/fixtures/esprima/expression-binary/migrated_0006/actual.js @@ -0,0 +1 @@ +x - y % z diff --git a/test/fixtures/esprima/expression-binary/migrated_0006/expected.json b/test/fixtures/esprima/expression-binary/migrated_0006/expected.json new file mode 100644 index 0000000000..dc0ac6b9bf --- /dev/null +++ b/test/fixtures/esprima/expression-binary/migrated_0006/expected.json @@ -0,0 +1,128 @@ +{ + "type": "File", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "expression": { + "type": "BinaryExpression", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "left": { + "type": "Identifier", + "start": 0, + "end": 1, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + } + }, + "name": "x" + }, + "operator": "-", + "right": { + "type": "BinaryExpression", + "start": 4, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "left": { + "type": "Identifier", + "start": 4, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "name": "y" + }, + "operator": "%", + "right": { + "type": "Identifier", + "start": 8, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "name": "z" + } + } + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/expression-binary/migrated_0007/actual.js b/test/fixtures/esprima/expression-binary/migrated_0007/actual.js new file mode 100644 index 0000000000..2487593dd8 --- /dev/null +++ b/test/fixtures/esprima/expression-binary/migrated_0007/actual.js @@ -0,0 +1 @@ +x * y * z diff --git a/test/fixtures/esprima/expression-binary/migrated_0007/expected.json b/test/fixtures/esprima/expression-binary/migrated_0007/expected.json new file mode 100644 index 0000000000..4beef8dd3d --- /dev/null +++ b/test/fixtures/esprima/expression-binary/migrated_0007/expected.json @@ -0,0 +1,128 @@ +{ + "type": "File", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "expression": { + "type": "BinaryExpression", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "left": { + "type": "BinaryExpression", + "start": 0, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "left": { + "type": "Identifier", + "start": 0, + "end": 1, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + } + }, + "name": "x" + }, + "operator": "*", + "right": { + "type": "Identifier", + "start": 4, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "name": "y" + } + }, + "operator": "*", + "right": { + "type": "Identifier", + "start": 8, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "name": "z" + } + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/expression-binary/migrated_0008/actual.js b/test/fixtures/esprima/expression-binary/migrated_0008/actual.js new file mode 100644 index 0000000000..0bfe2ae559 --- /dev/null +++ b/test/fixtures/esprima/expression-binary/migrated_0008/actual.js @@ -0,0 +1 @@ +x * y / z diff --git a/test/fixtures/esprima/expression-binary/migrated_0008/expected.json b/test/fixtures/esprima/expression-binary/migrated_0008/expected.json new file mode 100644 index 0000000000..9d743b0d39 --- /dev/null +++ b/test/fixtures/esprima/expression-binary/migrated_0008/expected.json @@ -0,0 +1,128 @@ +{ + "type": "File", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "expression": { + "type": "BinaryExpression", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "left": { + "type": "BinaryExpression", + "start": 0, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "left": { + "type": "Identifier", + "start": 0, + "end": 1, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + } + }, + "name": "x" + }, + "operator": "*", + "right": { + "type": "Identifier", + "start": 4, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "name": "y" + } + }, + "operator": "/", + "right": { + "type": "Identifier", + "start": 8, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "name": "z" + } + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/expression-binary/migrated_0009/actual.js b/test/fixtures/esprima/expression-binary/migrated_0009/actual.js new file mode 100644 index 0000000000..862069a198 --- /dev/null +++ b/test/fixtures/esprima/expression-binary/migrated_0009/actual.js @@ -0,0 +1 @@ +x * y % z diff --git a/test/fixtures/esprima/expression-binary/migrated_0009/expected.json b/test/fixtures/esprima/expression-binary/migrated_0009/expected.json new file mode 100644 index 0000000000..3e5a22a223 --- /dev/null +++ b/test/fixtures/esprima/expression-binary/migrated_0009/expected.json @@ -0,0 +1,128 @@ +{ + "type": "File", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "expression": { + "type": "BinaryExpression", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "left": { + "type": "BinaryExpression", + "start": 0, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "left": { + "type": "Identifier", + "start": 0, + "end": 1, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + } + }, + "name": "x" + }, + "operator": "*", + "right": { + "type": "Identifier", + "start": 4, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "name": "y" + } + }, + "operator": "%", + "right": { + "type": "Identifier", + "start": 8, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "name": "z" + } + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/expression-binary/migrated_0010/actual.js b/test/fixtures/esprima/expression-binary/migrated_0010/actual.js new file mode 100644 index 0000000000..77b5290486 --- /dev/null +++ b/test/fixtures/esprima/expression-binary/migrated_0010/actual.js @@ -0,0 +1 @@ +x % y * z diff --git a/test/fixtures/esprima/expression-binary/migrated_0010/expected.json b/test/fixtures/esprima/expression-binary/migrated_0010/expected.json new file mode 100644 index 0000000000..2174559e10 --- /dev/null +++ b/test/fixtures/esprima/expression-binary/migrated_0010/expected.json @@ -0,0 +1,128 @@ +{ + "type": "File", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "expression": { + "type": "BinaryExpression", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "left": { + "type": "BinaryExpression", + "start": 0, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "left": { + "type": "Identifier", + "start": 0, + "end": 1, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + } + }, + "name": "x" + }, + "operator": "%", + "right": { + "type": "Identifier", + "start": 4, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "name": "y" + } + }, + "operator": "*", + "right": { + "type": "Identifier", + "start": 8, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "name": "z" + } + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/expression-binary/migrated_0011/actual.js b/test/fixtures/esprima/expression-binary/migrated_0011/actual.js new file mode 100644 index 0000000000..3e63d20011 --- /dev/null +++ b/test/fixtures/esprima/expression-binary/migrated_0011/actual.js @@ -0,0 +1 @@ +x << y << z diff --git a/test/fixtures/esprima/expression-binary/migrated_0011/expected.json b/test/fixtures/esprima/expression-binary/migrated_0011/expected.json new file mode 100644 index 0000000000..92c65557e6 --- /dev/null +++ b/test/fixtures/esprima/expression-binary/migrated_0011/expected.json @@ -0,0 +1,128 @@ +{ + "type": "File", + "start": 0, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "expression": { + "type": "BinaryExpression", + "start": 0, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "left": { + "type": "BinaryExpression", + "start": 0, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "left": { + "type": "Identifier", + "start": 0, + "end": 1, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + } + }, + "name": "x" + }, + "operator": "<<", + "right": { + "type": "Identifier", + "start": 5, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "name": "y" + } + }, + "operator": "<<", + "right": { + "type": "Identifier", + "start": 10, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "name": "z" + } + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/expression-binary/migrated_0012/actual.js b/test/fixtures/esprima/expression-binary/migrated_0012/actual.js new file mode 100644 index 0000000000..7d90d68915 --- /dev/null +++ b/test/fixtures/esprima/expression-binary/migrated_0012/actual.js @@ -0,0 +1 @@ +x | y | z diff --git a/test/fixtures/esprima/expression-binary/migrated_0012/expected.json b/test/fixtures/esprima/expression-binary/migrated_0012/expected.json new file mode 100644 index 0000000000..188c481bfc --- /dev/null +++ b/test/fixtures/esprima/expression-binary/migrated_0012/expected.json @@ -0,0 +1,128 @@ +{ + "type": "File", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "expression": { + "type": "BinaryExpression", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "left": { + "type": "BinaryExpression", + "start": 0, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "left": { + "type": "Identifier", + "start": 0, + "end": 1, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + } + }, + "name": "x" + }, + "operator": "|", + "right": { + "type": "Identifier", + "start": 4, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "name": "y" + } + }, + "operator": "|", + "right": { + "type": "Identifier", + "start": 8, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "name": "z" + } + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/expression-binary/migrated_0013/actual.js b/test/fixtures/esprima/expression-binary/migrated_0013/actual.js new file mode 100644 index 0000000000..c6fe6c5daf --- /dev/null +++ b/test/fixtures/esprima/expression-binary/migrated_0013/actual.js @@ -0,0 +1 @@ +x & y & z diff --git a/test/fixtures/esprima/expression-binary/migrated_0013/expected.json b/test/fixtures/esprima/expression-binary/migrated_0013/expected.json new file mode 100644 index 0000000000..3c6c2f0817 --- /dev/null +++ b/test/fixtures/esprima/expression-binary/migrated_0013/expected.json @@ -0,0 +1,128 @@ +{ + "type": "File", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "expression": { + "type": "BinaryExpression", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "left": { + "type": "BinaryExpression", + "start": 0, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "left": { + "type": "Identifier", + "start": 0, + "end": 1, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + } + }, + "name": "x" + }, + "operator": "&", + "right": { + "type": "Identifier", + "start": 4, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "name": "y" + } + }, + "operator": "&", + "right": { + "type": "Identifier", + "start": 8, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "name": "z" + } + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/expression-binary/migrated_0014/actual.js b/test/fixtures/esprima/expression-binary/migrated_0014/actual.js new file mode 100644 index 0000000000..c2d0bfe871 --- /dev/null +++ b/test/fixtures/esprima/expression-binary/migrated_0014/actual.js @@ -0,0 +1 @@ +x ^ y ^ z diff --git a/test/fixtures/esprima/expression-binary/migrated_0014/expected.json b/test/fixtures/esprima/expression-binary/migrated_0014/expected.json new file mode 100644 index 0000000000..48e47e4198 --- /dev/null +++ b/test/fixtures/esprima/expression-binary/migrated_0014/expected.json @@ -0,0 +1,128 @@ +{ + "type": "File", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "expression": { + "type": "BinaryExpression", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "left": { + "type": "BinaryExpression", + "start": 0, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "left": { + "type": "Identifier", + "start": 0, + "end": 1, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + } + }, + "name": "x" + }, + "operator": "^", + "right": { + "type": "Identifier", + "start": 4, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "name": "y" + } + }, + "operator": "^", + "right": { + "type": "Identifier", + "start": 8, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "name": "z" + } + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/expression-binary/migrated_0015/actual.js b/test/fixtures/esprima/expression-binary/migrated_0015/actual.js new file mode 100644 index 0000000000..962182f597 --- /dev/null +++ b/test/fixtures/esprima/expression-binary/migrated_0015/actual.js @@ -0,0 +1 @@ +x & y | z diff --git a/test/fixtures/esprima/expression-binary/migrated_0015/expected.json b/test/fixtures/esprima/expression-binary/migrated_0015/expected.json new file mode 100644 index 0000000000..0fa66acc0b --- /dev/null +++ b/test/fixtures/esprima/expression-binary/migrated_0015/expected.json @@ -0,0 +1,128 @@ +{ + "type": "File", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "expression": { + "type": "BinaryExpression", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "left": { + "type": "BinaryExpression", + "start": 0, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "left": { + "type": "Identifier", + "start": 0, + "end": 1, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + } + }, + "name": "x" + }, + "operator": "&", + "right": { + "type": "Identifier", + "start": 4, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "name": "y" + } + }, + "operator": "|", + "right": { + "type": "Identifier", + "start": 8, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "name": "z" + } + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/expression-binary/migrated_0016/actual.js b/test/fixtures/esprima/expression-binary/migrated_0016/actual.js new file mode 100644 index 0000000000..25a30410da --- /dev/null +++ b/test/fixtures/esprima/expression-binary/migrated_0016/actual.js @@ -0,0 +1 @@ +x | y ^ z diff --git a/test/fixtures/esprima/expression-binary/migrated_0016/expected.json b/test/fixtures/esprima/expression-binary/migrated_0016/expected.json new file mode 100644 index 0000000000..c8df10d3d8 --- /dev/null +++ b/test/fixtures/esprima/expression-binary/migrated_0016/expected.json @@ -0,0 +1,128 @@ +{ + "type": "File", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "expression": { + "type": "BinaryExpression", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "left": { + "type": "Identifier", + "start": 0, + "end": 1, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + } + }, + "name": "x" + }, + "operator": "|", + "right": { + "type": "BinaryExpression", + "start": 4, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "left": { + "type": "Identifier", + "start": 4, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "name": "y" + }, + "operator": "^", + "right": { + "type": "Identifier", + "start": 8, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "name": "z" + } + } + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/expression-binary/migrated_0017/actual.js b/test/fixtures/esprima/expression-binary/migrated_0017/actual.js new file mode 100644 index 0000000000..4e4b638c97 --- /dev/null +++ b/test/fixtures/esprima/expression-binary/migrated_0017/actual.js @@ -0,0 +1 @@ +x | y & z diff --git a/test/fixtures/esprima/expression-binary/migrated_0017/expected.json b/test/fixtures/esprima/expression-binary/migrated_0017/expected.json new file mode 100644 index 0000000000..c66d330503 --- /dev/null +++ b/test/fixtures/esprima/expression-binary/migrated_0017/expected.json @@ -0,0 +1,128 @@ +{ + "type": "File", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "expression": { + "type": "BinaryExpression", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "left": { + "type": "Identifier", + "start": 0, + "end": 1, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + } + }, + "name": "x" + }, + "operator": "|", + "right": { + "type": "BinaryExpression", + "start": 4, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "left": { + "type": "Identifier", + "start": 4, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "name": "y" + }, + "operator": "&", + "right": { + "type": "Identifier", + "start": 8, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "name": "z" + } + } + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/expression-bitwise-shift/migrated_0000/actual.js b/test/fixtures/esprima/expression-bitwise-shift/migrated_0000/actual.js new file mode 100644 index 0000000000..9956b52bbb --- /dev/null +++ b/test/fixtures/esprima/expression-bitwise-shift/migrated_0000/actual.js @@ -0,0 +1 @@ +x << y diff --git a/test/fixtures/esprima/expression-bitwise-shift/migrated_0000/expected.json b/test/fixtures/esprima/expression-bitwise-shift/migrated_0000/expected.json new file mode 100644 index 0000000000..7da984159e --- /dev/null +++ b/test/fixtures/esprima/expression-bitwise-shift/migrated_0000/expected.json @@ -0,0 +1,96 @@ +{ + "type": "File", + "start": 0, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "expression": { + "type": "BinaryExpression", + "start": 0, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "left": { + "type": "Identifier", + "start": 0, + "end": 1, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + } + }, + "name": "x" + }, + "operator": "<<", + "right": { + "type": "Identifier", + "start": 5, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "name": "y" + } + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/expression-bitwise-shift/migrated_0001/actual.js b/test/fixtures/esprima/expression-bitwise-shift/migrated_0001/actual.js new file mode 100644 index 0000000000..97b03e6112 --- /dev/null +++ b/test/fixtures/esprima/expression-bitwise-shift/migrated_0001/actual.js @@ -0,0 +1 @@ +x >> y diff --git a/test/fixtures/esprima/expression-bitwise-shift/migrated_0001/expected.json b/test/fixtures/esprima/expression-bitwise-shift/migrated_0001/expected.json new file mode 100644 index 0000000000..51b1fefd9e --- /dev/null +++ b/test/fixtures/esprima/expression-bitwise-shift/migrated_0001/expected.json @@ -0,0 +1,96 @@ +{ + "type": "File", + "start": 0, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "expression": { + "type": "BinaryExpression", + "start": 0, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "left": { + "type": "Identifier", + "start": 0, + "end": 1, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + } + }, + "name": "x" + }, + "operator": ">>", + "right": { + "type": "Identifier", + "start": 5, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "name": "y" + } + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/expression-bitwise-shift/migrated_0002/actual.js b/test/fixtures/esprima/expression-bitwise-shift/migrated_0002/actual.js new file mode 100644 index 0000000000..6605695a6b --- /dev/null +++ b/test/fixtures/esprima/expression-bitwise-shift/migrated_0002/actual.js @@ -0,0 +1 @@ +x >>> y diff --git a/test/fixtures/esprima/expression-bitwise-shift/migrated_0002/expected.json b/test/fixtures/esprima/expression-bitwise-shift/migrated_0002/expected.json new file mode 100644 index 0000000000..c61c63d02d --- /dev/null +++ b/test/fixtures/esprima/expression-bitwise-shift/migrated_0002/expected.json @@ -0,0 +1,96 @@ +{ + "type": "File", + "start": 0, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "expression": { + "type": "BinaryExpression", + "start": 0, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "left": { + "type": "Identifier", + "start": 0, + "end": 1, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + } + }, + "name": "x" + }, + "operator": ">>>", + "right": { + "type": "Identifier", + "start": 6, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "name": "y" + } + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/expression-complex/migrated_0000/actual.js b/test/fixtures/esprima/expression-complex/migrated_0000/actual.js new file mode 100644 index 0000000000..2a769e96c3 --- /dev/null +++ b/test/fixtures/esprima/expression-complex/migrated_0000/actual.js @@ -0,0 +1 @@ +a || b && c | d ^ e & f == g < h >>> i + j * k diff --git a/test/fixtures/esprima/expression-complex/migrated_0000/expected.json b/test/fixtures/esprima/expression-complex/migrated_0000/expected.json new file mode 100644 index 0000000000..2158045bd1 --- /dev/null +++ b/test/fixtures/esprima/expression-complex/migrated_0000/expected.json @@ -0,0 +1,384 @@ +{ + "type": "File", + "start": 0, + "end": 46, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 46 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 46, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 46 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 46, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 46 + } + }, + "expression": { + "type": "LogicalExpression", + "start": 0, + "end": 46, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 46 + } + }, + "left": { + "type": "Identifier", + "start": 0, + "end": 1, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + } + }, + "name": "a" + }, + "operator": "||", + "right": { + "type": "LogicalExpression", + "start": 5, + "end": 46, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 46 + } + }, + "left": { + "type": "Identifier", + "start": 5, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "name": "b" + }, + "operator": "&&", + "right": { + "type": "BinaryExpression", + "start": 10, + "end": 46, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 46 + } + }, + "left": { + "type": "Identifier", + "start": 10, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "name": "c" + }, + "operator": "|", + "right": { + "type": "BinaryExpression", + "start": 14, + "end": 46, + "loc": { + "start": { + "line": 1, + "column": 14 + }, + "end": { + "line": 1, + "column": 46 + } + }, + "left": { + "type": "Identifier", + "start": 14, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 14 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "name": "d" + }, + "operator": "^", + "right": { + "type": "BinaryExpression", + "start": 18, + "end": 46, + "loc": { + "start": { + "line": 1, + "column": 18 + }, + "end": { + "line": 1, + "column": 46 + } + }, + "left": { + "type": "Identifier", + "start": 18, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 18 + }, + "end": { + "line": 1, + "column": 19 + } + }, + "name": "e" + }, + "operator": "&", + "right": { + "type": "BinaryExpression", + "start": 22, + "end": 46, + "loc": { + "start": { + "line": 1, + "column": 22 + }, + "end": { + "line": 1, + "column": 46 + } + }, + "left": { + "type": "Identifier", + "start": 22, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 22 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "name": "f" + }, + "operator": "==", + "right": { + "type": "BinaryExpression", + "start": 27, + "end": 46, + "loc": { + "start": { + "line": 1, + "column": 27 + }, + "end": { + "line": 1, + "column": 46 + } + }, + "left": { + "type": "Identifier", + "start": 27, + "end": 28, + "loc": { + "start": { + "line": 1, + "column": 27 + }, + "end": { + "line": 1, + "column": 28 + } + }, + "name": "g" + }, + "operator": "<", + "right": { + "type": "BinaryExpression", + "start": 31, + "end": 46, + "loc": { + "start": { + "line": 1, + "column": 31 + }, + "end": { + "line": 1, + "column": 46 + } + }, + "left": { + "type": "Identifier", + "start": 31, + "end": 32, + "loc": { + "start": { + "line": 1, + "column": 31 + }, + "end": { + "line": 1, + "column": 32 + } + }, + "name": "h" + }, + "operator": ">>>", + "right": { + "type": "BinaryExpression", + "start": 37, + "end": 46, + "loc": { + "start": { + "line": 1, + "column": 37 + }, + "end": { + "line": 1, + "column": 46 + } + }, + "left": { + "type": "Identifier", + "start": 37, + "end": 38, + "loc": { + "start": { + "line": 1, + "column": 37 + }, + "end": { + "line": 1, + "column": 38 + } + }, + "name": "i" + }, + "operator": "+", + "right": { + "type": "BinaryExpression", + "start": 41, + "end": 46, + "loc": { + "start": { + "line": 1, + "column": 41 + }, + "end": { + "line": 1, + "column": 46 + } + }, + "left": { + "type": "Identifier", + "start": 41, + "end": 42, + "loc": { + "start": { + "line": 1, + "column": 41 + }, + "end": { + "line": 1, + "column": 42 + } + }, + "name": "j" + }, + "operator": "*", + "right": { + "type": "Identifier", + "start": 45, + "end": 46, + "loc": { + "start": { + "line": 1, + "column": 45 + }, + "end": { + "line": 1, + "column": 46 + } + }, + "name": "k" + } + } + } + } + } + } + } + } + } + } + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/expression-conditional/migrated_0000/actual.js b/test/fixtures/esprima/expression-conditional/migrated_0000/actual.js new file mode 100644 index 0000000000..848240c6c6 --- /dev/null +++ b/test/fixtures/esprima/expression-conditional/migrated_0000/actual.js @@ -0,0 +1 @@ +y ? 1 : 2 diff --git a/test/fixtures/esprima/expression-conditional/migrated_0000/expected.json b/test/fixtures/esprima/expression-conditional/migrated_0000/expected.json new file mode 100644 index 0000000000..355a73a1ad --- /dev/null +++ b/test/fixtures/esprima/expression-conditional/migrated_0000/expected.json @@ -0,0 +1,115 @@ +{ + "type": "File", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "expression": { + "type": "ConditionalExpression", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "test": { + "type": "Identifier", + "start": 0, + "end": 1, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + } + }, + "name": "y" + }, + "consequent": { + "type": "Literal", + "start": 4, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "value": 1, + "rawValue": 1, + "raw": "1" + }, + "alternate": { + "type": "Literal", + "start": 8, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "value": 2, + "rawValue": 2, + "raw": "2" + } + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/expression-conditional/migrated_0001/actual.js b/test/fixtures/esprima/expression-conditional/migrated_0001/actual.js new file mode 100644 index 0000000000..3f29ba0e20 --- /dev/null +++ b/test/fixtures/esprima/expression-conditional/migrated_0001/actual.js @@ -0,0 +1 @@ +x && y ? 1 : 2 diff --git a/test/fixtures/esprima/expression-conditional/migrated_0001/expected.json b/test/fixtures/esprima/expression-conditional/migrated_0001/expected.json new file mode 100644 index 0000000000..618615ef5f --- /dev/null +++ b/test/fixtures/esprima/expression-conditional/migrated_0001/expected.json @@ -0,0 +1,147 @@ +{ + "type": "File", + "start": 0, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "expression": { + "type": "ConditionalExpression", + "start": 0, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "test": { + "type": "LogicalExpression", + "start": 0, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "left": { + "type": "Identifier", + "start": 0, + "end": 1, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + } + }, + "name": "x" + }, + "operator": "&&", + "right": { + "type": "Identifier", + "start": 5, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "name": "y" + } + }, + "consequent": { + "type": "Literal", + "start": 9, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "value": 1, + "rawValue": 1, + "raw": "1" + }, + "alternate": { + "type": "Literal", + "start": 13, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "value": 2, + "rawValue": 2, + "raw": "2" + } + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/expression-conditional/migrated_0002/actual.js b/test/fixtures/esprima/expression-conditional/migrated_0002/actual.js new file mode 100644 index 0000000000..c63be97a08 --- /dev/null +++ b/test/fixtures/esprima/expression-conditional/migrated_0002/actual.js @@ -0,0 +1 @@ +x = (0) ? 1 : 2 diff --git a/test/fixtures/esprima/expression-conditional/migrated_0002/expected.json b/test/fixtures/esprima/expression-conditional/migrated_0002/expected.json new file mode 100644 index 0000000000..3875482cdf --- /dev/null +++ b/test/fixtures/esprima/expression-conditional/migrated_0002/expected.json @@ -0,0 +1,150 @@ +{ + "type": "File", + "start": 0, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "expression": { + "type": "AssignmentExpression", + "start": 0, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "operator": "=", + "left": { + "type": "Identifier", + "start": 0, + "end": 1, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + } + }, + "name": "x" + }, + "right": { + "type": "ConditionalExpression", + "start": 4, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "test": { + "type": "Literal", + "start": 5, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "value": 0, + "rawValue": 0, + "raw": "0", + "parenthesizedExpression": true + }, + "consequent": { + "type": "Literal", + "start": 10, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "value": 1, + "rawValue": 1, + "raw": "1" + }, + "alternate": { + "type": "Literal", + "start": 14, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 14 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "value": 2, + "rawValue": 2, + "raw": "2" + } + } + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/expression-equality/migrated_0000/actual.js b/test/fixtures/esprima/expression-equality/migrated_0000/actual.js new file mode 100644 index 0000000000..04dfc84773 --- /dev/null +++ b/test/fixtures/esprima/expression-equality/migrated_0000/actual.js @@ -0,0 +1 @@ +x == y diff --git a/test/fixtures/esprima/expression-equality/migrated_0000/expected.json b/test/fixtures/esprima/expression-equality/migrated_0000/expected.json new file mode 100644 index 0000000000..c1e5bf26af --- /dev/null +++ b/test/fixtures/esprima/expression-equality/migrated_0000/expected.json @@ -0,0 +1,96 @@ +{ + "type": "File", + "start": 0, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "expression": { + "type": "BinaryExpression", + "start": 0, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "left": { + "type": "Identifier", + "start": 0, + "end": 1, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + } + }, + "name": "x" + }, + "operator": "==", + "right": { + "type": "Identifier", + "start": 5, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "name": "y" + } + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/expression-equality/migrated_0001/actual.js b/test/fixtures/esprima/expression-equality/migrated_0001/actual.js new file mode 100644 index 0000000000..348bb48b0f --- /dev/null +++ b/test/fixtures/esprima/expression-equality/migrated_0001/actual.js @@ -0,0 +1 @@ +x != y diff --git a/test/fixtures/esprima/expression-equality/migrated_0001/expected.json b/test/fixtures/esprima/expression-equality/migrated_0001/expected.json new file mode 100644 index 0000000000..8eb45e6a10 --- /dev/null +++ b/test/fixtures/esprima/expression-equality/migrated_0001/expected.json @@ -0,0 +1,96 @@ +{ + "type": "File", + "start": 0, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "expression": { + "type": "BinaryExpression", + "start": 0, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "left": { + "type": "Identifier", + "start": 0, + "end": 1, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + } + }, + "name": "x" + }, + "operator": "!=", + "right": { + "type": "Identifier", + "start": 5, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "name": "y" + } + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/expression-equality/migrated_0002/actual.js b/test/fixtures/esprima/expression-equality/migrated_0002/actual.js new file mode 100644 index 0000000000..8193d1149a --- /dev/null +++ b/test/fixtures/esprima/expression-equality/migrated_0002/actual.js @@ -0,0 +1 @@ +x === y diff --git a/test/fixtures/esprima/expression-equality/migrated_0002/expected.json b/test/fixtures/esprima/expression-equality/migrated_0002/expected.json new file mode 100644 index 0000000000..2610f3986a --- /dev/null +++ b/test/fixtures/esprima/expression-equality/migrated_0002/expected.json @@ -0,0 +1,96 @@ +{ + "type": "File", + "start": 0, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "expression": { + "type": "BinaryExpression", + "start": 0, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "left": { + "type": "Identifier", + "start": 0, + "end": 1, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + } + }, + "name": "x" + }, + "operator": "===", + "right": { + "type": "Identifier", + "start": 6, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "name": "y" + } + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/expression-equality/migrated_0003/actual.js b/test/fixtures/esprima/expression-equality/migrated_0003/actual.js new file mode 100644 index 0000000000..9060514515 --- /dev/null +++ b/test/fixtures/esprima/expression-equality/migrated_0003/actual.js @@ -0,0 +1 @@ +x !== y diff --git a/test/fixtures/esprima/expression-equality/migrated_0003/expected.json b/test/fixtures/esprima/expression-equality/migrated_0003/expected.json new file mode 100644 index 0000000000..ab3b9424ab --- /dev/null +++ b/test/fixtures/esprima/expression-equality/migrated_0003/expected.json @@ -0,0 +1,96 @@ +{ + "type": "File", + "start": 0, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "expression": { + "type": "BinaryExpression", + "start": 0, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "left": { + "type": "Identifier", + "start": 0, + "end": 1, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + } + }, + "name": "x" + }, + "operator": "!==", + "right": { + "type": "Identifier", + "start": 6, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "name": "y" + } + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/expression-grouping/migrated_0000/actual.js b/test/fixtures/esprima/expression-grouping/migrated_0000/actual.js new file mode 100644 index 0000000000..42734c6592 --- /dev/null +++ b/test/fixtures/esprima/expression-grouping/migrated_0000/actual.js @@ -0,0 +1 @@ +(1) + (2 ) + 3 diff --git a/test/fixtures/esprima/expression-grouping/migrated_0000/expected.json b/test/fixtures/esprima/expression-grouping/migrated_0000/expected.json new file mode 100644 index 0000000000..68090be774 --- /dev/null +++ b/test/fixtures/esprima/expression-grouping/migrated_0000/expected.json @@ -0,0 +1,136 @@ +{ + "type": "File", + "start": 0, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "expression": { + "type": "BinaryExpression", + "start": 0, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "left": { + "type": "BinaryExpression", + "start": 0, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "left": { + "type": "Literal", + "start": 1, + "end": 2, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 2 + } + }, + "value": 1, + "rawValue": 1, + "raw": "1", + "parenthesizedExpression": true + }, + "operator": "+", + "right": { + "type": "Literal", + "start": 7, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "value": 2, + "rawValue": 2, + "raw": "2", + "parenthesizedExpression": true + } + }, + "operator": "+", + "right": { + "type": "Literal", + "start": 14, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 14 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "value": 3, + "rawValue": 3, + "raw": "3" + } + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/expression-grouping/migrated_0001/actual.js b/test/fixtures/esprima/expression-grouping/migrated_0001/actual.js new file mode 100644 index 0000000000..56c0cac6ce --- /dev/null +++ b/test/fixtures/esprima/expression-grouping/migrated_0001/actual.js @@ -0,0 +1 @@ +4 + 5 << (6) diff --git a/test/fixtures/esprima/expression-grouping/migrated_0001/expected.json b/test/fixtures/esprima/expression-grouping/migrated_0001/expected.json new file mode 100644 index 0000000000..df6409e3a6 --- /dev/null +++ b/test/fixtures/esprima/expression-grouping/migrated_0001/expected.json @@ -0,0 +1,135 @@ +{ + "type": "File", + "start": 0, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "expression": { + "type": "BinaryExpression", + "start": 0, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "left": { + "type": "BinaryExpression", + "start": 0, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "left": { + "type": "Literal", + "start": 0, + "end": 1, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + } + }, + "value": 4, + "rawValue": 4, + "raw": "4" + }, + "operator": "+", + "right": { + "type": "Literal", + "start": 4, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "value": 5, + "rawValue": 5, + "raw": "5" + } + }, + "operator": "<<", + "right": { + "type": "Literal", + "start": 10, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "value": 6, + "rawValue": 6, + "raw": "6", + "parenthesizedExpression": true + } + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/expression-left-hand-side/migrated_0000/actual.js b/test/fixtures/esprima/expression-left-hand-side/migrated_0000/actual.js new file mode 100644 index 0000000000..f25591e1c1 --- /dev/null +++ b/test/fixtures/esprima/expression-left-hand-side/migrated_0000/actual.js @@ -0,0 +1 @@ +new Button diff --git a/test/fixtures/esprima/expression-left-hand-side/migrated_0000/expected.json b/test/fixtures/esprima/expression-left-hand-side/migrated_0000/expected.json new file mode 100644 index 0000000000..08c175955a --- /dev/null +++ b/test/fixtures/esprima/expression-left-hand-side/migrated_0000/expected.json @@ -0,0 +1,80 @@ +{ + "type": "File", + "start": 0, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "expression": { + "type": "NewExpression", + "start": 0, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "callee": { + "type": "Identifier", + "start": 4, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "name": "Button" + }, + "arguments": [] + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/expression-left-hand-side/migrated_0001/actual.js b/test/fixtures/esprima/expression-left-hand-side/migrated_0001/actual.js new file mode 100644 index 0000000000..faf1e044d7 --- /dev/null +++ b/test/fixtures/esprima/expression-left-hand-side/migrated_0001/actual.js @@ -0,0 +1 @@ +new Button() diff --git a/test/fixtures/esprima/expression-left-hand-side/migrated_0001/expected.json b/test/fixtures/esprima/expression-left-hand-side/migrated_0001/expected.json new file mode 100644 index 0000000000..782d5ea7e4 --- /dev/null +++ b/test/fixtures/esprima/expression-left-hand-side/migrated_0001/expected.json @@ -0,0 +1,80 @@ +{ + "type": "File", + "start": 0, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "expression": { + "type": "NewExpression", + "start": 0, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "callee": { + "type": "Identifier", + "start": 4, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "name": "Button" + }, + "arguments": [] + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/expression-left-hand-side/migrated_0002/actual.js b/test/fixtures/esprima/expression-left-hand-side/migrated_0002/actual.js new file mode 100644 index 0000000000..94d35b3de1 --- /dev/null +++ b/test/fixtures/esprima/expression-left-hand-side/migrated_0002/actual.js @@ -0,0 +1 @@ +new new foo diff --git a/test/fixtures/esprima/expression-left-hand-side/migrated_0002/expected.json b/test/fixtures/esprima/expression-left-hand-side/migrated_0002/expected.json new file mode 100644 index 0000000000..376081c391 --- /dev/null +++ b/test/fixtures/esprima/expression-left-hand-side/migrated_0002/expected.json @@ -0,0 +1,96 @@ +{ + "type": "File", + "start": 0, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "expression": { + "type": "NewExpression", + "start": 0, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "callee": { + "type": "NewExpression", + "start": 4, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "callee": { + "type": "Identifier", + "start": 8, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "name": "foo" + }, + "arguments": [] + }, + "arguments": [] + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/expression-left-hand-side/migrated_0003/actual.js b/test/fixtures/esprima/expression-left-hand-side/migrated_0003/actual.js new file mode 100644 index 0000000000..dd7e741e59 --- /dev/null +++ b/test/fixtures/esprima/expression-left-hand-side/migrated_0003/actual.js @@ -0,0 +1 @@ +new new foo() diff --git a/test/fixtures/esprima/expression-left-hand-side/migrated_0003/expected.json b/test/fixtures/esprima/expression-left-hand-side/migrated_0003/expected.json new file mode 100644 index 0000000000..5c476aa6cf --- /dev/null +++ b/test/fixtures/esprima/expression-left-hand-side/migrated_0003/expected.json @@ -0,0 +1,96 @@ +{ + "type": "File", + "start": 0, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "expression": { + "type": "NewExpression", + "start": 0, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "callee": { + "type": "NewExpression", + "start": 4, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "callee": { + "type": "Identifier", + "start": 8, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "name": "foo" + }, + "arguments": [] + }, + "arguments": [] + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/expression-left-hand-side/migrated_0004/actual.js b/test/fixtures/esprima/expression-left-hand-side/migrated_0004/actual.js new file mode 100644 index 0000000000..70f5f76c68 --- /dev/null +++ b/test/fixtures/esprima/expression-left-hand-side/migrated_0004/actual.js @@ -0,0 +1 @@ +new foo().bar() diff --git a/test/fixtures/esprima/expression-left-hand-side/migrated_0004/expected.json b/test/fixtures/esprima/expression-left-hand-side/migrated_0004/expected.json new file mode 100644 index 0000000000..1b87993df9 --- /dev/null +++ b/test/fixtures/esprima/expression-left-hand-side/migrated_0004/expected.json @@ -0,0 +1,128 @@ +{ + "type": "File", + "start": 0, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "expression": { + "type": "CallExpression", + "start": 0, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "callee": { + "type": "MemberExpression", + "start": 0, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "object": { + "type": "NewExpression", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "callee": { + "type": "Identifier", + "start": 4, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "name": "foo" + }, + "arguments": [] + }, + "property": { + "type": "Identifier", + "start": 10, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "name": "bar" + }, + "computed": false + }, + "arguments": [] + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/expression-left-hand-side/migrated_0005/actual.js b/test/fixtures/esprima/expression-left-hand-side/migrated_0005/actual.js new file mode 100644 index 0000000000..970159627a --- /dev/null +++ b/test/fixtures/esprima/expression-left-hand-side/migrated_0005/actual.js @@ -0,0 +1 @@ +new foo[bar] diff --git a/test/fixtures/esprima/expression-left-hand-side/migrated_0005/expected.json b/test/fixtures/esprima/expression-left-hand-side/migrated_0005/expected.json new file mode 100644 index 0000000000..952d418f50 --- /dev/null +++ b/test/fixtures/esprima/expression-left-hand-side/migrated_0005/expected.json @@ -0,0 +1,112 @@ +{ + "type": "File", + "start": 0, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "expression": { + "type": "NewExpression", + "start": 0, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "callee": { + "type": "MemberExpression", + "start": 4, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "object": { + "type": "Identifier", + "start": 4, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "name": "foo" + }, + "property": { + "type": "Identifier", + "start": 8, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "name": "bar" + }, + "computed": true + }, + "arguments": [] + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/expression-left-hand-side/migrated_0006/actual.js b/test/fixtures/esprima/expression-left-hand-side/migrated_0006/actual.js new file mode 100644 index 0000000000..c8eaa7d3df --- /dev/null +++ b/test/fixtures/esprima/expression-left-hand-side/migrated_0006/actual.js @@ -0,0 +1 @@ +new foo.bar() diff --git a/test/fixtures/esprima/expression-left-hand-side/migrated_0006/expected.json b/test/fixtures/esprima/expression-left-hand-side/migrated_0006/expected.json new file mode 100644 index 0000000000..7ace856b56 --- /dev/null +++ b/test/fixtures/esprima/expression-left-hand-side/migrated_0006/expected.json @@ -0,0 +1,112 @@ +{ + "type": "File", + "start": 0, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "expression": { + "type": "NewExpression", + "start": 0, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "callee": { + "type": "MemberExpression", + "start": 4, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "object": { + "type": "Identifier", + "start": 4, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "name": "foo" + }, + "property": { + "type": "Identifier", + "start": 8, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "name": "bar" + }, + "computed": false + }, + "arguments": [] + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/expression-left-hand-side/migrated_0007/actual.js b/test/fixtures/esprima/expression-left-hand-side/migrated_0007/actual.js new file mode 100644 index 0000000000..3cfaa821f0 --- /dev/null +++ b/test/fixtures/esprima/expression-left-hand-side/migrated_0007/actual.js @@ -0,0 +1 @@ +( new foo).bar() diff --git a/test/fixtures/esprima/expression-left-hand-side/migrated_0007/expected.json b/test/fixtures/esprima/expression-left-hand-side/migrated_0007/expected.json new file mode 100644 index 0000000000..b353ef2c83 --- /dev/null +++ b/test/fixtures/esprima/expression-left-hand-side/migrated_0007/expected.json @@ -0,0 +1,129 @@ +{ + "type": "File", + "start": 0, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "expression": { + "type": "CallExpression", + "start": 0, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "callee": { + "type": "MemberExpression", + "start": 0, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "object": { + "type": "NewExpression", + "start": 2, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 2 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "callee": { + "type": "Identifier", + "start": 6, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "name": "foo" + }, + "arguments": [], + "parenthesizedExpression": true + }, + "property": { + "type": "Identifier", + "start": 11, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 11 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "name": "bar" + }, + "computed": false + }, + "arguments": [] + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/expression-left-hand-side/migrated_0008/actual.js b/test/fixtures/esprima/expression-left-hand-side/migrated_0008/actual.js new file mode 100644 index 0000000000..da0f4f336f --- /dev/null +++ b/test/fixtures/esprima/expression-left-hand-side/migrated_0008/actual.js @@ -0,0 +1 @@ +foo(bar, baz) diff --git a/test/fixtures/esprima/expression-left-hand-side/migrated_0008/expected.json b/test/fixtures/esprima/expression-left-hand-side/migrated_0008/expected.json new file mode 100644 index 0000000000..c20918ced6 --- /dev/null +++ b/test/fixtures/esprima/expression-left-hand-side/migrated_0008/expected.json @@ -0,0 +1,113 @@ +{ + "type": "File", + "start": 0, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "expression": { + "type": "CallExpression", + "start": 0, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "callee": { + "type": "Identifier", + "start": 0, + "end": 3, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 3 + } + }, + "name": "foo" + }, + "arguments": [ + { + "type": "Identifier", + "start": 4, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "name": "bar" + }, + { + "type": "Identifier", + "start": 9, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "name": "baz" + } + ] + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/expression-left-hand-side/migrated_0009/actual.js b/test/fixtures/esprima/expression-left-hand-side/migrated_0009/actual.js new file mode 100644 index 0000000000..f3004e7a57 --- /dev/null +++ b/test/fixtures/esprima/expression-left-hand-side/migrated_0009/actual.js @@ -0,0 +1 @@ +( foo )() diff --git a/test/fixtures/esprima/expression-left-hand-side/migrated_0009/expected.json b/test/fixtures/esprima/expression-left-hand-side/migrated_0009/expected.json new file mode 100644 index 0000000000..6105d2841a --- /dev/null +++ b/test/fixtures/esprima/expression-left-hand-side/migrated_0009/expected.json @@ -0,0 +1,81 @@ +{ + "type": "File", + "start": 0, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "expression": { + "type": "CallExpression", + "start": 0, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "callee": { + "type": "Identifier", + "start": 5, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "name": "foo", + "parenthesizedExpression": true + }, + "arguments": [] + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/expression-left-hand-side/migrated_0010/actual.js b/test/fixtures/esprima/expression-left-hand-side/migrated_0010/actual.js new file mode 100644 index 0000000000..02ad348883 --- /dev/null +++ b/test/fixtures/esprima/expression-left-hand-side/migrated_0010/actual.js @@ -0,0 +1 @@ +universe.milkyway diff --git a/test/fixtures/esprima/expression-left-hand-side/migrated_0010/expected.json b/test/fixtures/esprima/expression-left-hand-side/migrated_0010/expected.json new file mode 100644 index 0000000000..937e364bb2 --- /dev/null +++ b/test/fixtures/esprima/expression-left-hand-side/migrated_0010/expected.json @@ -0,0 +1,96 @@ +{ + "type": "File", + "start": 0, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "expression": { + "type": "MemberExpression", + "start": 0, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "object": { + "type": "Identifier", + "start": 0, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "name": "universe" + }, + "property": { + "type": "Identifier", + "start": 9, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "name": "milkyway" + }, + "computed": false + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/expression-left-hand-side/migrated_0011/actual.js b/test/fixtures/esprima/expression-left-hand-side/migrated_0011/actual.js new file mode 100644 index 0000000000..aafe7cd7c7 --- /dev/null +++ b/test/fixtures/esprima/expression-left-hand-side/migrated_0011/actual.js @@ -0,0 +1 @@ +universe.milkyway.solarsystem diff --git a/test/fixtures/esprima/expression-left-hand-side/migrated_0011/expected.json b/test/fixtures/esprima/expression-left-hand-side/migrated_0011/expected.json new file mode 100644 index 0000000000..9b9c988c91 --- /dev/null +++ b/test/fixtures/esprima/expression-left-hand-side/migrated_0011/expected.json @@ -0,0 +1,128 @@ +{ + "type": "File", + "start": 0, + "end": 29, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 29 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 29, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 29 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 29, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 29 + } + }, + "expression": { + "type": "MemberExpression", + "start": 0, + "end": 29, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 29 + } + }, + "object": { + "type": "MemberExpression", + "start": 0, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "object": { + "type": "Identifier", + "start": 0, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "name": "universe" + }, + "property": { + "type": "Identifier", + "start": 9, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "name": "milkyway" + }, + "computed": false + }, + "property": { + "type": "Identifier", + "start": 18, + "end": 29, + "loc": { + "start": { + "line": 1, + "column": 18 + }, + "end": { + "line": 1, + "column": 29 + } + }, + "name": "solarsystem" + }, + "computed": false + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/expression-left-hand-side/migrated_0012/actual.js b/test/fixtures/esprima/expression-left-hand-side/migrated_0012/actual.js new file mode 100644 index 0000000000..eae277418a --- /dev/null +++ b/test/fixtures/esprima/expression-left-hand-side/migrated_0012/actual.js @@ -0,0 +1 @@ +universe.milkyway.solarsystem.Earth diff --git a/test/fixtures/esprima/expression-left-hand-side/migrated_0012/expected.json b/test/fixtures/esprima/expression-left-hand-side/migrated_0012/expected.json new file mode 100644 index 0000000000..e160672e6a --- /dev/null +++ b/test/fixtures/esprima/expression-left-hand-side/migrated_0012/expected.json @@ -0,0 +1,160 @@ +{ + "type": "File", + "start": 0, + "end": 35, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 35 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 35, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 35 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 35, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 35 + } + }, + "expression": { + "type": "MemberExpression", + "start": 0, + "end": 35, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 35 + } + }, + "object": { + "type": "MemberExpression", + "start": 0, + "end": 29, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 29 + } + }, + "object": { + "type": "MemberExpression", + "start": 0, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "object": { + "type": "Identifier", + "start": 0, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "name": "universe" + }, + "property": { + "type": "Identifier", + "start": 9, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "name": "milkyway" + }, + "computed": false + }, + "property": { + "type": "Identifier", + "start": 18, + "end": 29, + "loc": { + "start": { + "line": 1, + "column": 18 + }, + "end": { + "line": 1, + "column": 29 + } + }, + "name": "solarsystem" + }, + "computed": false + }, + "property": { + "type": "Identifier", + "start": 30, + "end": 35, + "loc": { + "start": { + "line": 1, + "column": 30 + }, + "end": { + "line": 1, + "column": 35 + } + }, + "name": "Earth" + }, + "computed": false + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/expression-left-hand-side/migrated_0013/actual.js b/test/fixtures/esprima/expression-left-hand-side/migrated_0013/actual.js new file mode 100644 index 0000000000..3b1db67828 --- /dev/null +++ b/test/fixtures/esprima/expression-left-hand-side/migrated_0013/actual.js @@ -0,0 +1 @@ +universe[galaxyName, otherUselessName] diff --git a/test/fixtures/esprima/expression-left-hand-side/migrated_0013/expected.json b/test/fixtures/esprima/expression-left-hand-side/migrated_0013/expected.json new file mode 100644 index 0000000000..269aad8658 --- /dev/null +++ b/test/fixtures/esprima/expression-left-hand-side/migrated_0013/expected.json @@ -0,0 +1,129 @@ +{ + "type": "File", + "start": 0, + "end": 38, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 38 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 38, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 38 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 38, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 38 + } + }, + "expression": { + "type": "MemberExpression", + "start": 0, + "end": 38, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 38 + } + }, + "object": { + "type": "Identifier", + "start": 0, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "name": "universe" + }, + "property": { + "type": "SequenceExpression", + "start": 9, + "end": 37, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 37 + } + }, + "expressions": [ + { + "type": "Identifier", + "start": 9, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 19 + } + }, + "name": "galaxyName" + }, + { + "type": "Identifier", + "start": 21, + "end": 37, + "loc": { + "start": { + "line": 1, + "column": 21 + }, + "end": { + "line": 1, + "column": 37 + } + }, + "name": "otherUselessName" + } + ] + }, + "computed": true + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/expression-left-hand-side/migrated_0014/actual.js b/test/fixtures/esprima/expression-left-hand-side/migrated_0014/actual.js new file mode 100644 index 0000000000..47f9ec6916 --- /dev/null +++ b/test/fixtures/esprima/expression-left-hand-side/migrated_0014/actual.js @@ -0,0 +1 @@ +universe[galaxyName] diff --git a/test/fixtures/esprima/expression-left-hand-side/migrated_0014/expected.json b/test/fixtures/esprima/expression-left-hand-side/migrated_0014/expected.json new file mode 100644 index 0000000000..fd2ad08336 --- /dev/null +++ b/test/fixtures/esprima/expression-left-hand-side/migrated_0014/expected.json @@ -0,0 +1,96 @@ +{ + "type": "File", + "start": 0, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "expression": { + "type": "MemberExpression", + "start": 0, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "object": { + "type": "Identifier", + "start": 0, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "name": "universe" + }, + "property": { + "type": "Identifier", + "start": 9, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 19 + } + }, + "name": "galaxyName" + }, + "computed": true + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/expression-left-hand-side/migrated_0015/actual.js b/test/fixtures/esprima/expression-left-hand-side/migrated_0015/actual.js new file mode 100644 index 0000000000..79781fb356 --- /dev/null +++ b/test/fixtures/esprima/expression-left-hand-side/migrated_0015/actual.js @@ -0,0 +1 @@ +universe[42].galaxies diff --git a/test/fixtures/esprima/expression-left-hand-side/migrated_0015/expected.json b/test/fixtures/esprima/expression-left-hand-side/migrated_0015/expected.json new file mode 100644 index 0000000000..cca9b0fc82 --- /dev/null +++ b/test/fixtures/esprima/expression-left-hand-side/migrated_0015/expected.json @@ -0,0 +1,130 @@ +{ + "type": "File", + "start": 0, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 21 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 21 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 21 + } + }, + "expression": { + "type": "MemberExpression", + "start": 0, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 21 + } + }, + "object": { + "type": "MemberExpression", + "start": 0, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "object": { + "type": "Identifier", + "start": 0, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "name": "universe" + }, + "property": { + "type": "Literal", + "start": 9, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "value": 42, + "rawValue": 42, + "raw": "42" + }, + "computed": true + }, + "property": { + "type": "Identifier", + "start": 13, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 1, + "column": 21 + } + }, + "name": "galaxies" + }, + "computed": false + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/expression-left-hand-side/migrated_0016/actual.js b/test/fixtures/esprima/expression-left-hand-side/migrated_0016/actual.js new file mode 100644 index 0000000000..3d6d662393 --- /dev/null +++ b/test/fixtures/esprima/expression-left-hand-side/migrated_0016/actual.js @@ -0,0 +1 @@ +universe(42).galaxies diff --git a/test/fixtures/esprima/expression-left-hand-side/migrated_0016/expected.json b/test/fixtures/esprima/expression-left-hand-side/migrated_0016/expected.json new file mode 100644 index 0000000000..463a77c2e5 --- /dev/null +++ b/test/fixtures/esprima/expression-left-hand-side/migrated_0016/expected.json @@ -0,0 +1,131 @@ +{ + "type": "File", + "start": 0, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 21 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 21 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 21 + } + }, + "expression": { + "type": "MemberExpression", + "start": 0, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 21 + } + }, + "object": { + "type": "CallExpression", + "start": 0, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "callee": { + "type": "Identifier", + "start": 0, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "name": "universe" + }, + "arguments": [ + { + "type": "Literal", + "start": 9, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "value": 42, + "rawValue": 42, + "raw": "42" + } + ] + }, + "property": { + "type": "Identifier", + "start": 13, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 1, + "column": 21 + } + }, + "name": "galaxies" + }, + "computed": false + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/expression-left-hand-side/migrated_0017/actual.js b/test/fixtures/esprima/expression-left-hand-side/migrated_0017/actual.js new file mode 100644 index 0000000000..76785c5f46 --- /dev/null +++ b/test/fixtures/esprima/expression-left-hand-side/migrated_0017/actual.js @@ -0,0 +1 @@ +universe(42).galaxies(14, 3, 77).milkyway diff --git a/test/fixtures/esprima/expression-left-hand-side/migrated_0017/expected.json b/test/fixtures/esprima/expression-left-hand-side/migrated_0017/expected.json new file mode 100644 index 0000000000..fab1521321 --- /dev/null +++ b/test/fixtures/esprima/expression-left-hand-side/migrated_0017/expected.json @@ -0,0 +1,234 @@ +{ + "type": "File", + "start": 0, + "end": 41, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 41 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 41, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 41 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 41, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 41 + } + }, + "expression": { + "type": "MemberExpression", + "start": 0, + "end": 41, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 41 + } + }, + "object": { + "type": "CallExpression", + "start": 0, + "end": 32, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 32 + } + }, + "callee": { + "type": "MemberExpression", + "start": 0, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 21 + } + }, + "object": { + "type": "CallExpression", + "start": 0, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "callee": { + "type": "Identifier", + "start": 0, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "name": "universe" + }, + "arguments": [ + { + "type": "Literal", + "start": 9, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "value": 42, + "rawValue": 42, + "raw": "42" + } + ] + }, + "property": { + "type": "Identifier", + "start": 13, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 1, + "column": 21 + } + }, + "name": "galaxies" + }, + "computed": false + }, + "arguments": [ + { + "type": "Literal", + "start": 22, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 22 + }, + "end": { + "line": 1, + "column": 24 + } + }, + "value": 14, + "rawValue": 14, + "raw": "14" + }, + { + "type": "Literal", + "start": 26, + "end": 27, + "loc": { + "start": { + "line": 1, + "column": 26 + }, + "end": { + "line": 1, + "column": 27 + } + }, + "value": 3, + "rawValue": 3, + "raw": "3" + }, + { + "type": "Literal", + "start": 29, + "end": 31, + "loc": { + "start": { + "line": 1, + "column": 29 + }, + "end": { + "line": 1, + "column": 31 + } + }, + "value": 77, + "rawValue": 77, + "raw": "77" + } + ] + }, + "property": { + "type": "Identifier", + "start": 33, + "end": 41, + "loc": { + "start": { + "line": 1, + "column": 33 + }, + "end": { + "line": 1, + "column": 41 + } + }, + "name": "milkyway" + }, + "computed": false + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/expression-left-hand-side/migrated_0018/actual.js b/test/fixtures/esprima/expression-left-hand-side/migrated_0018/actual.js new file mode 100644 index 0000000000..423bc528eb --- /dev/null +++ b/test/fixtures/esprima/expression-left-hand-side/migrated_0018/actual.js @@ -0,0 +1 @@ +earth.asia.Indonesia.prepareForElection(2014) diff --git a/test/fixtures/esprima/expression-left-hand-side/migrated_0018/expected.json b/test/fixtures/esprima/expression-left-hand-side/migrated_0018/expected.json new file mode 100644 index 0000000000..762a4f980c --- /dev/null +++ b/test/fixtures/esprima/expression-left-hand-side/migrated_0018/expected.json @@ -0,0 +1,195 @@ +{ + "type": "File", + "start": 0, + "end": 45, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 45 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 45, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 45 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 45, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 45 + } + }, + "expression": { + "type": "CallExpression", + "start": 0, + "end": 45, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 45 + } + }, + "callee": { + "type": "MemberExpression", + "start": 0, + "end": 39, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 39 + } + }, + "object": { + "type": "MemberExpression", + "start": 0, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "object": { + "type": "MemberExpression", + "start": 0, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "object": { + "type": "Identifier", + "start": 0, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "name": "earth" + }, + "property": { + "type": "Identifier", + "start": 6, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "name": "asia" + }, + "computed": false + }, + "property": { + "type": "Identifier", + "start": 11, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 11 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "name": "Indonesia" + }, + "computed": false + }, + "property": { + "type": "Identifier", + "start": 21, + "end": 39, + "loc": { + "start": { + "line": 1, + "column": 21 + }, + "end": { + "line": 1, + "column": 39 + } + }, + "name": "prepareForElection" + }, + "computed": false + }, + "arguments": [ + { + "type": "Literal", + "start": 40, + "end": 44, + "loc": { + "start": { + "line": 1, + "column": 40 + }, + "end": { + "line": 1, + "column": 44 + } + }, + "value": 2014, + "rawValue": 2014, + "raw": "2014" + } + ] + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/expression-left-hand-side/migrated_0019/actual.js b/test/fixtures/esprima/expression-left-hand-side/migrated_0019/actual.js new file mode 100644 index 0000000000..1999f5dc40 --- /dev/null +++ b/test/fixtures/esprima/expression-left-hand-side/migrated_0019/actual.js @@ -0,0 +1 @@ +universe.if diff --git a/test/fixtures/esprima/expression-left-hand-side/migrated_0019/expected.json b/test/fixtures/esprima/expression-left-hand-side/migrated_0019/expected.json new file mode 100644 index 0000000000..41129f5624 --- /dev/null +++ b/test/fixtures/esprima/expression-left-hand-side/migrated_0019/expected.json @@ -0,0 +1,96 @@ +{ + "type": "File", + "start": 0, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "expression": { + "type": "MemberExpression", + "start": 0, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "object": { + "type": "Identifier", + "start": 0, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "name": "universe" + }, + "property": { + "type": "Identifier", + "start": 9, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "name": "if" + }, + "computed": false + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/expression-left-hand-side/migrated_0020/actual.js b/test/fixtures/esprima/expression-left-hand-side/migrated_0020/actual.js new file mode 100644 index 0000000000..5c90c4fefb --- /dev/null +++ b/test/fixtures/esprima/expression-left-hand-side/migrated_0020/actual.js @@ -0,0 +1 @@ +universe.true diff --git a/test/fixtures/esprima/expression-left-hand-side/migrated_0020/expected.json b/test/fixtures/esprima/expression-left-hand-side/migrated_0020/expected.json new file mode 100644 index 0000000000..b31bc7542a --- /dev/null +++ b/test/fixtures/esprima/expression-left-hand-side/migrated_0020/expected.json @@ -0,0 +1,96 @@ +{ + "type": "File", + "start": 0, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "expression": { + "type": "MemberExpression", + "start": 0, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "object": { + "type": "Identifier", + "start": 0, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "name": "universe" + }, + "property": { + "type": "Identifier", + "start": 9, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "name": "true" + }, + "computed": false + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/expression-left-hand-side/migrated_0021/actual.js b/test/fixtures/esprima/expression-left-hand-side/migrated_0021/actual.js new file mode 100644 index 0000000000..5fe9f0397c --- /dev/null +++ b/test/fixtures/esprima/expression-left-hand-side/migrated_0021/actual.js @@ -0,0 +1 @@ +universe.false diff --git a/test/fixtures/esprima/expression-left-hand-side/migrated_0021/expected.json b/test/fixtures/esprima/expression-left-hand-side/migrated_0021/expected.json new file mode 100644 index 0000000000..5bc538a2b9 --- /dev/null +++ b/test/fixtures/esprima/expression-left-hand-side/migrated_0021/expected.json @@ -0,0 +1,96 @@ +{ + "type": "File", + "start": 0, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "expression": { + "type": "MemberExpression", + "start": 0, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "object": { + "type": "Identifier", + "start": 0, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "name": "universe" + }, + "property": { + "type": "Identifier", + "start": 9, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "name": "false" + }, + "computed": false + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/expression-left-hand-side/migrated_0022/actual.js b/test/fixtures/esprima/expression-left-hand-side/migrated_0022/actual.js new file mode 100644 index 0000000000..b439c86b98 --- /dev/null +++ b/test/fixtures/esprima/expression-left-hand-side/migrated_0022/actual.js @@ -0,0 +1 @@ +universe.null diff --git a/test/fixtures/esprima/expression-left-hand-side/migrated_0022/expected.json b/test/fixtures/esprima/expression-left-hand-side/migrated_0022/expected.json new file mode 100644 index 0000000000..a8f3caddc1 --- /dev/null +++ b/test/fixtures/esprima/expression-left-hand-side/migrated_0022/expected.json @@ -0,0 +1,96 @@ +{ + "type": "File", + "start": 0, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "expression": { + "type": "MemberExpression", + "start": 0, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "object": { + "type": "Identifier", + "start": 0, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "name": "universe" + }, + "property": { + "type": "Identifier", + "start": 9, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "name": "null" + }, + "computed": false + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/expression-multiplicative/migrated_0000/actual.js b/test/fixtures/esprima/expression-multiplicative/migrated_0000/actual.js new file mode 100644 index 0000000000..d1a067af67 --- /dev/null +++ b/test/fixtures/esprima/expression-multiplicative/migrated_0000/actual.js @@ -0,0 +1 @@ +x * y diff --git a/test/fixtures/esprima/expression-multiplicative/migrated_0000/expected.json b/test/fixtures/esprima/expression-multiplicative/migrated_0000/expected.json new file mode 100644 index 0000000000..89022ede9f --- /dev/null +++ b/test/fixtures/esprima/expression-multiplicative/migrated_0000/expected.json @@ -0,0 +1,96 @@ +{ + "type": "File", + "start": 0, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "expression": { + "type": "BinaryExpression", + "start": 0, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "left": { + "type": "Identifier", + "start": 0, + "end": 1, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + } + }, + "name": "x" + }, + "operator": "*", + "right": { + "type": "Identifier", + "start": 4, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "name": "y" + } + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/expression-multiplicative/migrated_0001/actual.js b/test/fixtures/esprima/expression-multiplicative/migrated_0001/actual.js new file mode 100644 index 0000000000..02514641d8 --- /dev/null +++ b/test/fixtures/esprima/expression-multiplicative/migrated_0001/actual.js @@ -0,0 +1 @@ +x / y diff --git a/test/fixtures/esprima/expression-multiplicative/migrated_0001/expected.json b/test/fixtures/esprima/expression-multiplicative/migrated_0001/expected.json new file mode 100644 index 0000000000..8a860dd890 --- /dev/null +++ b/test/fixtures/esprima/expression-multiplicative/migrated_0001/expected.json @@ -0,0 +1,96 @@ +{ + "type": "File", + "start": 0, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "expression": { + "type": "BinaryExpression", + "start": 0, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "left": { + "type": "Identifier", + "start": 0, + "end": 1, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + } + }, + "name": "x" + }, + "operator": "/", + "right": { + "type": "Identifier", + "start": 4, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "name": "y" + } + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/expression-multiplicative/migrated_0002/actual.js b/test/fixtures/esprima/expression-multiplicative/migrated_0002/actual.js new file mode 100644 index 0000000000..e5605cc2ca --- /dev/null +++ b/test/fixtures/esprima/expression-multiplicative/migrated_0002/actual.js @@ -0,0 +1 @@ +x % y diff --git a/test/fixtures/esprima/expression-multiplicative/migrated_0002/expected.json b/test/fixtures/esprima/expression-multiplicative/migrated_0002/expected.json new file mode 100644 index 0000000000..2887a84d0e --- /dev/null +++ b/test/fixtures/esprima/expression-multiplicative/migrated_0002/expected.json @@ -0,0 +1,96 @@ +{ + "type": "File", + "start": 0, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "expression": { + "type": "BinaryExpression", + "start": 0, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "left": { + "type": "Identifier", + "start": 0, + "end": 1, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + } + }, + "name": "x" + }, + "operator": "%", + "right": { + "type": "Identifier", + "start": 4, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "name": "y" + } + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/expression-postfix/migrated_0000/actual.js b/test/fixtures/esprima/expression-postfix/migrated_0000/actual.js new file mode 100644 index 0000000000..364dc43646 --- /dev/null +++ b/test/fixtures/esprima/expression-postfix/migrated_0000/actual.js @@ -0,0 +1 @@ +x++ diff --git a/test/fixtures/esprima/expression-postfix/migrated_0000/expected.json b/test/fixtures/esprima/expression-postfix/migrated_0000/expected.json new file mode 100644 index 0000000000..0712715b16 --- /dev/null +++ b/test/fixtures/esprima/expression-postfix/migrated_0000/expected.json @@ -0,0 +1,81 @@ +{ + "type": "File", + "start": 0, + "end": 3, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 3 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 3, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 3 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 3, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 3 + } + }, + "expression": { + "type": "UpdateExpression", + "start": 0, + "end": 3, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 3 + } + }, + "operator": "++", + "prefix": false, + "argument": { + "type": "Identifier", + "start": 0, + "end": 1, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + } + }, + "name": "x" + } + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/expression-postfix/migrated_0001/actual.js b/test/fixtures/esprima/expression-postfix/migrated_0001/actual.js new file mode 100644 index 0000000000..0820536cd8 --- /dev/null +++ b/test/fixtures/esprima/expression-postfix/migrated_0001/actual.js @@ -0,0 +1 @@ +x-- diff --git a/test/fixtures/esprima/expression-postfix/migrated_0001/expected.json b/test/fixtures/esprima/expression-postfix/migrated_0001/expected.json new file mode 100644 index 0000000000..c4ea608985 --- /dev/null +++ b/test/fixtures/esprima/expression-postfix/migrated_0001/expected.json @@ -0,0 +1,81 @@ +{ + "type": "File", + "start": 0, + "end": 3, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 3 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 3, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 3 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 3, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 3 + } + }, + "expression": { + "type": "UpdateExpression", + "start": 0, + "end": 3, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 3 + } + }, + "operator": "--", + "prefix": false, + "argument": { + "type": "Identifier", + "start": 0, + "end": 1, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + } + }, + "name": "x" + } + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/expression-postfix/migrated_0002/actual.js b/test/fixtures/esprima/expression-postfix/migrated_0002/actual.js new file mode 100644 index 0000000000..71a7f25653 --- /dev/null +++ b/test/fixtures/esprima/expression-postfix/migrated_0002/actual.js @@ -0,0 +1 @@ +eval++ diff --git a/test/fixtures/esprima/expression-postfix/migrated_0002/expected.json b/test/fixtures/esprima/expression-postfix/migrated_0002/expected.json new file mode 100644 index 0000000000..b1909f3acc --- /dev/null +++ b/test/fixtures/esprima/expression-postfix/migrated_0002/expected.json @@ -0,0 +1,81 @@ +{ + "type": "File", + "start": 0, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "expression": { + "type": "UpdateExpression", + "start": 0, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "operator": "++", + "prefix": false, + "argument": { + "type": "Identifier", + "start": 0, + "end": 4, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 4 + } + }, + "name": "eval" + } + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/expression-postfix/migrated_0003/actual.js b/test/fixtures/esprima/expression-postfix/migrated_0003/actual.js new file mode 100644 index 0000000000..798b38e212 --- /dev/null +++ b/test/fixtures/esprima/expression-postfix/migrated_0003/actual.js @@ -0,0 +1 @@ +eval-- diff --git a/test/fixtures/esprima/expression-postfix/migrated_0003/expected.json b/test/fixtures/esprima/expression-postfix/migrated_0003/expected.json new file mode 100644 index 0000000000..aaebc648e7 --- /dev/null +++ b/test/fixtures/esprima/expression-postfix/migrated_0003/expected.json @@ -0,0 +1,81 @@ +{ + "type": "File", + "start": 0, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "expression": { + "type": "UpdateExpression", + "start": 0, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "operator": "--", + "prefix": false, + "argument": { + "type": "Identifier", + "start": 0, + "end": 4, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 4 + } + }, + "name": "eval" + } + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/expression-postfix/migrated_0004/actual.js b/test/fixtures/esprima/expression-postfix/migrated_0004/actual.js new file mode 100644 index 0000000000..cd0b1ae75a --- /dev/null +++ b/test/fixtures/esprima/expression-postfix/migrated_0004/actual.js @@ -0,0 +1 @@ +arguments++ diff --git a/test/fixtures/esprima/expression-postfix/migrated_0004/expected.json b/test/fixtures/esprima/expression-postfix/migrated_0004/expected.json new file mode 100644 index 0000000000..bb07286fc5 --- /dev/null +++ b/test/fixtures/esprima/expression-postfix/migrated_0004/expected.json @@ -0,0 +1,81 @@ +{ + "type": "File", + "start": 0, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "expression": { + "type": "UpdateExpression", + "start": 0, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "operator": "++", + "prefix": false, + "argument": { + "type": "Identifier", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "name": "arguments" + } + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/expression-postfix/migrated_0005/actual.js b/test/fixtures/esprima/expression-postfix/migrated_0005/actual.js new file mode 100644 index 0000000000..ac1d0470da --- /dev/null +++ b/test/fixtures/esprima/expression-postfix/migrated_0005/actual.js @@ -0,0 +1 @@ +arguments-- diff --git a/test/fixtures/esprima/expression-postfix/migrated_0005/expected.json b/test/fixtures/esprima/expression-postfix/migrated_0005/expected.json new file mode 100644 index 0000000000..5fdbf545d2 --- /dev/null +++ b/test/fixtures/esprima/expression-postfix/migrated_0005/expected.json @@ -0,0 +1,81 @@ +{ + "type": "File", + "start": 0, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "expression": { + "type": "UpdateExpression", + "start": 0, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "operator": "--", + "prefix": false, + "argument": { + "type": "Identifier", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "name": "arguments" + } + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/expression-primary/array/expected.json b/test/fixtures/esprima/expression-primary/array/expected.json new file mode 100644 index 0000000000..10130f3578 --- /dev/null +++ b/test/fixtures/esprima/expression-primary/array/expected.json @@ -0,0 +1,32 @@ +{ + "type": "File", + "start": 0, + "end": 0, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 0 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 0, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 0 + } + }, + "sourceType": "script", + "body": [] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/expression-primary/array/migrated_0000.js b/test/fixtures/esprima/expression-primary/array/migrated_0000.js new file mode 100755 index 0000000000..93edbdf932 --- /dev/null +++ b/test/fixtures/esprima/expression-primary/array/migrated_0000.js @@ -0,0 +1 @@ +x = [] \ No newline at end of file diff --git a/test/fixtures/esprima/expression-primary/array/migrated_0001.js b/test/fixtures/esprima/expression-primary/array/migrated_0001.js new file mode 100755 index 0000000000..bad19c76e0 --- /dev/null +++ b/test/fixtures/esprima/expression-primary/array/migrated_0001.js @@ -0,0 +1 @@ +x = [ ] \ No newline at end of file diff --git a/test/fixtures/esprima/expression-primary/array/migrated_0002.js b/test/fixtures/esprima/expression-primary/array/migrated_0002.js new file mode 100755 index 0000000000..34a371c58c --- /dev/null +++ b/test/fixtures/esprima/expression-primary/array/migrated_0002.js @@ -0,0 +1 @@ +x = [ 42 ] \ No newline at end of file diff --git a/test/fixtures/esprima/expression-primary/array/migrated_0003.js b/test/fixtures/esprima/expression-primary/array/migrated_0003.js new file mode 100755 index 0000000000..4a52d857d6 --- /dev/null +++ b/test/fixtures/esprima/expression-primary/array/migrated_0003.js @@ -0,0 +1 @@ +x = [ 42, ] \ No newline at end of file diff --git a/test/fixtures/esprima/expression-primary/array/migrated_0004.js b/test/fixtures/esprima/expression-primary/array/migrated_0004.js new file mode 100755 index 0000000000..18ce8c0881 --- /dev/null +++ b/test/fixtures/esprima/expression-primary/array/migrated_0004.js @@ -0,0 +1 @@ +x = [ ,, 42 ] \ No newline at end of file diff --git a/test/fixtures/esprima/expression-primary/array/migrated_0005.js b/test/fixtures/esprima/expression-primary/array/migrated_0005.js new file mode 100755 index 0000000000..9a2988fad8 --- /dev/null +++ b/test/fixtures/esprima/expression-primary/array/migrated_0005.js @@ -0,0 +1 @@ +x = [ 1, 2, 3, ] \ No newline at end of file diff --git a/test/fixtures/esprima/expression-primary/array/migrated_0006.js b/test/fixtures/esprima/expression-primary/array/migrated_0006.js new file mode 100755 index 0000000000..9fad480185 --- /dev/null +++ b/test/fixtures/esprima/expression-primary/array/migrated_0006.js @@ -0,0 +1 @@ +x = [ 1, 2,, 3, ] \ No newline at end of file diff --git a/test/fixtures/esprima/expression-primary/array/migrated_0007.js b/test/fixtures/esprima/expression-primary/array/migrated_0007.js new file mode 100755 index 0000000000..16e202fe27 --- /dev/null +++ b/test/fixtures/esprima/expression-primary/array/migrated_0007.js @@ -0,0 +1 @@ +日本語 = [] \ No newline at end of file diff --git a/test/fixtures/esprima/expression-primary/array/migrated_0008.source.js b/test/fixtures/esprima/expression-primary/array/migrated_0008.source.js new file mode 100755 index 0000000000..f0f44705bf --- /dev/null +++ b/test/fixtures/esprima/expression-primary/array/migrated_0008.source.js @@ -0,0 +1 @@ +var source = 'T\u203F = []'; \ No newline at end of file diff --git a/test/fixtures/esprima/expression-primary/array/migrated_0009.source.js b/test/fixtures/esprima/expression-primary/array/migrated_0009.source.js new file mode 100755 index 0000000000..e2eb52f9c7 --- /dev/null +++ b/test/fixtures/esprima/expression-primary/array/migrated_0009.source.js @@ -0,0 +1 @@ +var source = 'T\u200C = []'; \ No newline at end of file diff --git a/test/fixtures/esprima/expression-primary/array/migrated_0010.source.js b/test/fixtures/esprima/expression-primary/array/migrated_0010.source.js new file mode 100755 index 0000000000..bafe63b052 --- /dev/null +++ b/test/fixtures/esprima/expression-primary/array/migrated_0010.source.js @@ -0,0 +1 @@ +var source = 'T\u200D = []'; \ No newline at end of file diff --git a/test/fixtures/esprima/expression-primary/array/migrated_0011.source.js b/test/fixtures/esprima/expression-primary/array/migrated_0011.source.js new file mode 100755 index 0000000000..307b0667e7 --- /dev/null +++ b/test/fixtures/esprima/expression-primary/array/migrated_0011.source.js @@ -0,0 +1 @@ +var source = '\u2163\u2161 = []'; \ No newline at end of file diff --git a/test/fixtures/esprima/expression-primary/array/migrated_0012.source.js b/test/fixtures/esprima/expression-primary/array/migrated_0012.source.js new file mode 100755 index 0000000000..b24f8e1c82 --- /dev/null +++ b/test/fixtures/esprima/expression-primary/array/migrated_0012.source.js @@ -0,0 +1 @@ +var source = '\u2163\u2161\u200A=\u2009[]'; \ No newline at end of file diff --git a/test/fixtures/esprima/expression-primary/literal/expected.json b/test/fixtures/esprima/expression-primary/literal/expected.json new file mode 100644 index 0000000000..10130f3578 --- /dev/null +++ b/test/fixtures/esprima/expression-primary/literal/expected.json @@ -0,0 +1,32 @@ +{ + "type": "File", + "start": 0, + "end": 0, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 0 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 0, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 0 + } + }, + "sourceType": "script", + "body": [] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/expression-primary/literal/numeric/migrated_0000.js b/test/fixtures/esprima/expression-primary/literal/numeric/migrated_0000.js new file mode 100755 index 0000000000..c227083464 --- /dev/null +++ b/test/fixtures/esprima/expression-primary/literal/numeric/migrated_0000.js @@ -0,0 +1 @@ +0 \ No newline at end of file diff --git a/test/fixtures/esprima/expression-primary/literal/numeric/migrated_0001.js b/test/fixtures/esprima/expression-primary/literal/numeric/migrated_0001.js new file mode 100755 index 0000000000..f70d7bba4a --- /dev/null +++ b/test/fixtures/esprima/expression-primary/literal/numeric/migrated_0001.js @@ -0,0 +1 @@ +42 \ No newline at end of file diff --git a/test/fixtures/esprima/expression-primary/literal/numeric/migrated_0002.js b/test/fixtures/esprima/expression-primary/literal/numeric/migrated_0002.js new file mode 100755 index 0000000000..e440e5c842 --- /dev/null +++ b/test/fixtures/esprima/expression-primary/literal/numeric/migrated_0002.js @@ -0,0 +1 @@ +3 \ No newline at end of file diff --git a/test/fixtures/esprima/expression-primary/literal/numeric/migrated_0003.js b/test/fixtures/esprima/expression-primary/literal/numeric/migrated_0003.js new file mode 100755 index 0000000000..7813681f5b --- /dev/null +++ b/test/fixtures/esprima/expression-primary/literal/numeric/migrated_0003.js @@ -0,0 +1 @@ +5 \ No newline at end of file diff --git a/test/fixtures/esprima/expression-primary/literal/numeric/migrated_0004.js b/test/fixtures/esprima/expression-primary/literal/numeric/migrated_0004.js new file mode 100755 index 0000000000..be03e1f60c --- /dev/null +++ b/test/fixtures/esprima/expression-primary/literal/numeric/migrated_0004.js @@ -0,0 +1 @@ +.14 \ No newline at end of file diff --git a/test/fixtures/esprima/expression-primary/literal/numeric/migrated_0005.js b/test/fixtures/esprima/expression-primary/literal/numeric/migrated_0005.js new file mode 100755 index 0000000000..2c0cac55e9 --- /dev/null +++ b/test/fixtures/esprima/expression-primary/literal/numeric/migrated_0005.js @@ -0,0 +1 @@ +3.14159 \ No newline at end of file diff --git a/test/fixtures/esprima/expression-primary/literal/numeric/migrated_0006.js b/test/fixtures/esprima/expression-primary/literal/numeric/migrated_0006.js new file mode 100755 index 0000000000..f5b274b29f --- /dev/null +++ b/test/fixtures/esprima/expression-primary/literal/numeric/migrated_0006.js @@ -0,0 +1 @@ +6.02214179e+23 \ No newline at end of file diff --git a/test/fixtures/esprima/expression-primary/literal/numeric/migrated_0007.js b/test/fixtures/esprima/expression-primary/literal/numeric/migrated_0007.js new file mode 100755 index 0000000000..76ed586cf9 --- /dev/null +++ b/test/fixtures/esprima/expression-primary/literal/numeric/migrated_0007.js @@ -0,0 +1 @@ +1.492417830e-10 \ No newline at end of file diff --git a/test/fixtures/esprima/expression-primary/literal/numeric/migrated_0008.js b/test/fixtures/esprima/expression-primary/literal/numeric/migrated_0008.js new file mode 100755 index 0000000000..4eb9959a2f --- /dev/null +++ b/test/fixtures/esprima/expression-primary/literal/numeric/migrated_0008.js @@ -0,0 +1 @@ +0x0 \ No newline at end of file diff --git a/test/fixtures/esprima/expression-primary/literal/numeric/migrated_0009.js b/test/fixtures/esprima/expression-primary/literal/numeric/migrated_0009.js new file mode 100755 index 0000000000..920f1df47e --- /dev/null +++ b/test/fixtures/esprima/expression-primary/literal/numeric/migrated_0009.js @@ -0,0 +1 @@ +0x0; \ No newline at end of file diff --git a/test/fixtures/esprima/expression-primary/literal/numeric/migrated_0010.js b/test/fixtures/esprima/expression-primary/literal/numeric/migrated_0010.js new file mode 100755 index 0000000000..fc205a7af3 --- /dev/null +++ b/test/fixtures/esprima/expression-primary/literal/numeric/migrated_0010.js @@ -0,0 +1 @@ +0e+100 \ No newline at end of file diff --git a/test/fixtures/esprima/expression-primary/literal/numeric/migrated_0011.js b/test/fixtures/esprima/expression-primary/literal/numeric/migrated_0011.js new file mode 100755 index 0000000000..09ef70253b --- /dev/null +++ b/test/fixtures/esprima/expression-primary/literal/numeric/migrated_0011.js @@ -0,0 +1 @@ +0e+100 \ No newline at end of file diff --git a/test/fixtures/esprima/expression-primary/literal/numeric/migrated_0012.js b/test/fixtures/esprima/expression-primary/literal/numeric/migrated_0012.js new file mode 100755 index 0000000000..2638b79541 --- /dev/null +++ b/test/fixtures/esprima/expression-primary/literal/numeric/migrated_0012.js @@ -0,0 +1 @@ +0xabc \ No newline at end of file diff --git a/test/fixtures/esprima/expression-primary/literal/numeric/migrated_0013.js b/test/fixtures/esprima/expression-primary/literal/numeric/migrated_0013.js new file mode 100755 index 0000000000..f52a51eac0 --- /dev/null +++ b/test/fixtures/esprima/expression-primary/literal/numeric/migrated_0013.js @@ -0,0 +1 @@ +0xdef \ No newline at end of file diff --git a/test/fixtures/esprima/expression-primary/literal/numeric/migrated_0014.js b/test/fixtures/esprima/expression-primary/literal/numeric/migrated_0014.js new file mode 100755 index 0000000000..64239bc1d3 --- /dev/null +++ b/test/fixtures/esprima/expression-primary/literal/numeric/migrated_0014.js @@ -0,0 +1 @@ +0X1A \ No newline at end of file diff --git a/test/fixtures/esprima/expression-primary/literal/numeric/migrated_0015.js b/test/fixtures/esprima/expression-primary/literal/numeric/migrated_0015.js new file mode 100755 index 0000000000..1543d40816 --- /dev/null +++ b/test/fixtures/esprima/expression-primary/literal/numeric/migrated_0015.js @@ -0,0 +1 @@ +0x10 \ No newline at end of file diff --git a/test/fixtures/esprima/expression-primary/literal/numeric/migrated_0016.js b/test/fixtures/esprima/expression-primary/literal/numeric/migrated_0016.js new file mode 100755 index 0000000000..b4df9e41e6 --- /dev/null +++ b/test/fixtures/esprima/expression-primary/literal/numeric/migrated_0016.js @@ -0,0 +1 @@ +0x100 \ No newline at end of file diff --git a/test/fixtures/esprima/expression-primary/literal/numeric/migrated_0017.js b/test/fixtures/esprima/expression-primary/literal/numeric/migrated_0017.js new file mode 100755 index 0000000000..0c023f5103 --- /dev/null +++ b/test/fixtures/esprima/expression-primary/literal/numeric/migrated_0017.js @@ -0,0 +1 @@ +0X04 \ No newline at end of file diff --git a/test/fixtures/esprima/expression-primary/literal/numeric/migrated_0018.js b/test/fixtures/esprima/expression-primary/literal/numeric/migrated_0018.js new file mode 100755 index 0000000000..b08e32771f --- /dev/null +++ b/test/fixtures/esprima/expression-primary/literal/numeric/migrated_0018.js @@ -0,0 +1 @@ +02 \ No newline at end of file diff --git a/test/fixtures/esprima/expression-primary/literal/numeric/migrated_0019.js b/test/fixtures/esprima/expression-primary/literal/numeric/migrated_0019.js new file mode 100755 index 0000000000..108d4a6efa --- /dev/null +++ b/test/fixtures/esprima/expression-primary/literal/numeric/migrated_0019.js @@ -0,0 +1 @@ +012 \ No newline at end of file diff --git a/test/fixtures/esprima/expression-primary/literal/numeric/migrated_0020.js b/test/fixtures/esprima/expression-primary/literal/numeric/migrated_0020.js new file mode 100755 index 0000000000..58aba07363 --- /dev/null +++ b/test/fixtures/esprima/expression-primary/literal/numeric/migrated_0020.js @@ -0,0 +1 @@ +0012 \ No newline at end of file diff --git a/test/fixtures/esprima/expression-primary/literal/numeric/migrated_0021.js b/test/fixtures/esprima/expression-primary/literal/numeric/migrated_0021.js new file mode 100755 index 0000000000..7d4defd631 --- /dev/null +++ b/test/fixtures/esprima/expression-primary/literal/numeric/migrated_0021.js @@ -0,0 +1 @@ +08 \ No newline at end of file diff --git a/test/fixtures/esprima/expression-primary/literal/numeric/migrated_0022.js b/test/fixtures/esprima/expression-primary/literal/numeric/migrated_0022.js new file mode 100755 index 0000000000..63e484e2ed --- /dev/null +++ b/test/fixtures/esprima/expression-primary/literal/numeric/migrated_0022.js @@ -0,0 +1 @@ +0008 \ No newline at end of file diff --git a/test/fixtures/esprima/expression-primary/literal/numeric/migrated_0023.js b/test/fixtures/esprima/expression-primary/literal/numeric/migrated_0023.js new file mode 100755 index 0000000000..aa2f0b2695 --- /dev/null +++ b/test/fixtures/esprima/expression-primary/literal/numeric/migrated_0023.js @@ -0,0 +1 @@ +09 \ No newline at end of file diff --git a/test/fixtures/esprima/expression-primary/literal/numeric/migrated_0024.js b/test/fixtures/esprima/expression-primary/literal/numeric/migrated_0024.js new file mode 100755 index 0000000000..54bb538e84 --- /dev/null +++ b/test/fixtures/esprima/expression-primary/literal/numeric/migrated_0024.js @@ -0,0 +1 @@ +09.5 \ No newline at end of file diff --git a/test/fixtures/esprima/expression-primary/literal/regular-expression/migrated_0000.js b/test/fixtures/esprima/expression-primary/literal/regular-expression/migrated_0000.js new file mode 100755 index 0000000000..abc222ef6c --- /dev/null +++ b/test/fixtures/esprima/expression-primary/literal/regular-expression/migrated_0000.js @@ -0,0 +1 @@ +/p/; \ No newline at end of file diff --git a/test/fixtures/esprima/expression-primary/literal/regular-expression/migrated_0001.js b/test/fixtures/esprima/expression-primary/literal/regular-expression/migrated_0001.js new file mode 100755 index 0000000000..3252cdd9a7 --- /dev/null +++ b/test/fixtures/esprima/expression-primary/literal/regular-expression/migrated_0001.js @@ -0,0 +1 @@ +[/q/] \ No newline at end of file diff --git a/test/fixtures/esprima/expression-primary/literal/regular-expression/migrated_0002.js b/test/fixtures/esprima/expression-primary/literal/regular-expression/migrated_0002.js new file mode 100755 index 0000000000..6bb56b4469 --- /dev/null +++ b/test/fixtures/esprima/expression-primary/literal/regular-expression/migrated_0002.js @@ -0,0 +1 @@ +var x = /[a-z]/i \ No newline at end of file diff --git a/test/fixtures/esprima/expression-primary/literal/regular-expression/migrated_0003.js b/test/fixtures/esprima/expression-primary/literal/regular-expression/migrated_0003.js new file mode 100755 index 0000000000..db1b90a161 --- /dev/null +++ b/test/fixtures/esprima/expression-primary/literal/regular-expression/migrated_0003.js @@ -0,0 +1 @@ +var x = /[a-z]/y \ No newline at end of file diff --git a/test/fixtures/esprima/expression-primary/literal/regular-expression/migrated_0004.js b/test/fixtures/esprima/expression-primary/literal/regular-expression/migrated_0004.js new file mode 100755 index 0000000000..2c1de8e27e --- /dev/null +++ b/test/fixtures/esprima/expression-primary/literal/regular-expression/migrated_0004.js @@ -0,0 +1 @@ +var x = /[a-z]/u \ No newline at end of file diff --git a/test/fixtures/esprima/expression-primary/literal/regular-expression/migrated_0005.source.js b/test/fixtures/esprima/expression-primary/literal/regular-expression/migrated_0005.source.js new file mode 100755 index 0000000000..b2b646e23e --- /dev/null +++ b/test/fixtures/esprima/expression-primary/literal/regular-expression/migrated_0005.source.js @@ -0,0 +1 @@ +var source = 'var x = /[\\u{0000000000000061}-\\u{7A}]/u'; \ No newline at end of file diff --git a/test/fixtures/esprima/expression-primary/literal/regular-expression/migrated_0006.failure.json b/test/fixtures/esprima/expression-primary/literal/regular-expression/migrated_0006.failure.json new file mode 100755 index 0000000000..55cbc7a399 --- /dev/null +++ b/test/fixtures/esprima/expression-primary/literal/regular-expression/migrated_0006.failure.json @@ -0,0 +1,6 @@ +{ + "index": 21, + "lineNumber": 1, + "column": 22, + "message": "Error: Line 1: Invalid regular expression" +} \ No newline at end of file diff --git a/test/fixtures/esprima/expression-primary/literal/regular-expression/migrated_0006.source.js b/test/fixtures/esprima/expression-primary/literal/regular-expression/migrated_0006.source.js new file mode 100755 index 0000000000..964850a64e --- /dev/null +++ b/test/fixtures/esprima/expression-primary/literal/regular-expression/migrated_0006.source.js @@ -0,0 +1 @@ +var source = 'var x = /\\u{110000}/u'; \ No newline at end of file diff --git a/test/fixtures/esprima/expression-primary/literal/regular-expression/migrated_0007.js b/test/fixtures/esprima/expression-primary/literal/regular-expression/migrated_0007.js new file mode 100755 index 0000000000..9381588264 --- /dev/null +++ b/test/fixtures/esprima/expression-primary/literal/regular-expression/migrated_0007.js @@ -0,0 +1 @@ +var x = /[x-z]/i \ No newline at end of file diff --git a/test/fixtures/esprima/expression-primary/literal/regular-expression/migrated_0008.js b/test/fixtures/esprima/expression-primary/literal/regular-expression/migrated_0008.js new file mode 100755 index 0000000000..71e179d728 --- /dev/null +++ b/test/fixtures/esprima/expression-primary/literal/regular-expression/migrated_0008.js @@ -0,0 +1 @@ +var x = /[a-c]/i \ No newline at end of file diff --git a/test/fixtures/esprima/expression-primary/literal/regular-expression/migrated_0009.js b/test/fixtures/esprima/expression-primary/literal/regular-expression/migrated_0009.js new file mode 100755 index 0000000000..cc13baaedb --- /dev/null +++ b/test/fixtures/esprima/expression-primary/literal/regular-expression/migrated_0009.js @@ -0,0 +1 @@ +var x = /[P QR]/i \ No newline at end of file diff --git a/test/fixtures/esprima/expression-primary/literal/regular-expression/migrated_0010.js b/test/fixtures/esprima/expression-primary/literal/regular-expression/migrated_0010.js new file mode 100755 index 0000000000..de30ee8d78 --- /dev/null +++ b/test/fixtures/esprima/expression-primary/literal/regular-expression/migrated_0010.js @@ -0,0 +1 @@ +var x = /[\]/]/ \ No newline at end of file diff --git a/test/fixtures/esprima/expression-primary/literal/regular-expression/migrated_0011.js b/test/fixtures/esprima/expression-primary/literal/regular-expression/migrated_0011.js new file mode 100755 index 0000000000..dec7c26546 --- /dev/null +++ b/test/fixtures/esprima/expression-primary/literal/regular-expression/migrated_0011.js @@ -0,0 +1 @@ +var x = /foo\/bar/ \ No newline at end of file diff --git a/test/fixtures/esprima/expression-primary/literal/regular-expression/migrated_0012.js b/test/fixtures/esprima/expression-primary/literal/regular-expression/migrated_0012.js new file mode 100755 index 0000000000..3778fcff9e --- /dev/null +++ b/test/fixtures/esprima/expression-primary/literal/regular-expression/migrated_0012.js @@ -0,0 +1 @@ +var x = /=([^=\s])+/g \ No newline at end of file diff --git a/test/fixtures/esprima/expression-primary/literal/regular-expression/migrated_0013.js b/test/fixtures/esprima/expression-primary/literal/regular-expression/migrated_0013.js new file mode 100755 index 0000000000..7bb9d02a44 --- /dev/null +++ b/test/fixtures/esprima/expression-primary/literal/regular-expression/migrated_0013.js @@ -0,0 +1 @@ +var x = /42/g.test \ No newline at end of file diff --git a/test/fixtures/esprima/expression-primary/literal/regular-expression/u-flag-invalid-range-4-hex.failure.json b/test/fixtures/esprima/expression-primary/literal/regular-expression/u-flag-invalid-range-4-hex.failure.json new file mode 100755 index 0000000000..9bfbe69a02 --- /dev/null +++ b/test/fixtures/esprima/expression-primary/literal/regular-expression/u-flag-invalid-range-4-hex.failure.json @@ -0,0 +1,6 @@ +{ + "index": 21, + "lineNumber": 1, + "column": 22, + "message": "Error: Line 1: Invalid regular expression" +} diff --git a/test/fixtures/esprima/expression-primary/literal/regular-expression/u-flag-invalid-range-4-hex.js b/test/fixtures/esprima/expression-primary/literal/regular-expression/u-flag-invalid-range-4-hex.js new file mode 100755 index 0000000000..3d8b6d0439 --- /dev/null +++ b/test/fixtures/esprima/expression-primary/literal/regular-expression/u-flag-invalid-range-4-hex.js @@ -0,0 +1 @@ +var x = /[\u0063-b]/u; diff --git a/test/fixtures/esprima/expression-primary/literal/regular-expression/u-flag-invalid-range-var-hex.failure.json b/test/fixtures/esprima/expression-primary/literal/regular-expression/u-flag-invalid-range-var-hex.failure.json new file mode 100755 index 0000000000..9bfbe69a02 --- /dev/null +++ b/test/fixtures/esprima/expression-primary/literal/regular-expression/u-flag-invalid-range-var-hex.failure.json @@ -0,0 +1,6 @@ +{ + "index": 21, + "lineNumber": 1, + "column": 22, + "message": "Error: Line 1: Invalid regular expression" +} diff --git a/test/fixtures/esprima/expression-primary/literal/regular-expression/u-flag-invalid-range-var-hex.js b/test/fixtures/esprima/expression-primary/literal/regular-expression/u-flag-invalid-range-var-hex.js new file mode 100755 index 0000000000..34e1615cf2 --- /dev/null +++ b/test/fixtures/esprima/expression-primary/literal/regular-expression/u-flag-invalid-range-var-hex.js @@ -0,0 +1 @@ +var x = /[\u{63}-b]/u; diff --git a/test/fixtures/esprima/expression-primary/literal/regular-expression/u-flag-surrogate-pair.js b/test/fixtures/esprima/expression-primary/literal/regular-expression/u-flag-surrogate-pair.js new file mode 100755 index 0000000000..b0c93c88cd --- /dev/null +++ b/test/fixtures/esprima/expression-primary/literal/regular-expression/u-flag-surrogate-pair.js @@ -0,0 +1 @@ +var x = /[\uD834\uDF06-\uD834\uDF08a-z]/u diff --git a/test/fixtures/esprima/expression-primary/literal/regular-expression/u-flag-valid-range.js b/test/fixtures/esprima/expression-primary/literal/regular-expression/u-flag-valid-range.js new file mode 100755 index 0000000000..82055ad165 --- /dev/null +++ b/test/fixtures/esprima/expression-primary/literal/regular-expression/u-flag-valid-range.js @@ -0,0 +1 @@ +var x = /[\u{61}-b][\u0061-b][a-\u{62}][a-\u0062]\u{1ffff}/u; diff --git a/test/fixtures/esprima/expression-primary/literal/string/migrated_0000.js b/test/fixtures/esprima/expression-primary/literal/string/migrated_0000.js new file mode 100755 index 0000000000..5638d8ba20 --- /dev/null +++ b/test/fixtures/esprima/expression-primary/literal/string/migrated_0000.js @@ -0,0 +1 @@ +"Hello" \ No newline at end of file diff --git a/test/fixtures/esprima/expression-primary/literal/string/migrated_0001.js b/test/fixtures/esprima/expression-primary/literal/string/migrated_0001.js new file mode 100755 index 0000000000..5df7cc4df6 --- /dev/null +++ b/test/fixtures/esprima/expression-primary/literal/string/migrated_0001.js @@ -0,0 +1 @@ +"\n\r\t\v\b\f\\\'\"\0" \ No newline at end of file diff --git a/test/fixtures/esprima/expression-primary/literal/string/migrated_0002.source.js b/test/fixtures/esprima/expression-primary/literal/string/migrated_0002.source.js new file mode 100755 index 0000000000..0447afbd6f --- /dev/null +++ b/test/fixtures/esprima/expression-primary/literal/string/migrated_0002.source.js @@ -0,0 +1 @@ +var source = '"\\u0061"'; \ No newline at end of file diff --git a/test/fixtures/esprima/expression-primary/literal/string/migrated_0003.js b/test/fixtures/esprima/expression-primary/literal/string/migrated_0003.js new file mode 100755 index 0000000000..e2900ca237 --- /dev/null +++ b/test/fixtures/esprima/expression-primary/literal/string/migrated_0003.js @@ -0,0 +1 @@ +"\x61" \ No newline at end of file diff --git a/test/fixtures/esprima/expression-primary/literal/string/migrated_0006.js b/test/fixtures/esprima/expression-primary/literal/string/migrated_0006.js new file mode 100755 index 0000000000..0b0d9763bc --- /dev/null +++ b/test/fixtures/esprima/expression-primary/literal/string/migrated_0006.js @@ -0,0 +1 @@ +"Hello\nworld" \ No newline at end of file diff --git a/test/fixtures/esprima/expression-primary/literal/string/migrated_0007.js b/test/fixtures/esprima/expression-primary/literal/string/migrated_0007.js new file mode 100755 index 0000000000..7e5e4d1982 --- /dev/null +++ b/test/fixtures/esprima/expression-primary/literal/string/migrated_0007.js @@ -0,0 +1,2 @@ +"Hello\ +world" \ No newline at end of file diff --git a/test/fixtures/esprima/expression-primary/literal/string/migrated_0008.js b/test/fixtures/esprima/expression-primary/literal/string/migrated_0008.js new file mode 100755 index 0000000000..09a19f43fe --- /dev/null +++ b/test/fixtures/esprima/expression-primary/literal/string/migrated_0008.js @@ -0,0 +1 @@ +"Hello\02World" \ No newline at end of file diff --git a/test/fixtures/esprima/expression-primary/literal/string/migrated_0009.js b/test/fixtures/esprima/expression-primary/literal/string/migrated_0009.js new file mode 100755 index 0000000000..b0f991045e --- /dev/null +++ b/test/fixtures/esprima/expression-primary/literal/string/migrated_0009.js @@ -0,0 +1 @@ +"Hello\012World" \ No newline at end of file diff --git a/test/fixtures/esprima/expression-primary/literal/string/migrated_0010.js b/test/fixtures/esprima/expression-primary/literal/string/migrated_0010.js new file mode 100755 index 0000000000..a0768cd433 --- /dev/null +++ b/test/fixtures/esprima/expression-primary/literal/string/migrated_0010.js @@ -0,0 +1 @@ +"Hello\122World" \ No newline at end of file diff --git a/test/fixtures/esprima/expression-primary/literal/string/migrated_0011.js b/test/fixtures/esprima/expression-primary/literal/string/migrated_0011.js new file mode 100755 index 0000000000..7bf843297c --- /dev/null +++ b/test/fixtures/esprima/expression-primary/literal/string/migrated_0011.js @@ -0,0 +1 @@ +"Hello\0122World" \ No newline at end of file diff --git a/test/fixtures/esprima/expression-primary/literal/string/migrated_0012.js b/test/fixtures/esprima/expression-primary/literal/string/migrated_0012.js new file mode 100755 index 0000000000..bb1e3cbb63 --- /dev/null +++ b/test/fixtures/esprima/expression-primary/literal/string/migrated_0012.js @@ -0,0 +1 @@ +"Hello\312World" \ No newline at end of file diff --git a/test/fixtures/esprima/expression-primary/literal/string/migrated_0013.js b/test/fixtures/esprima/expression-primary/literal/string/migrated_0013.js new file mode 100755 index 0000000000..271e2dedac --- /dev/null +++ b/test/fixtures/esprima/expression-primary/literal/string/migrated_0013.js @@ -0,0 +1 @@ +"Hello\412World" \ No newline at end of file diff --git a/test/fixtures/esprima/expression-primary/literal/string/migrated_0015.js b/test/fixtures/esprima/expression-primary/literal/string/migrated_0015.js new file mode 100755 index 0000000000..864a61471d --- /dev/null +++ b/test/fixtures/esprima/expression-primary/literal/string/migrated_0015.js @@ -0,0 +1 @@ +"Hello\712World" \ No newline at end of file diff --git a/test/fixtures/esprima/expression-primary/literal/string/migrated_0016.js b/test/fixtures/esprima/expression-primary/literal/string/migrated_0016.js new file mode 100755 index 0000000000..8e8574da03 --- /dev/null +++ b/test/fixtures/esprima/expression-primary/literal/string/migrated_0016.js @@ -0,0 +1 @@ +"Hello\0World" \ No newline at end of file diff --git a/test/fixtures/esprima/expression-primary/literal/string/migrated_0017.js b/test/fixtures/esprima/expression-primary/literal/string/migrated_0017.js new file mode 100755 index 0000000000..f9ac49bca7 --- /dev/null +++ b/test/fixtures/esprima/expression-primary/literal/string/migrated_0017.js @@ -0,0 +1,2 @@ +"Hello\ +world" \ No newline at end of file diff --git a/test/fixtures/esprima/expression-primary/literal/string/migrated_0018.js b/test/fixtures/esprima/expression-primary/literal/string/migrated_0018.js new file mode 100755 index 0000000000..d667033539 --- /dev/null +++ b/test/fixtures/esprima/expression-primary/literal/string/migrated_0018.js @@ -0,0 +1 @@ +"Hello\1World" \ No newline at end of file diff --git a/test/fixtures/esprima/expression-primary/object/expected.json b/test/fixtures/esprima/expression-primary/object/expected.json new file mode 100644 index 0000000000..10130f3578 --- /dev/null +++ b/test/fixtures/esprima/expression-primary/object/expected.json @@ -0,0 +1,32 @@ +{ + "type": "File", + "start": 0, + "end": 0, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 0 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 0, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 0 + } + }, + "sourceType": "script", + "body": [] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/expression-primary/object/migrated_0000.js b/test/fixtures/esprima/expression-primary/object/migrated_0000.js new file mode 100755 index 0000000000..ad9234753c --- /dev/null +++ b/test/fixtures/esprima/expression-primary/object/migrated_0000.js @@ -0,0 +1 @@ +x = {} \ No newline at end of file diff --git a/test/fixtures/esprima/expression-primary/object/migrated_0001.js b/test/fixtures/esprima/expression-primary/object/migrated_0001.js new file mode 100755 index 0000000000..e2070b1349 --- /dev/null +++ b/test/fixtures/esprima/expression-primary/object/migrated_0001.js @@ -0,0 +1 @@ +x = { } \ No newline at end of file diff --git a/test/fixtures/esprima/expression-primary/object/migrated_0002.js b/test/fixtures/esprima/expression-primary/object/migrated_0002.js new file mode 100755 index 0000000000..ac27b07c1f --- /dev/null +++ b/test/fixtures/esprima/expression-primary/object/migrated_0002.js @@ -0,0 +1 @@ +x = { answer: 42 } \ No newline at end of file diff --git a/test/fixtures/esprima/expression-primary/object/migrated_0003.js b/test/fixtures/esprima/expression-primary/object/migrated_0003.js new file mode 100755 index 0000000000..eb6c39e461 --- /dev/null +++ b/test/fixtures/esprima/expression-primary/object/migrated_0003.js @@ -0,0 +1 @@ +x = { if: 42 } \ No newline at end of file diff --git a/test/fixtures/esprima/expression-primary/object/migrated_0004.js b/test/fixtures/esprima/expression-primary/object/migrated_0004.js new file mode 100755 index 0000000000..cc13060a89 --- /dev/null +++ b/test/fixtures/esprima/expression-primary/object/migrated_0004.js @@ -0,0 +1 @@ +x = { true: 42 } \ No newline at end of file diff --git a/test/fixtures/esprima/expression-primary/object/migrated_0005.js b/test/fixtures/esprima/expression-primary/object/migrated_0005.js new file mode 100755 index 0000000000..232f4d608a --- /dev/null +++ b/test/fixtures/esprima/expression-primary/object/migrated_0005.js @@ -0,0 +1 @@ +x = { false: 42 } \ No newline at end of file diff --git a/test/fixtures/esprima/expression-primary/object/migrated_0006.js b/test/fixtures/esprima/expression-primary/object/migrated_0006.js new file mode 100755 index 0000000000..73fedb55da --- /dev/null +++ b/test/fixtures/esprima/expression-primary/object/migrated_0006.js @@ -0,0 +1 @@ +x = { null: 42 } \ No newline at end of file diff --git a/test/fixtures/esprima/expression-primary/object/migrated_0007.js b/test/fixtures/esprima/expression-primary/object/migrated_0007.js new file mode 100755 index 0000000000..080fc0eb69 --- /dev/null +++ b/test/fixtures/esprima/expression-primary/object/migrated_0007.js @@ -0,0 +1 @@ +x = { "answer": 42 } \ No newline at end of file diff --git a/test/fixtures/esprima/expression-primary/object/migrated_0008.js b/test/fixtures/esprima/expression-primary/object/migrated_0008.js new file mode 100755 index 0000000000..27dc99aa13 --- /dev/null +++ b/test/fixtures/esprima/expression-primary/object/migrated_0008.js @@ -0,0 +1 @@ +x = { x: 1, x: 2 } \ No newline at end of file diff --git a/test/fixtures/esprima/expression-primary/object/migrated_0009.js b/test/fixtures/esprima/expression-primary/object/migrated_0009.js new file mode 100755 index 0000000000..6184558260 --- /dev/null +++ b/test/fixtures/esprima/expression-primary/object/migrated_0009.js @@ -0,0 +1 @@ +x = { get width() { return m_width } } \ No newline at end of file diff --git a/test/fixtures/esprima/expression-primary/object/migrated_0010.js b/test/fixtures/esprima/expression-primary/object/migrated_0010.js new file mode 100755 index 0000000000..31858315e9 --- /dev/null +++ b/test/fixtures/esprima/expression-primary/object/migrated_0010.js @@ -0,0 +1 @@ +x = { get undef() {} } \ No newline at end of file diff --git a/test/fixtures/esprima/expression-primary/object/migrated_0011.js b/test/fixtures/esprima/expression-primary/object/migrated_0011.js new file mode 100755 index 0000000000..d36a62233b --- /dev/null +++ b/test/fixtures/esprima/expression-primary/object/migrated_0011.js @@ -0,0 +1 @@ +x = { get if() {} } \ No newline at end of file diff --git a/test/fixtures/esprima/expression-primary/object/migrated_0012.js b/test/fixtures/esprima/expression-primary/object/migrated_0012.js new file mode 100755 index 0000000000..d1eebe34eb --- /dev/null +++ b/test/fixtures/esprima/expression-primary/object/migrated_0012.js @@ -0,0 +1 @@ +x = { get true() {} } \ No newline at end of file diff --git a/test/fixtures/esprima/expression-primary/object/migrated_0013.js b/test/fixtures/esprima/expression-primary/object/migrated_0013.js new file mode 100755 index 0000000000..bfdd86e7bc --- /dev/null +++ b/test/fixtures/esprima/expression-primary/object/migrated_0013.js @@ -0,0 +1 @@ +x = { get false() {} } \ No newline at end of file diff --git a/test/fixtures/esprima/expression-primary/object/migrated_0014.js b/test/fixtures/esprima/expression-primary/object/migrated_0014.js new file mode 100755 index 0000000000..11f3416e4d --- /dev/null +++ b/test/fixtures/esprima/expression-primary/object/migrated_0014.js @@ -0,0 +1 @@ +x = { get null() {} } \ No newline at end of file diff --git a/test/fixtures/esprima/expression-primary/object/migrated_0015.js b/test/fixtures/esprima/expression-primary/object/migrated_0015.js new file mode 100755 index 0000000000..6b2adc2768 --- /dev/null +++ b/test/fixtures/esprima/expression-primary/object/migrated_0015.js @@ -0,0 +1 @@ +x = { get "undef"() {} } \ No newline at end of file diff --git a/test/fixtures/esprima/expression-primary/object/migrated_0016.js b/test/fixtures/esprima/expression-primary/object/migrated_0016.js new file mode 100755 index 0000000000..a4b31f7f4b --- /dev/null +++ b/test/fixtures/esprima/expression-primary/object/migrated_0016.js @@ -0,0 +1 @@ +x = { get 10() {} } \ No newline at end of file diff --git a/test/fixtures/esprima/expression-primary/object/migrated_0017.js b/test/fixtures/esprima/expression-primary/object/migrated_0017.js new file mode 100755 index 0000000000..195d9af705 --- /dev/null +++ b/test/fixtures/esprima/expression-primary/object/migrated_0017.js @@ -0,0 +1 @@ +x = { set width(w) { m_width = w } } \ No newline at end of file diff --git a/test/fixtures/esprima/expression-primary/object/migrated_0018.js b/test/fixtures/esprima/expression-primary/object/migrated_0018.js new file mode 100755 index 0000000000..5a84a53efe --- /dev/null +++ b/test/fixtures/esprima/expression-primary/object/migrated_0018.js @@ -0,0 +1 @@ +x = { set if(w) { m_if = w } } \ No newline at end of file diff --git a/test/fixtures/esprima/expression-primary/object/migrated_0019.js b/test/fixtures/esprima/expression-primary/object/migrated_0019.js new file mode 100755 index 0000000000..9a2f22a04c --- /dev/null +++ b/test/fixtures/esprima/expression-primary/object/migrated_0019.js @@ -0,0 +1 @@ +x = { set true(w) { m_true = w } } \ No newline at end of file diff --git a/test/fixtures/esprima/expression-primary/object/migrated_0020.js b/test/fixtures/esprima/expression-primary/object/migrated_0020.js new file mode 100755 index 0000000000..8689324d5f --- /dev/null +++ b/test/fixtures/esprima/expression-primary/object/migrated_0020.js @@ -0,0 +1 @@ +x = { set false(w) { m_false = w } } \ No newline at end of file diff --git a/test/fixtures/esprima/expression-primary/object/migrated_0021.js b/test/fixtures/esprima/expression-primary/object/migrated_0021.js new file mode 100755 index 0000000000..2694a883bd --- /dev/null +++ b/test/fixtures/esprima/expression-primary/object/migrated_0021.js @@ -0,0 +1 @@ +x = { set null(w) { m_null = w } } \ No newline at end of file diff --git a/test/fixtures/esprima/expression-primary/object/migrated_0022.js b/test/fixtures/esprima/expression-primary/object/migrated_0022.js new file mode 100755 index 0000000000..46712ca95a --- /dev/null +++ b/test/fixtures/esprima/expression-primary/object/migrated_0022.js @@ -0,0 +1 @@ +x = { set "null"(w) { m_null = w } } \ No newline at end of file diff --git a/test/fixtures/esprima/expression-primary/object/migrated_0023.js b/test/fixtures/esprima/expression-primary/object/migrated_0023.js new file mode 100755 index 0000000000..c5e8300a63 --- /dev/null +++ b/test/fixtures/esprima/expression-primary/object/migrated_0023.js @@ -0,0 +1 @@ +x = { set 10(w) { m_null = w } } \ No newline at end of file diff --git a/test/fixtures/esprima/expression-primary/object/migrated_0024.js b/test/fixtures/esprima/expression-primary/object/migrated_0024.js new file mode 100755 index 0000000000..12174c643f --- /dev/null +++ b/test/fixtures/esprima/expression-primary/object/migrated_0024.js @@ -0,0 +1 @@ +x = { get: 42 } \ No newline at end of file diff --git a/test/fixtures/esprima/expression-primary/object/migrated_0025.js b/test/fixtures/esprima/expression-primary/object/migrated_0025.js new file mode 100755 index 0000000000..3750d76009 --- /dev/null +++ b/test/fixtures/esprima/expression-primary/object/migrated_0025.js @@ -0,0 +1 @@ +x = { set: 43 } \ No newline at end of file diff --git a/test/fixtures/esprima/expression-primary/object/migrated_0026.js b/test/fixtures/esprima/expression-primary/object/migrated_0026.js new file mode 100755 index 0000000000..7ac6c98aba --- /dev/null +++ b/test/fixtures/esprima/expression-primary/object/migrated_0026.js @@ -0,0 +1 @@ +x = { __proto__: 2 } \ No newline at end of file diff --git a/test/fixtures/esprima/expression-primary/object/migrated_0027.js b/test/fixtures/esprima/expression-primary/object/migrated_0027.js new file mode 100755 index 0000000000..47f74f2edd --- /dev/null +++ b/test/fixtures/esprima/expression-primary/object/migrated_0027.js @@ -0,0 +1 @@ +x = {"__proto__": 2 } \ No newline at end of file diff --git a/test/fixtures/esprima/expression-primary/object/migrated_0028.js b/test/fixtures/esprima/expression-primary/object/migrated_0028.js new file mode 100755 index 0000000000..32bbc3d6fb --- /dev/null +++ b/test/fixtures/esprima/expression-primary/object/migrated_0028.js @@ -0,0 +1 @@ +x = { get width() { return m_width }, set width(width) { m_width = width; } } \ No newline at end of file diff --git a/test/fixtures/esprima/expression-primary/object/migrated_0029.js b/test/fixtures/esprima/expression-primary/object/migrated_0029.js new file mode 100755 index 0000000000..485ec58cc1 --- /dev/null +++ b/test/fixtures/esprima/expression-primary/object/migrated_0029.js @@ -0,0 +1 @@ +({ get i() { }, i: 42 }) \ No newline at end of file diff --git a/test/fixtures/esprima/expression-primary/object/migrated_0030.js b/test/fixtures/esprima/expression-primary/object/migrated_0030.js new file mode 100755 index 0000000000..77c8fde597 --- /dev/null +++ b/test/fixtures/esprima/expression-primary/object/migrated_0030.js @@ -0,0 +1 @@ +"use strict";x={y:1,y:1} \ No newline at end of file diff --git a/test/fixtures/esprima/expression-primary/object/migrated_0031.js b/test/fixtures/esprima/expression-primary/object/migrated_0031.js new file mode 100755 index 0000000000..eefc56adf8 --- /dev/null +++ b/test/fixtures/esprima/expression-primary/object/migrated_0031.js @@ -0,0 +1 @@ +"use strict"; var x = { get i() {}, get i() {} } \ No newline at end of file diff --git a/test/fixtures/esprima/expression-primary/object/migrated_0032.js b/test/fixtures/esprima/expression-primary/object/migrated_0032.js new file mode 100755 index 0000000000..74514c2863 --- /dev/null +++ b/test/fixtures/esprima/expression-primary/object/migrated_0032.js @@ -0,0 +1 @@ +"use strict"; var x = { i: 42, get i() {} } \ No newline at end of file diff --git a/test/fixtures/esprima/expression-primary/object/migrated_0033.js b/test/fixtures/esprima/expression-primary/object/migrated_0033.js new file mode 100755 index 0000000000..7e54c3ecd4 --- /dev/null +++ b/test/fixtures/esprima/expression-primary/object/migrated_0033.js @@ -0,0 +1 @@ +"use strict"; var x = { set i(x) {}, i: 42 } \ No newline at end of file diff --git a/test/fixtures/esprima/expression-primary/object/migrated_0034.js b/test/fixtures/esprima/expression-primary/object/migrated_0034.js new file mode 100755 index 0000000000..dc29fd9df0 --- /dev/null +++ b/test/fixtures/esprima/expression-primary/object/migrated_0034.js @@ -0,0 +1 @@ +({[a](){}}) \ No newline at end of file diff --git a/test/fixtures/esprima/expression-primary/object/migrated_0035.js b/test/fixtures/esprima/expression-primary/object/migrated_0035.js new file mode 100755 index 0000000000..1f56c40c66 --- /dev/null +++ b/test/fixtures/esprima/expression-primary/object/migrated_0035.js @@ -0,0 +1 @@ +({[a]:()=>{}}) \ No newline at end of file diff --git a/test/fixtures/esprima/expression-primary/object/migrated_0036.js b/test/fixtures/esprima/expression-primary/object/migrated_0036.js new file mode 100755 index 0000000000..a086e035da --- /dev/null +++ b/test/fixtures/esprima/expression-primary/object/migrated_0036.js @@ -0,0 +1 @@ +({["__proto__"]:0, ["__proto__"]:0}) \ No newline at end of file diff --git a/test/fixtures/esprima/expression-primary/object/migrated_0037.js b/test/fixtures/esprima/expression-primary/object/migrated_0037.js new file mode 100755 index 0000000000..5333738e27 --- /dev/null +++ b/test/fixtures/esprima/expression-primary/object/migrated_0037.js @@ -0,0 +1 @@ +({"[": 42}) \ No newline at end of file diff --git a/test/fixtures/esprima/expression-primary/object/migrated_0038.js b/test/fixtures/esprima/expression-primary/object/migrated_0038.js new file mode 100755 index 0000000000..1f93bdbc7e --- /dev/null +++ b/test/fixtures/esprima/expression-primary/object/migrated_0038.js @@ -0,0 +1 @@ +({set x(a=0){}}) \ No newline at end of file diff --git a/test/fixtures/esprima/expression-primary/other/expected.json b/test/fixtures/esprima/expression-primary/other/expected.json new file mode 100644 index 0000000000..10130f3578 --- /dev/null +++ b/test/fixtures/esprima/expression-primary/other/expected.json @@ -0,0 +1,32 @@ +{ + "type": "File", + "start": 0, + "end": 0, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 0 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 0, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 0 + } + }, + "sourceType": "script", + "body": [] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/expression-primary/other/migrated_0000.js b/test/fixtures/esprima/expression-primary/other/migrated_0000.js new file mode 100755 index 0000000000..9ecf3cf1d5 --- /dev/null +++ b/test/fixtures/esprima/expression-primary/other/migrated_0000.js @@ -0,0 +1 @@ +this diff --git a/test/fixtures/esprima/expression-primary/other/migrated_0001.js b/test/fixtures/esprima/expression-primary/other/migrated_0001.js new file mode 100755 index 0000000000..19765bd501 --- /dev/null +++ b/test/fixtures/esprima/expression-primary/other/migrated_0001.js @@ -0,0 +1 @@ +null diff --git a/test/fixtures/esprima/expression-primary/other/migrated_0002.js b/test/fixtures/esprima/expression-primary/other/migrated_0002.js new file mode 100755 index 0000000000..aa5dcabcca --- /dev/null +++ b/test/fixtures/esprima/expression-primary/other/migrated_0002.js @@ -0,0 +1,3 @@ + + 42 + diff --git a/test/fixtures/esprima/expression-primary/other/migrated_0003.js b/test/fixtures/esprima/expression-primary/other/migrated_0003.js new file mode 100755 index 0000000000..7000f9b764 --- /dev/null +++ b/test/fixtures/esprima/expression-primary/other/migrated_0003.js @@ -0,0 +1 @@ +(1 + 2 ) * 3 \ No newline at end of file diff --git a/test/fixtures/esprima/expression-relational/migrated_0000/actual.js b/test/fixtures/esprima/expression-relational/migrated_0000/actual.js new file mode 100644 index 0000000000..a4309450ff --- /dev/null +++ b/test/fixtures/esprima/expression-relational/migrated_0000/actual.js @@ -0,0 +1 @@ +x < y diff --git a/test/fixtures/esprima/expression-relational/migrated_0000/expected.json b/test/fixtures/esprima/expression-relational/migrated_0000/expected.json new file mode 100644 index 0000000000..da2300c3ba --- /dev/null +++ b/test/fixtures/esprima/expression-relational/migrated_0000/expected.json @@ -0,0 +1,96 @@ +{ + "type": "File", + "start": 0, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "expression": { + "type": "BinaryExpression", + "start": 0, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "left": { + "type": "Identifier", + "start": 0, + "end": 1, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + } + }, + "name": "x" + }, + "operator": "<", + "right": { + "type": "Identifier", + "start": 4, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "name": "y" + } + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/expression-relational/migrated_0001/actual.js b/test/fixtures/esprima/expression-relational/migrated_0001/actual.js new file mode 100644 index 0000000000..4cdc8cdbb2 --- /dev/null +++ b/test/fixtures/esprima/expression-relational/migrated_0001/actual.js @@ -0,0 +1 @@ +x > y diff --git a/test/fixtures/esprima/expression-relational/migrated_0001/expected.json b/test/fixtures/esprima/expression-relational/migrated_0001/expected.json new file mode 100644 index 0000000000..d036898e8d --- /dev/null +++ b/test/fixtures/esprima/expression-relational/migrated_0001/expected.json @@ -0,0 +1,96 @@ +{ + "type": "File", + "start": 0, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "expression": { + "type": "BinaryExpression", + "start": 0, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "left": { + "type": "Identifier", + "start": 0, + "end": 1, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + } + }, + "name": "x" + }, + "operator": ">", + "right": { + "type": "Identifier", + "start": 4, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "name": "y" + } + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/expression-relational/migrated_0002/actual.js b/test/fixtures/esprima/expression-relational/migrated_0002/actual.js new file mode 100644 index 0000000000..da883403b4 --- /dev/null +++ b/test/fixtures/esprima/expression-relational/migrated_0002/actual.js @@ -0,0 +1 @@ +x <= y diff --git a/test/fixtures/esprima/expression-relational/migrated_0002/expected.json b/test/fixtures/esprima/expression-relational/migrated_0002/expected.json new file mode 100644 index 0000000000..21272df967 --- /dev/null +++ b/test/fixtures/esprima/expression-relational/migrated_0002/expected.json @@ -0,0 +1,96 @@ +{ + "type": "File", + "start": 0, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "expression": { + "type": "BinaryExpression", + "start": 0, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "left": { + "type": "Identifier", + "start": 0, + "end": 1, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + } + }, + "name": "x" + }, + "operator": "<=", + "right": { + "type": "Identifier", + "start": 5, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "name": "y" + } + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/expression-relational/migrated_0003/actual.js b/test/fixtures/esprima/expression-relational/migrated_0003/actual.js new file mode 100644 index 0000000000..a64436af47 --- /dev/null +++ b/test/fixtures/esprima/expression-relational/migrated_0003/actual.js @@ -0,0 +1 @@ +x >= y diff --git a/test/fixtures/esprima/expression-relational/migrated_0003/expected.json b/test/fixtures/esprima/expression-relational/migrated_0003/expected.json new file mode 100644 index 0000000000..4eba25fa96 --- /dev/null +++ b/test/fixtures/esprima/expression-relational/migrated_0003/expected.json @@ -0,0 +1,96 @@ +{ + "type": "File", + "start": 0, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "expression": { + "type": "BinaryExpression", + "start": 0, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "left": { + "type": "Identifier", + "start": 0, + "end": 1, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + } + }, + "name": "x" + }, + "operator": ">=", + "right": { + "type": "Identifier", + "start": 5, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "name": "y" + } + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/expression-relational/migrated_0004/actual.js b/test/fixtures/esprima/expression-relational/migrated_0004/actual.js new file mode 100644 index 0000000000..15f21b7b63 --- /dev/null +++ b/test/fixtures/esprima/expression-relational/migrated_0004/actual.js @@ -0,0 +1 @@ +x in y diff --git a/test/fixtures/esprima/expression-relational/migrated_0004/expected.json b/test/fixtures/esprima/expression-relational/migrated_0004/expected.json new file mode 100644 index 0000000000..179ec5032f --- /dev/null +++ b/test/fixtures/esprima/expression-relational/migrated_0004/expected.json @@ -0,0 +1,96 @@ +{ + "type": "File", + "start": 0, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "expression": { + "type": "BinaryExpression", + "start": 0, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "left": { + "type": "Identifier", + "start": 0, + "end": 1, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + } + }, + "name": "x" + }, + "operator": "in", + "right": { + "type": "Identifier", + "start": 5, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "name": "y" + } + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/expression-relational/migrated_0005/actual.js b/test/fixtures/esprima/expression-relational/migrated_0005/actual.js new file mode 100644 index 0000000000..ce7d945120 --- /dev/null +++ b/test/fixtures/esprima/expression-relational/migrated_0005/actual.js @@ -0,0 +1 @@ +x instanceof y diff --git a/test/fixtures/esprima/expression-relational/migrated_0005/expected.json b/test/fixtures/esprima/expression-relational/migrated_0005/expected.json new file mode 100644 index 0000000000..8edd71168c --- /dev/null +++ b/test/fixtures/esprima/expression-relational/migrated_0005/expected.json @@ -0,0 +1,96 @@ +{ + "type": "File", + "start": 0, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "expression": { + "type": "BinaryExpression", + "start": 0, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "left": { + "type": "Identifier", + "start": 0, + "end": 1, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + } + }, + "name": "x" + }, + "operator": "instanceof", + "right": { + "type": "Identifier", + "start": 13, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "name": "y" + } + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/expression-relational/migrated_0006/actual.js b/test/fixtures/esprima/expression-relational/migrated_0006/actual.js new file mode 100644 index 0000000000..aad496bf6a --- /dev/null +++ b/test/fixtures/esprima/expression-relational/migrated_0006/actual.js @@ -0,0 +1 @@ +x < y < z diff --git a/test/fixtures/esprima/expression-relational/migrated_0006/expected.json b/test/fixtures/esprima/expression-relational/migrated_0006/expected.json new file mode 100644 index 0000000000..855baa45d7 --- /dev/null +++ b/test/fixtures/esprima/expression-relational/migrated_0006/expected.json @@ -0,0 +1,128 @@ +{ + "type": "File", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "expression": { + "type": "BinaryExpression", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "left": { + "type": "BinaryExpression", + "start": 0, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "left": { + "type": "Identifier", + "start": 0, + "end": 1, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + } + }, + "name": "x" + }, + "operator": "<", + "right": { + "type": "Identifier", + "start": 4, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "name": "y" + } + }, + "operator": "<", + "right": { + "type": "Identifier", + "start": 8, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "name": "z" + } + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/expression-unary/migrated_0000/actual.js b/test/fixtures/esprima/expression-unary/migrated_0000/actual.js new file mode 100644 index 0000000000..e4238dffdf --- /dev/null +++ b/test/fixtures/esprima/expression-unary/migrated_0000/actual.js @@ -0,0 +1 @@ +++x diff --git a/test/fixtures/esprima/expression-unary/migrated_0000/expected.json b/test/fixtures/esprima/expression-unary/migrated_0000/expected.json new file mode 100644 index 0000000000..b8e60e420d --- /dev/null +++ b/test/fixtures/esprima/expression-unary/migrated_0000/expected.json @@ -0,0 +1,81 @@ +{ + "type": "File", + "start": 0, + "end": 3, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 3 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 3, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 3 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 3, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 3 + } + }, + "expression": { + "type": "UpdateExpression", + "start": 0, + "end": 3, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 3 + } + }, + "operator": "++", + "prefix": true, + "argument": { + "type": "Identifier", + "start": 2, + "end": 3, + "loc": { + "start": { + "line": 1, + "column": 2 + }, + "end": { + "line": 1, + "column": 3 + } + }, + "name": "x" + } + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/expression-unary/migrated_0001/actual.js b/test/fixtures/esprima/expression-unary/migrated_0001/actual.js new file mode 100644 index 0000000000..acb2c9ff3f --- /dev/null +++ b/test/fixtures/esprima/expression-unary/migrated_0001/actual.js @@ -0,0 +1 @@ +--x diff --git a/test/fixtures/esprima/expression-unary/migrated_0001/expected.json b/test/fixtures/esprima/expression-unary/migrated_0001/expected.json new file mode 100644 index 0000000000..74d0f506ec --- /dev/null +++ b/test/fixtures/esprima/expression-unary/migrated_0001/expected.json @@ -0,0 +1,81 @@ +{ + "type": "File", + "start": 0, + "end": 3, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 3 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 3, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 3 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 3, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 3 + } + }, + "expression": { + "type": "UpdateExpression", + "start": 0, + "end": 3, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 3 + } + }, + "operator": "--", + "prefix": true, + "argument": { + "type": "Identifier", + "start": 2, + "end": 3, + "loc": { + "start": { + "line": 1, + "column": 2 + }, + "end": { + "line": 1, + "column": 3 + } + }, + "name": "x" + } + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/expression-unary/migrated_0002/actual.js b/test/fixtures/esprima/expression-unary/migrated_0002/actual.js new file mode 100644 index 0000000000..45adb9d186 --- /dev/null +++ b/test/fixtures/esprima/expression-unary/migrated_0002/actual.js @@ -0,0 +1 @@ +++eval diff --git a/test/fixtures/esprima/expression-unary/migrated_0002/expected.json b/test/fixtures/esprima/expression-unary/migrated_0002/expected.json new file mode 100644 index 0000000000..892974799e --- /dev/null +++ b/test/fixtures/esprima/expression-unary/migrated_0002/expected.json @@ -0,0 +1,81 @@ +{ + "type": "File", + "start": 0, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "expression": { + "type": "UpdateExpression", + "start": 0, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "operator": "++", + "prefix": true, + "argument": { + "type": "Identifier", + "start": 2, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 2 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "name": "eval" + } + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/expression-unary/migrated_0003/actual.js b/test/fixtures/esprima/expression-unary/migrated_0003/actual.js new file mode 100644 index 0000000000..09a7ca55ce --- /dev/null +++ b/test/fixtures/esprima/expression-unary/migrated_0003/actual.js @@ -0,0 +1 @@ +--eval diff --git a/test/fixtures/esprima/expression-unary/migrated_0003/expected.json b/test/fixtures/esprima/expression-unary/migrated_0003/expected.json new file mode 100644 index 0000000000..f82908bc2b --- /dev/null +++ b/test/fixtures/esprima/expression-unary/migrated_0003/expected.json @@ -0,0 +1,81 @@ +{ + "type": "File", + "start": 0, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "expression": { + "type": "UpdateExpression", + "start": 0, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "operator": "--", + "prefix": true, + "argument": { + "type": "Identifier", + "start": 2, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 2 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "name": "eval" + } + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/expression-unary/migrated_0004/actual.js b/test/fixtures/esprima/expression-unary/migrated_0004/actual.js new file mode 100644 index 0000000000..2507513936 --- /dev/null +++ b/test/fixtures/esprima/expression-unary/migrated_0004/actual.js @@ -0,0 +1 @@ +++arguments diff --git a/test/fixtures/esprima/expression-unary/migrated_0004/expected.json b/test/fixtures/esprima/expression-unary/migrated_0004/expected.json new file mode 100644 index 0000000000..e190c488dd --- /dev/null +++ b/test/fixtures/esprima/expression-unary/migrated_0004/expected.json @@ -0,0 +1,81 @@ +{ + "type": "File", + "start": 0, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "expression": { + "type": "UpdateExpression", + "start": 0, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "operator": "++", + "prefix": true, + "argument": { + "type": "Identifier", + "start": 2, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 2 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "name": "arguments" + } + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/expression-unary/migrated_0005/actual.js b/test/fixtures/esprima/expression-unary/migrated_0005/actual.js new file mode 100644 index 0000000000..0108538d3d --- /dev/null +++ b/test/fixtures/esprima/expression-unary/migrated_0005/actual.js @@ -0,0 +1 @@ +--arguments diff --git a/test/fixtures/esprima/expression-unary/migrated_0005/expected.json b/test/fixtures/esprima/expression-unary/migrated_0005/expected.json new file mode 100644 index 0000000000..8451361753 --- /dev/null +++ b/test/fixtures/esprima/expression-unary/migrated_0005/expected.json @@ -0,0 +1,81 @@ +{ + "type": "File", + "start": 0, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "expression": { + "type": "UpdateExpression", + "start": 0, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "operator": "--", + "prefix": true, + "argument": { + "type": "Identifier", + "start": 2, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 2 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "name": "arguments" + } + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/expression-unary/migrated_0006/actual.js b/test/fixtures/esprima/expression-unary/migrated_0006/actual.js new file mode 100644 index 0000000000..0f31a64603 --- /dev/null +++ b/test/fixtures/esprima/expression-unary/migrated_0006/actual.js @@ -0,0 +1 @@ ++x diff --git a/test/fixtures/esprima/expression-unary/migrated_0006/expected.json b/test/fixtures/esprima/expression-unary/migrated_0006/expected.json new file mode 100644 index 0000000000..62ee624c4c --- /dev/null +++ b/test/fixtures/esprima/expression-unary/migrated_0006/expected.json @@ -0,0 +1,81 @@ +{ + "type": "File", + "start": 0, + "end": 2, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 2 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 2, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 2 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 2, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 2 + } + }, + "expression": { + "type": "UnaryExpression", + "start": 0, + "end": 2, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 2 + } + }, + "operator": "+", + "prefix": true, + "argument": { + "type": "Identifier", + "start": 1, + "end": 2, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 2 + } + }, + "name": "x" + } + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/expression-unary/migrated_0007/actual.js b/test/fixtures/esprima/expression-unary/migrated_0007/actual.js new file mode 100644 index 0000000000..670c7b14af --- /dev/null +++ b/test/fixtures/esprima/expression-unary/migrated_0007/actual.js @@ -0,0 +1 @@ +-x diff --git a/test/fixtures/esprima/expression-unary/migrated_0007/expected.json b/test/fixtures/esprima/expression-unary/migrated_0007/expected.json new file mode 100644 index 0000000000..4b614da625 --- /dev/null +++ b/test/fixtures/esprima/expression-unary/migrated_0007/expected.json @@ -0,0 +1,81 @@ +{ + "type": "File", + "start": 0, + "end": 2, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 2 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 2, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 2 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 2, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 2 + } + }, + "expression": { + "type": "UnaryExpression", + "start": 0, + "end": 2, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 2 + } + }, + "operator": "-", + "prefix": true, + "argument": { + "type": "Identifier", + "start": 1, + "end": 2, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 2 + } + }, + "name": "x" + } + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/expression-unary/migrated_0008/actual.js b/test/fixtures/esprima/expression-unary/migrated_0008/actual.js new file mode 100644 index 0000000000..d5b13ed838 --- /dev/null +++ b/test/fixtures/esprima/expression-unary/migrated_0008/actual.js @@ -0,0 +1 @@ +~x diff --git a/test/fixtures/esprima/expression-unary/migrated_0008/expected.json b/test/fixtures/esprima/expression-unary/migrated_0008/expected.json new file mode 100644 index 0000000000..326a3d6c51 --- /dev/null +++ b/test/fixtures/esprima/expression-unary/migrated_0008/expected.json @@ -0,0 +1,81 @@ +{ + "type": "File", + "start": 0, + "end": 2, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 2 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 2, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 2 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 2, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 2 + } + }, + "expression": { + "type": "UnaryExpression", + "start": 0, + "end": 2, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 2 + } + }, + "operator": "~", + "prefix": true, + "argument": { + "type": "Identifier", + "start": 1, + "end": 2, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 2 + } + }, + "name": "x" + } + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/expression-unary/migrated_0009/actual.js b/test/fixtures/esprima/expression-unary/migrated_0009/actual.js new file mode 100644 index 0000000000..d1b14d778f --- /dev/null +++ b/test/fixtures/esprima/expression-unary/migrated_0009/actual.js @@ -0,0 +1 @@ +!x diff --git a/test/fixtures/esprima/expression-unary/migrated_0009/expected.json b/test/fixtures/esprima/expression-unary/migrated_0009/expected.json new file mode 100644 index 0000000000..5db05c771f --- /dev/null +++ b/test/fixtures/esprima/expression-unary/migrated_0009/expected.json @@ -0,0 +1,81 @@ +{ + "type": "File", + "start": 0, + "end": 2, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 2 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 2, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 2 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 2, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 2 + } + }, + "expression": { + "type": "UnaryExpression", + "start": 0, + "end": 2, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 2 + } + }, + "operator": "!", + "prefix": true, + "argument": { + "type": "Identifier", + "start": 1, + "end": 2, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 2 + } + }, + "name": "x" + } + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/expression-unary/migrated_0010/actual.js b/test/fixtures/esprima/expression-unary/migrated_0010/actual.js new file mode 100644 index 0000000000..6bba139bc6 --- /dev/null +++ b/test/fixtures/esprima/expression-unary/migrated_0010/actual.js @@ -0,0 +1 @@ +void x diff --git a/test/fixtures/esprima/expression-unary/migrated_0010/expected.json b/test/fixtures/esprima/expression-unary/migrated_0010/expected.json new file mode 100644 index 0000000000..776ed71df2 --- /dev/null +++ b/test/fixtures/esprima/expression-unary/migrated_0010/expected.json @@ -0,0 +1,81 @@ +{ + "type": "File", + "start": 0, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "expression": { + "type": "UnaryExpression", + "start": 0, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "operator": "void", + "prefix": true, + "argument": { + "type": "Identifier", + "start": 5, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "name": "x" + } + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/expression-unary/migrated_0011/actual.js b/test/fixtures/esprima/expression-unary/migrated_0011/actual.js new file mode 100644 index 0000000000..ebeb0cb0fa --- /dev/null +++ b/test/fixtures/esprima/expression-unary/migrated_0011/actual.js @@ -0,0 +1 @@ +delete x diff --git a/test/fixtures/esprima/expression-unary/migrated_0011/expected.json b/test/fixtures/esprima/expression-unary/migrated_0011/expected.json new file mode 100644 index 0000000000..f5edc45759 --- /dev/null +++ b/test/fixtures/esprima/expression-unary/migrated_0011/expected.json @@ -0,0 +1,81 @@ +{ + "type": "File", + "start": 0, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "expression": { + "type": "UnaryExpression", + "start": 0, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "operator": "delete", + "prefix": true, + "argument": { + "type": "Identifier", + "start": 7, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "name": "x" + } + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/expression-unary/migrated_0012/actual.js b/test/fixtures/esprima/expression-unary/migrated_0012/actual.js new file mode 100644 index 0000000000..e18eec452d --- /dev/null +++ b/test/fixtures/esprima/expression-unary/migrated_0012/actual.js @@ -0,0 +1 @@ +typeof x diff --git a/test/fixtures/esprima/expression-unary/migrated_0012/expected.json b/test/fixtures/esprima/expression-unary/migrated_0012/expected.json new file mode 100644 index 0000000000..137dc642bc --- /dev/null +++ b/test/fixtures/esprima/expression-unary/migrated_0012/expected.json @@ -0,0 +1,81 @@ +{ + "type": "File", + "start": 0, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "expression": { + "type": "UnaryExpression", + "start": 0, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "operator": "typeof", + "prefix": true, + "argument": { + "type": "Identifier", + "start": 7, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "name": "x" + } + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/invalid-syntax/GH-1106-00/actual.js b/test/fixtures/esprima/invalid-syntax/GH-1106-00/actual.js new file mode 100644 index 0000000000..5a64203ac2 --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/GH-1106-00/actual.js @@ -0,0 +1 @@ +"\x"; diff --git a/test/fixtures/esprima/invalid-syntax/GH-1106-00/options.json b/test/fixtures/esprima/invalid-syntax/GH-1106-00/options.json new file mode 100644 index 0000000000..143c8be643 --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/GH-1106-00/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Bad character escape sequence (1:3)" +} \ No newline at end of file diff --git a/test/fixtures/esprima/invalid-syntax/GH-1106-01/actual.js b/test/fixtures/esprima/invalid-syntax/GH-1106-01/actual.js new file mode 100644 index 0000000000..fdf6b4ff7b --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/GH-1106-01/actual.js @@ -0,0 +1 @@ +"\x0"; diff --git a/test/fixtures/esprima/invalid-syntax/GH-1106-01/options.json b/test/fixtures/esprima/invalid-syntax/GH-1106-01/options.json new file mode 100644 index 0000000000..143c8be643 --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/GH-1106-01/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Bad character escape sequence (1:3)" +} \ No newline at end of file diff --git a/test/fixtures/esprima/invalid-syntax/GH-1106-02/actual.js b/test/fixtures/esprima/invalid-syntax/GH-1106-02/actual.js new file mode 100644 index 0000000000..ce2c7dfa93 --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/GH-1106-02/actual.js @@ -0,0 +1 @@ +"\xx"; diff --git a/test/fixtures/esprima/invalid-syntax/GH-1106-02/options.json b/test/fixtures/esprima/invalid-syntax/GH-1106-02/options.json new file mode 100644 index 0000000000..143c8be643 --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/GH-1106-02/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Bad character escape sequence (1:3)" +} \ No newline at end of file diff --git a/test/fixtures/esprima/invalid-syntax/GH-1106-03/actual.js b/test/fixtures/esprima/invalid-syntax/GH-1106-03/actual.js new file mode 100644 index 0000000000..8f04b77029 --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/GH-1106-03/actual.js @@ -0,0 +1 @@ +"\u"; diff --git a/test/fixtures/esprima/invalid-syntax/GH-1106-03/options.json b/test/fixtures/esprima/invalid-syntax/GH-1106-03/options.json new file mode 100644 index 0000000000..143c8be643 --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/GH-1106-03/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Bad character escape sequence (1:3)" +} \ No newline at end of file diff --git a/test/fixtures/esprima/invalid-syntax/GH-1106-04/actual.js b/test/fixtures/esprima/invalid-syntax/GH-1106-04/actual.js new file mode 100644 index 0000000000..422fe603b5 --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/GH-1106-04/actual.js @@ -0,0 +1 @@ +"\u0"; diff --git a/test/fixtures/esprima/invalid-syntax/GH-1106-04/options.json b/test/fixtures/esprima/invalid-syntax/GH-1106-04/options.json new file mode 100644 index 0000000000..143c8be643 --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/GH-1106-04/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Bad character escape sequence (1:3)" +} \ No newline at end of file diff --git a/test/fixtures/esprima/invalid-syntax/GH-1106-05/actual.js b/test/fixtures/esprima/invalid-syntax/GH-1106-05/actual.js new file mode 100644 index 0000000000..0e0fb8fb4d --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/GH-1106-05/actual.js @@ -0,0 +1 @@ +"\ux"; diff --git a/test/fixtures/esprima/invalid-syntax/GH-1106-05/options.json b/test/fixtures/esprima/invalid-syntax/GH-1106-05/options.json new file mode 100644 index 0000000000..143c8be643 --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/GH-1106-05/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Bad character escape sequence (1:3)" +} \ No newline at end of file diff --git a/test/fixtures/esprima/invalid-syntax/GH-1106-06/actual.js b/test/fixtures/esprima/invalid-syntax/GH-1106-06/actual.js new file mode 100644 index 0000000000..e9a8c01817 --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/GH-1106-06/actual.js @@ -0,0 +1 @@ +"\u00"; diff --git a/test/fixtures/esprima/invalid-syntax/GH-1106-06/options.json b/test/fixtures/esprima/invalid-syntax/GH-1106-06/options.json new file mode 100644 index 0000000000..143c8be643 --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/GH-1106-06/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Bad character escape sequence (1:3)" +} \ No newline at end of file diff --git a/test/fixtures/esprima/invalid-syntax/GH-1106-07/actual.js b/test/fixtures/esprima/invalid-syntax/GH-1106-07/actual.js new file mode 100644 index 0000000000..b77b4ffa07 --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/GH-1106-07/actual.js @@ -0,0 +1 @@ +"\u000"; diff --git a/test/fixtures/esprima/invalid-syntax/GH-1106-07/options.json b/test/fixtures/esprima/invalid-syntax/GH-1106-07/options.json new file mode 100644 index 0000000000..143c8be643 --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/GH-1106-07/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Bad character escape sequence (1:3)" +} \ No newline at end of file diff --git a/test/fixtures/esprima/invalid-syntax/GH-1106-09/actual.js b/test/fixtures/esprima/invalid-syntax/GH-1106-09/actual.js new file mode 100644 index 0000000000..a29592d0ff --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/GH-1106-09/actual.js @@ -0,0 +1 @@ +"\9"; diff --git a/test/fixtures/esprima/invalid-syntax/GH-1106-09/expected.json b/test/fixtures/esprima/invalid-syntax/GH-1106-09/expected.json new file mode 100644 index 0000000000..0d183a7bf6 --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/GH-1106-09/expected.json @@ -0,0 +1,66 @@ +{ + "type": "File", + "start": 0, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "expression": { + "type": "Literal", + "start": 0, + "end": 4, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 4 + } + }, + "value": "9", + "rawValue": "9", + "raw": "\"\\9\"" + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/invalid-syntax/GH-1106-09/options.json b/test/fixtures/esprima/invalid-syntax/GH-1106-09/options.json new file mode 100644 index 0000000000..9f7910a413 --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/GH-1106-09/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Unexpected token (1:4)" +} \ No newline at end of file diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0000/actual.js b/test/fixtures/esprima/invalid-syntax/migrated_0000/actual.js new file mode 100644 index 0000000000..98232c64fc --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0000/actual.js @@ -0,0 +1 @@ +{ diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0000/options.json b/test/fixtures/esprima/invalid-syntax/migrated_0000/options.json new file mode 100644 index 0000000000..04b967a2ee --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0000/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Unexpected token (1:1)" +} \ No newline at end of file diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0001/actual.js b/test/fixtures/esprima/invalid-syntax/migrated_0001/actual.js new file mode 100644 index 0000000000..5c34318c21 --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0001/actual.js @@ -0,0 +1 @@ +} diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0001/options.json b/test/fixtures/esprima/invalid-syntax/migrated_0001/options.json new file mode 100644 index 0000000000..919c05ec87 --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0001/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Unexpected token (1:0)" +} \ No newline at end of file diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0002/actual.js b/test/fixtures/esprima/invalid-syntax/migrated_0002/actual.js new file mode 100644 index 0000000000..595e60763e --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0002/actual.js @@ -0,0 +1 @@ +3ea diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0002/options.json b/test/fixtures/esprima/invalid-syntax/migrated_0002/options.json new file mode 100644 index 0000000000..cf3086295c --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0002/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Invalid number (1:0)" +} \ No newline at end of file diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0003/actual.js b/test/fixtures/esprima/invalid-syntax/migrated_0003/actual.js new file mode 100644 index 0000000000..b3ef4067a1 --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0003/actual.js @@ -0,0 +1 @@ +3in [] diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0003/options.json b/test/fixtures/esprima/invalid-syntax/migrated_0003/options.json new file mode 100644 index 0000000000..b239abb159 --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0003/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Identifier directly after number (1:1)" +} \ No newline at end of file diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0004/actual.js b/test/fixtures/esprima/invalid-syntax/migrated_0004/actual.js new file mode 100644 index 0000000000..0dd5d19ef2 --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0004/actual.js @@ -0,0 +1 @@ +3e diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0004/options.json b/test/fixtures/esprima/invalid-syntax/migrated_0004/options.json new file mode 100644 index 0000000000..cf3086295c --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0004/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Invalid number (1:0)" +} \ No newline at end of file diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0005/actual.js b/test/fixtures/esprima/invalid-syntax/migrated_0005/actual.js new file mode 100644 index 0000000000..bce33bebdd --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0005/actual.js @@ -0,0 +1 @@ +3e+ diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0005/options.json b/test/fixtures/esprima/invalid-syntax/migrated_0005/options.json new file mode 100644 index 0000000000..cf3086295c --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0005/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Invalid number (1:0)" +} \ No newline at end of file diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0006/actual.js b/test/fixtures/esprima/invalid-syntax/migrated_0006/actual.js new file mode 100644 index 0000000000..d5b347678a --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0006/actual.js @@ -0,0 +1 @@ +3e- diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0006/options.json b/test/fixtures/esprima/invalid-syntax/migrated_0006/options.json new file mode 100644 index 0000000000..cf3086295c --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0006/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Invalid number (1:0)" +} \ No newline at end of file diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0007/actual.js b/test/fixtures/esprima/invalid-syntax/migrated_0007/actual.js new file mode 100644 index 0000000000..c5606e347b --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0007/actual.js @@ -0,0 +1 @@ +3x diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0007/options.json b/test/fixtures/esprima/invalid-syntax/migrated_0007/options.json new file mode 100644 index 0000000000..b239abb159 --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0007/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Identifier directly after number (1:1)" +} \ No newline at end of file diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0008/actual.js b/test/fixtures/esprima/invalid-syntax/migrated_0008/actual.js new file mode 100644 index 0000000000..819eb6fa76 --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0008/actual.js @@ -0,0 +1 @@ +3x0 diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0008/options.json b/test/fixtures/esprima/invalid-syntax/migrated_0008/options.json new file mode 100644 index 0000000000..b239abb159 --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0008/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Identifier directly after number (1:1)" +} \ No newline at end of file diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0009/actual.js b/test/fixtures/esprima/invalid-syntax/migrated_0009/actual.js new file mode 100644 index 0000000000..ec687260b8 --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0009/actual.js @@ -0,0 +1 @@ +0x diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0009/options.json b/test/fixtures/esprima/invalid-syntax/migrated_0009/options.json new file mode 100644 index 0000000000..b4716df8c6 --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0009/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Expected number in radix 16 (1:2)" +} \ No newline at end of file diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0010/actual.js b/test/fixtures/esprima/invalid-syntax/migrated_0010/actual.js new file mode 100644 index 0000000000..f21bf23578 --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0010/actual.js @@ -0,0 +1 @@ +01a diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0010/options.json b/test/fixtures/esprima/invalid-syntax/migrated_0010/options.json new file mode 100644 index 0000000000..aa61ff56c2 --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0010/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Identifier directly after number (1:2)" +} \ No newline at end of file diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0011/actual.js b/test/fixtures/esprima/invalid-syntax/migrated_0011/actual.js new file mode 100644 index 0000000000..636d63d27a --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0011/actual.js @@ -0,0 +1 @@ +0o1a diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0011/options.json b/test/fixtures/esprima/invalid-syntax/migrated_0011/options.json new file mode 100644 index 0000000000..f42de64632 --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0011/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Identifier directly after number (1:3)" +} \ No newline at end of file diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0012/actual.js b/test/fixtures/esprima/invalid-syntax/migrated_0012/actual.js new file mode 100644 index 0000000000..c1b0a14e8e --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0012/actual.js @@ -0,0 +1 @@ +0o diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0012/options.json b/test/fixtures/esprima/invalid-syntax/migrated_0012/options.json new file mode 100644 index 0000000000..5c0ca078e5 --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0012/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Expected number in radix 8 (1:2)" +} \ No newline at end of file diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0013/actual.js b/test/fixtures/esprima/invalid-syntax/migrated_0013/actual.js new file mode 100644 index 0000000000..75d282c01a --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0013/actual.js @@ -0,0 +1 @@ +0O diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0013/options.json b/test/fixtures/esprima/invalid-syntax/migrated_0013/options.json new file mode 100644 index 0000000000..5c0ca078e5 --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0013/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Expected number in radix 8 (1:2)" +} \ No newline at end of file diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0014/actual.js b/test/fixtures/esprima/invalid-syntax/migrated_0014/actual.js new file mode 100644 index 0000000000..7a0afdef9e --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0014/actual.js @@ -0,0 +1 @@ +0o9 diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0014/options.json b/test/fixtures/esprima/invalid-syntax/migrated_0014/options.json new file mode 100644 index 0000000000..5c0ca078e5 --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0014/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Expected number in radix 8 (1:2)" +} \ No newline at end of file diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0015/actual.js b/test/fixtures/esprima/invalid-syntax/migrated_0015/actual.js new file mode 100644 index 0000000000..85651f72b5 --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0015/actual.js @@ -0,0 +1 @@ +0o18 diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0015/options.json b/test/fixtures/esprima/invalid-syntax/migrated_0015/options.json new file mode 100644 index 0000000000..3b5e811628 --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0015/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Unexpected token (1:3)" +} \ No newline at end of file diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0016/actual.js b/test/fixtures/esprima/invalid-syntax/migrated_0016/actual.js new file mode 100644 index 0000000000..5df2ec263c --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0016/actual.js @@ -0,0 +1 @@ +0O1a diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0016/options.json b/test/fixtures/esprima/invalid-syntax/migrated_0016/options.json new file mode 100644 index 0000000000..f42de64632 --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0016/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Identifier directly after number (1:3)" +} \ No newline at end of file diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0017/actual.js b/test/fixtures/esprima/invalid-syntax/migrated_0017/actual.js new file mode 100644 index 0000000000..59db2fe288 --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0017/actual.js @@ -0,0 +1 @@ +0b diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0017/options.json b/test/fixtures/esprima/invalid-syntax/migrated_0017/options.json new file mode 100644 index 0000000000..d00691a137 --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0017/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Expected number in radix 2 (1:2)" +} \ No newline at end of file diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0018/actual.js b/test/fixtures/esprima/invalid-syntax/migrated_0018/actual.js new file mode 100644 index 0000000000..3e0f73a9e3 --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0018/actual.js @@ -0,0 +1 @@ +0b1a diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0018/options.json b/test/fixtures/esprima/invalid-syntax/migrated_0018/options.json new file mode 100644 index 0000000000..f42de64632 --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0018/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Identifier directly after number (1:3)" +} \ No newline at end of file diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0019/actual.js b/test/fixtures/esprima/invalid-syntax/migrated_0019/actual.js new file mode 100644 index 0000000000..e62cb535f5 --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0019/actual.js @@ -0,0 +1 @@ +0b9 diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0019/options.json b/test/fixtures/esprima/invalid-syntax/migrated_0019/options.json new file mode 100644 index 0000000000..d00691a137 --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0019/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Expected number in radix 2 (1:2)" +} \ No newline at end of file diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0020/actual.js b/test/fixtures/esprima/invalid-syntax/migrated_0020/actual.js new file mode 100644 index 0000000000..b8ca7e8b07 --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0020/actual.js @@ -0,0 +1 @@ +0b18 diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0020/options.json b/test/fixtures/esprima/invalid-syntax/migrated_0020/options.json new file mode 100644 index 0000000000..3b5e811628 --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0020/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Unexpected token (1:3)" +} \ No newline at end of file diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0021/actual.js b/test/fixtures/esprima/invalid-syntax/migrated_0021/actual.js new file mode 100644 index 0000000000..6c1ef85b86 --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0021/actual.js @@ -0,0 +1 @@ +0b12 diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0021/options.json b/test/fixtures/esprima/invalid-syntax/migrated_0021/options.json new file mode 100644 index 0000000000..3b5e811628 --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0021/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Unexpected token (1:3)" +} \ No newline at end of file diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0022/actual.js b/test/fixtures/esprima/invalid-syntax/migrated_0022/actual.js new file mode 100644 index 0000000000..eb589e9da2 --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0022/actual.js @@ -0,0 +1 @@ +0B diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0022/options.json b/test/fixtures/esprima/invalid-syntax/migrated_0022/options.json new file mode 100644 index 0000000000..d00691a137 --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0022/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Expected number in radix 2 (1:2)" +} \ No newline at end of file diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0023/actual.js b/test/fixtures/esprima/invalid-syntax/migrated_0023/actual.js new file mode 100644 index 0000000000..7d2702a63f --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0023/actual.js @@ -0,0 +1 @@ +0B1a diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0023/options.json b/test/fixtures/esprima/invalid-syntax/migrated_0023/options.json new file mode 100644 index 0000000000..f42de64632 --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0023/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Identifier directly after number (1:3)" +} \ No newline at end of file diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0024/actual.js b/test/fixtures/esprima/invalid-syntax/migrated_0024/actual.js new file mode 100644 index 0000000000..6e4d94bc50 --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0024/actual.js @@ -0,0 +1 @@ +0B9 diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0024/options.json b/test/fixtures/esprima/invalid-syntax/migrated_0024/options.json new file mode 100644 index 0000000000..d00691a137 --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0024/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Expected number in radix 2 (1:2)" +} \ No newline at end of file diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0025/actual.js b/test/fixtures/esprima/invalid-syntax/migrated_0025/actual.js new file mode 100644 index 0000000000..4b6bfcaa09 --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0025/actual.js @@ -0,0 +1 @@ +0B18 diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0025/options.json b/test/fixtures/esprima/invalid-syntax/migrated_0025/options.json new file mode 100644 index 0000000000..3b5e811628 --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0025/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Unexpected token (1:3)" +} \ No newline at end of file diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0026/actual.js b/test/fixtures/esprima/invalid-syntax/migrated_0026/actual.js new file mode 100644 index 0000000000..3b15e039cf --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0026/actual.js @@ -0,0 +1 @@ +0B12 diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0026/options.json b/test/fixtures/esprima/invalid-syntax/migrated_0026/options.json new file mode 100644 index 0000000000..3b5e811628 --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0026/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Unexpected token (1:3)" +} \ No newline at end of file diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0027/actual.js b/test/fixtures/esprima/invalid-syntax/migrated_0027/actual.js new file mode 100644 index 0000000000..bc1a867d69 --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0027/actual.js @@ -0,0 +1 @@ +0O9 diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0027/options.json b/test/fixtures/esprima/invalid-syntax/migrated_0027/options.json new file mode 100644 index 0000000000..5c0ca078e5 --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0027/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Expected number in radix 8 (1:2)" +} \ No newline at end of file diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0028/actual.js b/test/fixtures/esprima/invalid-syntax/migrated_0028/actual.js new file mode 100644 index 0000000000..bb5c956fcb --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0028/actual.js @@ -0,0 +1 @@ +0O18 diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0028/options.json b/test/fixtures/esprima/invalid-syntax/migrated_0028/options.json new file mode 100644 index 0000000000..3b5e811628 --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0028/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Unexpected token (1:3)" +} \ No newline at end of file diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0029/actual.js b/test/fixtures/esprima/invalid-syntax/migrated_0029/actual.js new file mode 100644 index 0000000000..e030754528 --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0029/actual.js @@ -0,0 +1 @@ +3in[] diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0029/options.json b/test/fixtures/esprima/invalid-syntax/migrated_0029/options.json new file mode 100644 index 0000000000..b239abb159 --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0029/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Identifier directly after number (1:1)" +} \ No newline at end of file diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0030/actual.js b/test/fixtures/esprima/invalid-syntax/migrated_0030/actual.js new file mode 100644 index 0000000000..ae39b1a8aa --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0030/actual.js @@ -0,0 +1 @@ +0x3in[] diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0030/options.json b/test/fixtures/esprima/invalid-syntax/migrated_0030/options.json new file mode 100644 index 0000000000..f42de64632 --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0030/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Identifier directly after number (1:3)" +} \ No newline at end of file diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0031/actual.js b/test/fixtures/esprima/invalid-syntax/migrated_0031/actual.js new file mode 100644 index 0000000000..81a3004b84 --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0031/actual.js @@ -0,0 +1,2 @@ +"Hello +World" diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0031/options.json b/test/fixtures/esprima/invalid-syntax/migrated_0031/options.json new file mode 100644 index 0000000000..a760565b1b --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0031/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Unterminated string constant (1:0)" +} \ No newline at end of file diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0032/actual.js b/test/fixtures/esprima/invalid-syntax/migrated_0032/actual.js new file mode 100644 index 0000000000..442979963f --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0032/actual.js @@ -0,0 +1 @@ +x\ diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0032/options.json b/test/fixtures/esprima/invalid-syntax/migrated_0032/options.json new file mode 100644 index 0000000000..d08f66903c --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0032/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Expecting Unicode escape sequence \\uXXXX (1:2)" +} \ No newline at end of file diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0033/actual.js b/test/fixtures/esprima/invalid-syntax/migrated_0033/actual.js new file mode 100644 index 0000000000..0faf8dc92a --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0033/actual.js @@ -0,0 +1 @@ +var source = 'x\\u005c'; diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0033/expected.json b/test/fixtures/esprima/invalid-syntax/migrated_0033/expected.json new file mode 100644 index 0000000000..f4fe7d7ce4 --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0033/expected.json @@ -0,0 +1,100 @@ +{ + "type": "File", + "start": 0, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 24 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 24 + } + }, + "sourceType": "script", + "body": [ + { + "type": "VariableDeclaration", + "start": 0, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 24 + } + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 4, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "id": { + "type": "Identifier", + "start": 4, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "name": "source" + }, + "init": { + "type": "Literal", + "start": 13, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "value": "x\\u005c", + "rawValue": "x\\u005c", + "raw": "'x\\\\u005c'" + } + } + ], + "kind": "var" + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0033/options.json b/test/fixtures/esprima/invalid-syntax/migrated_0033/options.json new file mode 100644 index 0000000000..65ef4a184a --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0033/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Unexpected token (1:8)" +} \ No newline at end of file diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0034/actual.js b/test/fixtures/esprima/invalid-syntax/migrated_0034/actual.js new file mode 100644 index 0000000000..ac96b78354 --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0034/actual.js @@ -0,0 +1 @@ +var source = 'x\\u002a'; diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0034/expected.json b/test/fixtures/esprima/invalid-syntax/migrated_0034/expected.json new file mode 100644 index 0000000000..bc71c475ce --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0034/expected.json @@ -0,0 +1,100 @@ +{ + "type": "File", + "start": 0, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 24 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 24 + } + }, + "sourceType": "script", + "body": [ + { + "type": "VariableDeclaration", + "start": 0, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 24 + } + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 4, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "id": { + "type": "Identifier", + "start": 4, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "name": "source" + }, + "init": { + "type": "Literal", + "start": 13, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "value": "x\\u002a", + "rawValue": "x\\u002a", + "raw": "'x\\\\u002a'" + } + } + ], + "kind": "var" + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0034/options.json b/test/fixtures/esprima/invalid-syntax/migrated_0034/options.json new file mode 100644 index 0000000000..65ef4a184a --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0034/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Unexpected token (1:8)" +} \ No newline at end of file diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0035/actual.js b/test/fixtures/esprima/invalid-syntax/migrated_0035/actual.js new file mode 100644 index 0000000000..75d51a0f40 --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0035/actual.js @@ -0,0 +1 @@ +var x = /(s/g diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0035/options.json b/test/fixtures/esprima/invalid-syntax/migrated_0035/options.json new file mode 100644 index 0000000000..f8ff26aba2 --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0035/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Error parsing regular expression: Invalid regular expression: /(s/: Unterminated group (1:9)" +} \ No newline at end of file diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0036/actual.js b/test/fixtures/esprima/invalid-syntax/migrated_0036/actual.js new file mode 100644 index 0000000000..e7f145a8d0 --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0036/actual.js @@ -0,0 +1 @@ +var source = 'a\\u'; diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0036/expected.json b/test/fixtures/esprima/invalid-syntax/migrated_0036/expected.json new file mode 100644 index 0000000000..ee388c0ff8 --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0036/expected.json @@ -0,0 +1,100 @@ +{ + "type": "File", + "start": 0, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "sourceType": "script", + "body": [ + { + "type": "VariableDeclaration", + "start": 0, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 4, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 19 + } + }, + "id": { + "type": "Identifier", + "start": 4, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "name": "source" + }, + "init": { + "type": "Literal", + "start": 13, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 1, + "column": 19 + } + }, + "value": "a\\u", + "rawValue": "a\\u", + "raw": "'a\\\\u'" + } + } + ], + "kind": "var" + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0036/options.json b/test/fixtures/esprima/invalid-syntax/migrated_0036/options.json new file mode 100644 index 0000000000..9f7910a413 --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0036/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Unexpected token (1:4)" +} \ No newline at end of file diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0037/actual.js b/test/fixtures/esprima/invalid-syntax/migrated_0037/actual.js new file mode 100644 index 0000000000..5ced27a43a --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0037/actual.js @@ -0,0 +1 @@ +var source = '\\ua'; diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0037/expected.json b/test/fixtures/esprima/invalid-syntax/migrated_0037/expected.json new file mode 100644 index 0000000000..1e4947ba6c --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0037/expected.json @@ -0,0 +1,100 @@ +{ + "type": "File", + "start": 0, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "sourceType": "script", + "body": [ + { + "type": "VariableDeclaration", + "start": 0, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 4, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 19 + } + }, + "id": { + "type": "Identifier", + "start": 4, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "name": "source" + }, + "init": { + "type": "Literal", + "start": 13, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 1, + "column": 19 + } + }, + "value": "\\ua", + "rawValue": "\\ua", + "raw": "'\\\\ua'" + } + } + ], + "kind": "var" + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0037/options.json b/test/fixtures/esprima/invalid-syntax/migrated_0037/options.json new file mode 100644 index 0000000000..9f7910a413 --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0037/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Unexpected token (1:4)" +} \ No newline at end of file diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0038/actual.js b/test/fixtures/esprima/invalid-syntax/migrated_0038/actual.js new file mode 100644 index 0000000000..b498fd495d --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0038/actual.js @@ -0,0 +1 @@ +/ diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0038/options.json b/test/fixtures/esprima/invalid-syntax/migrated_0038/options.json new file mode 100644 index 0000000000..e07b72599f --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0038/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Unterminated regular expression (1:1)" +} \ No newline at end of file diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0039/actual.js b/test/fixtures/esprima/invalid-syntax/migrated_0039/actual.js new file mode 100644 index 0000000000..ee4c926823 --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0039/actual.js @@ -0,0 +1 @@ +/test diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0039/options.json b/test/fixtures/esprima/invalid-syntax/migrated_0039/options.json new file mode 100644 index 0000000000..e07b72599f --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0039/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Unterminated regular expression (1:1)" +} \ No newline at end of file diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0040/actual.js b/test/fixtures/esprima/invalid-syntax/migrated_0040/actual.js new file mode 100644 index 0000000000..d878a41870 --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0040/actual.js @@ -0,0 +1,2 @@ +/test +/ diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0040/options.json b/test/fixtures/esprima/invalid-syntax/migrated_0040/options.json new file mode 100644 index 0000000000..e07b72599f --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0040/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Unterminated regular expression (1:1)" +} \ No newline at end of file diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0041/actual.js b/test/fixtures/esprima/invalid-syntax/migrated_0041/actual.js new file mode 100644 index 0000000000..21543eba12 --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0041/actual.js @@ -0,0 +1 @@ +var source = 'var x = /[a-z]/\\ux'; diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0041/expected.json b/test/fixtures/esprima/invalid-syntax/migrated_0041/expected.json new file mode 100644 index 0000000000..432370bc2e --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0041/expected.json @@ -0,0 +1,100 @@ +{ + "type": "File", + "start": 0, + "end": 35, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 35 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 35, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 35 + } + }, + "sourceType": "script", + "body": [ + { + "type": "VariableDeclaration", + "start": 0, + "end": 35, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 35 + } + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 4, + "end": 34, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 34 + } + }, + "id": { + "type": "Identifier", + "start": 4, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "name": "source" + }, + "init": { + "type": "Literal", + "start": 13, + "end": 34, + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 1, + "column": 34 + } + }, + "value": "var x = /[a-z]/\\ux", + "rawValue": "var x = /[a-z]/\\ux", + "raw": "'var x = /[a-z]/\\\\ux'" + } + } + ], + "kind": "var" + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0041/options.json b/test/fixtures/esprima/invalid-syntax/migrated_0041/options.json new file mode 100644 index 0000000000..2a73699bc2 --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0041/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Unexpected token (1:18)" +} \ No newline at end of file diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0042/actual.js b/test/fixtures/esprima/invalid-syntax/migrated_0042/actual.js new file mode 100644 index 0000000000..a7b0d9a465 --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0042/actual.js @@ -0,0 +1 @@ +var source = 'var x = /[a-z\n]/\\ux'; diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0042/expected.json b/test/fixtures/esprima/invalid-syntax/migrated_0042/expected.json new file mode 100644 index 0000000000..88d96a096a --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0042/expected.json @@ -0,0 +1,100 @@ +{ + "type": "File", + "start": 0, + "end": 37, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 37 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 37, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 37 + } + }, + "sourceType": "script", + "body": [ + { + "type": "VariableDeclaration", + "start": 0, + "end": 37, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 37 + } + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 4, + "end": 36, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 36 + } + }, + "id": { + "type": "Identifier", + "start": 4, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "name": "source" + }, + "init": { + "type": "Literal", + "start": 13, + "end": 36, + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 1, + "column": 36 + } + }, + "value": "var x = /[a-z\n]/\\ux", + "rawValue": "var x = /[a-z\n]/\\ux", + "raw": "'var x = /[a-z\\n]/\\\\ux'" + } + } + ], + "kind": "var" + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0042/options.json b/test/fixtures/esprima/invalid-syntax/migrated_0042/options.json new file mode 100644 index 0000000000..7ca1e1ffbb --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0042/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Unexpected token (1:15)" +} \ No newline at end of file diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0043/actual.js b/test/fixtures/esprima/invalid-syntax/migrated_0043/actual.js new file mode 100644 index 0000000000..42552d4807 --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0043/actual.js @@ -0,0 +1 @@ +var source = 'var x = /[a-z]/\\\\ux'; diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0043/expected.json b/test/fixtures/esprima/invalid-syntax/migrated_0043/expected.json new file mode 100644 index 0000000000..5dccf2df66 --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0043/expected.json @@ -0,0 +1,100 @@ +{ + "type": "File", + "start": 0, + "end": 37, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 37 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 37, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 37 + } + }, + "sourceType": "script", + "body": [ + { + "type": "VariableDeclaration", + "start": 0, + "end": 37, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 37 + } + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 4, + "end": 36, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 36 + } + }, + "id": { + "type": "Identifier", + "start": 4, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "name": "source" + }, + "init": { + "type": "Literal", + "start": 13, + "end": 36, + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 1, + "column": 36 + } + }, + "value": "var x = /[a-z]/\\\\ux", + "rawValue": "var x = /[a-z]/\\\\ux", + "raw": "'var x = /[a-z]/\\\\\\\\ux'" + } + } + ], + "kind": "var" + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0043/options.json b/test/fixtures/esprima/invalid-syntax/migrated_0043/options.json new file mode 100644 index 0000000000..8bb9a5f99b --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0043/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Unexpected token (1:17)" +} \ No newline at end of file diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0044/actual.js b/test/fixtures/esprima/invalid-syntax/migrated_0044/actual.js new file mode 100644 index 0000000000..eabe2cb40a --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0044/actual.js @@ -0,0 +1 @@ +var source = 'var x = /[P QR]/\\\\u0067'; diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0044/expected.json b/test/fixtures/esprima/invalid-syntax/migrated_0044/expected.json new file mode 100644 index 0000000000..7b451084c4 --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0044/expected.json @@ -0,0 +1,100 @@ +{ + "type": "File", + "start": 0, + "end": 41, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 41 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 41, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 41 + } + }, + "sourceType": "script", + "body": [ + { + "type": "VariableDeclaration", + "start": 0, + "end": 41, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 41 + } + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 4, + "end": 40, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 40 + } + }, + "id": { + "type": "Identifier", + "start": 4, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "name": "source" + }, + "init": { + "type": "Literal", + "start": 13, + "end": 40, + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 1, + "column": 40 + } + }, + "value": "var x = /[P QR]/\\\\u0067", + "rawValue": "var x = /[P QR]/\\\\u0067", + "raw": "'var x = /[P QR]/\\\\\\\\u0067'" + } + } + ], + "kind": "var" + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0044/options.json b/test/fixtures/esprima/invalid-syntax/migrated_0044/options.json new file mode 100644 index 0000000000..2a73699bc2 --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0044/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Unexpected token (1:18)" +} \ No newline at end of file diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0045/actual.js b/test/fixtures/esprima/invalid-syntax/migrated_0045/actual.js new file mode 100644 index 0000000000..616fd0585b --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0045/actual.js @@ -0,0 +1 @@ +3 = 4 diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0045/options.json b/test/fixtures/esprima/invalid-syntax/migrated_0045/options.json new file mode 100644 index 0000000000..de19a8ed39 --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0045/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Assigning to rvalue (1:0)" +} \ No newline at end of file diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0046/actual.js b/test/fixtures/esprima/invalid-syntax/migrated_0046/actual.js new file mode 100644 index 0000000000..f77f75b0d7 --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0046/actual.js @@ -0,0 +1 @@ +func() = 4 diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0046/options.json b/test/fixtures/esprima/invalid-syntax/migrated_0046/options.json new file mode 100644 index 0000000000..de19a8ed39 --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0046/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Assigning to rvalue (1:0)" +} \ No newline at end of file diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0047/actual.js b/test/fixtures/esprima/invalid-syntax/migrated_0047/actual.js new file mode 100644 index 0000000000..963c543b5c --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0047/actual.js @@ -0,0 +1 @@ +(1 + 1) = 10 diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0047/options.json b/test/fixtures/esprima/invalid-syntax/migrated_0047/options.json new file mode 100644 index 0000000000..4d699b8b0c --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0047/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Assigning to rvalue (1:1)" +} \ No newline at end of file diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0048/actual.js b/test/fixtures/esprima/invalid-syntax/migrated_0048/actual.js new file mode 100644 index 0000000000..3271450755 --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0048/actual.js @@ -0,0 +1 @@ +var source = '"\\u{110000}"'; diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0048/expected.json b/test/fixtures/esprima/invalid-syntax/migrated_0048/expected.json new file mode 100644 index 0000000000..c74b8f4b9d --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0048/expected.json @@ -0,0 +1,100 @@ +{ + "type": "File", + "start": 0, + "end": 29, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 29 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 29, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 29 + } + }, + "sourceType": "script", + "body": [ + { + "type": "VariableDeclaration", + "start": 0, + "end": 29, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 29 + } + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 4, + "end": 28, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 28 + } + }, + "id": { + "type": "Identifier", + "start": 4, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "name": "source" + }, + "init": { + "type": "Literal", + "start": 13, + "end": 28, + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 1, + "column": 28 + } + }, + "value": "\"\\u{110000}\"", + "rawValue": "\"\\u{110000}\"", + "raw": "'\"\\\\u{110000}\"'" + } + } + ], + "kind": "var" + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0048/options.json b/test/fixtures/esprima/invalid-syntax/migrated_0048/options.json new file mode 100644 index 0000000000..358068a16a --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0048/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Unexpected token (1:12)" +} \ No newline at end of file diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0049/actual.js b/test/fixtures/esprima/invalid-syntax/migrated_0049/actual.js new file mode 100644 index 0000000000..1a2de200fe --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0049/actual.js @@ -0,0 +1 @@ +var source = '"\\u{}"'; diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0049/expected.json b/test/fixtures/esprima/invalid-syntax/migrated_0049/expected.json new file mode 100644 index 0000000000..0d8aed2410 --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0049/expected.json @@ -0,0 +1,100 @@ +{ + "type": "File", + "start": 0, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "sourceType": "script", + "body": [ + { + "type": "VariableDeclaration", + "start": 0, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 4, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "id": { + "type": "Identifier", + "start": 4, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "name": "source" + }, + "init": { + "type": "Literal", + "start": 13, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "value": "\"\\u{}\"", + "rawValue": "\"\\u{}\"", + "raw": "'\"\\\\u{}\"'" + } + } + ], + "kind": "var" + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0049/options.json b/test/fixtures/esprima/invalid-syntax/migrated_0049/options.json new file mode 100644 index 0000000000..0ab445fe47 --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0049/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Unexpected token (1:5)" +} \ No newline at end of file diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0050/actual.js b/test/fixtures/esprima/invalid-syntax/migrated_0050/actual.js new file mode 100644 index 0000000000..eac5bf2ce6 --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0050/actual.js @@ -0,0 +1 @@ +var source = '"\\u{FFFF"'; diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0050/expected.json b/test/fixtures/esprima/invalid-syntax/migrated_0050/expected.json new file mode 100644 index 0000000000..fc597b32c5 --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0050/expected.json @@ -0,0 +1,100 @@ +{ + "type": "File", + "start": 0, + "end": 26, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 26 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 26, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 26 + } + }, + "sourceType": "script", + "body": [ + { + "type": "VariableDeclaration", + "start": 0, + "end": 26, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 26 + } + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 4, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 25 + } + }, + "id": { + "type": "Identifier", + "start": 4, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "name": "source" + }, + "init": { + "type": "Literal", + "start": 13, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 1, + "column": 25 + } + }, + "value": "\"\\u{FFFF\"", + "rawValue": "\"\\u{FFFF\"", + "raw": "'\"\\\\u{FFFF\"'" + } + } + ], + "kind": "var" + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0050/options.json b/test/fixtures/esprima/invalid-syntax/migrated_0050/options.json new file mode 100644 index 0000000000..328b1ddde8 --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0050/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Unexpected token (1:10)" +} \ No newline at end of file diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0051/actual.js b/test/fixtures/esprima/invalid-syntax/migrated_0051/actual.js new file mode 100644 index 0000000000..b190f73e12 --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0051/actual.js @@ -0,0 +1 @@ +var source = '"\\u{FFZ}"'; diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0051/expected.json b/test/fixtures/esprima/invalid-syntax/migrated_0051/expected.json new file mode 100644 index 0000000000..e22bc63888 --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0051/expected.json @@ -0,0 +1,100 @@ +{ + "type": "File", + "start": 0, + "end": 26, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 26 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 26, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 26 + } + }, + "sourceType": "script", + "body": [ + { + "type": "VariableDeclaration", + "start": 0, + "end": 26, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 26 + } + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 4, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 25 + } + }, + "id": { + "type": "Identifier", + "start": 4, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "name": "source" + }, + "init": { + "type": "Literal", + "start": 13, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 1, + "column": 25 + } + }, + "value": "\"\\u{FFZ}\"", + "rawValue": "\"\\u{FFZ}\"", + "raw": "'\"\\\\u{FFZ}\"'" + } + } + ], + "kind": "var" + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0051/options.json b/test/fixtures/esprima/invalid-syntax/migrated_0051/options.json new file mode 100644 index 0000000000..65ef4a184a --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0051/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Unexpected token (1:8)" +} \ No newline at end of file diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0052/actual.js b/test/fixtures/esprima/invalid-syntax/migrated_0052/actual.js new file mode 100644 index 0000000000..8bf3f078ea --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0052/actual.js @@ -0,0 +1 @@ +1++ diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0052/options.json b/test/fixtures/esprima/invalid-syntax/migrated_0052/options.json new file mode 100644 index 0000000000..de19a8ed39 --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0052/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Assigning to rvalue (1:0)" +} \ No newline at end of file diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0053/actual.js b/test/fixtures/esprima/invalid-syntax/migrated_0053/actual.js new file mode 100644 index 0000000000..a6f48225e0 --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0053/actual.js @@ -0,0 +1 @@ +1-- diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0053/options.json b/test/fixtures/esprima/invalid-syntax/migrated_0053/options.json new file mode 100644 index 0000000000..de19a8ed39 --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0053/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Assigning to rvalue (1:0)" +} \ No newline at end of file diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0054/actual.js b/test/fixtures/esprima/invalid-syntax/migrated_0054/actual.js new file mode 100644 index 0000000000..cae2d8c862 --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0054/actual.js @@ -0,0 +1 @@ +++1 diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0054/options.json b/test/fixtures/esprima/invalid-syntax/migrated_0054/options.json new file mode 100644 index 0000000000..0b53e4963e --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0054/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Assigning to rvalue (1:2)" +} \ No newline at end of file diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0055/actual.js b/test/fixtures/esprima/invalid-syntax/migrated_0055/actual.js new file mode 100644 index 0000000000..6d785b0042 --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0055/actual.js @@ -0,0 +1 @@ +--1 diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0055/options.json b/test/fixtures/esprima/invalid-syntax/migrated_0055/options.json new file mode 100644 index 0000000000..0b53e4963e --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0055/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Assigning to rvalue (1:2)" +} \ No newline at end of file diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0056/actual.js b/test/fixtures/esprima/invalid-syntax/migrated_0056/actual.js new file mode 100644 index 0000000000..18b35ff5a7 --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0056/actual.js @@ -0,0 +1 @@ +for((1 + 1) in list) process(x); diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0056/options.json b/test/fixtures/esprima/invalid-syntax/migrated_0056/options.json new file mode 100644 index 0000000000..85f6f01102 --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0056/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Assigning to rvalue (1:5)" +} \ No newline at end of file diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0057/actual.js b/test/fixtures/esprima/invalid-syntax/migrated_0057/actual.js new file mode 100644 index 0000000000..558ed37d93 --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0057/actual.js @@ -0,0 +1 @@ +[ diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0057/options.json b/test/fixtures/esprima/invalid-syntax/migrated_0057/options.json new file mode 100644 index 0000000000..04b967a2ee --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0057/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Unexpected token (1:1)" +} \ No newline at end of file diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0058/actual.js b/test/fixtures/esprima/invalid-syntax/migrated_0058/actual.js new file mode 100644 index 0000000000..5b911f11dc --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0058/actual.js @@ -0,0 +1 @@ +[, diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0058/options.json b/test/fixtures/esprima/invalid-syntax/migrated_0058/options.json new file mode 100644 index 0000000000..e68fbb6aec --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0058/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Unexpected token (1:2)" +} \ No newline at end of file diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0059/actual.js b/test/fixtures/esprima/invalid-syntax/migrated_0059/actual.js new file mode 100644 index 0000000000..b2b02c9336 --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0059/actual.js @@ -0,0 +1 @@ +1 + { diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0059/options.json b/test/fixtures/esprima/invalid-syntax/migrated_0059/options.json new file mode 100644 index 0000000000..0ab445fe47 --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0059/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Unexpected token (1:5)" +} \ No newline at end of file diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0060/actual.js b/test/fixtures/esprima/invalid-syntax/migrated_0060/actual.js new file mode 100644 index 0000000000..5518c1faaf --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0060/actual.js @@ -0,0 +1 @@ +1 + { t:t diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0060/options.json b/test/fixtures/esprima/invalid-syntax/migrated_0060/options.json new file mode 100644 index 0000000000..93db7641c7 --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0060/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Unexpected token (1:9)" +} \ No newline at end of file diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0061/actual.js b/test/fixtures/esprima/invalid-syntax/migrated_0061/actual.js new file mode 100644 index 0000000000..21306bd0bd --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0061/actual.js @@ -0,0 +1 @@ +1 + { t:t, diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0061/options.json b/test/fixtures/esprima/invalid-syntax/migrated_0061/options.json new file mode 100644 index 0000000000..328b1ddde8 --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0061/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Unexpected token (1:10)" +} \ No newline at end of file diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0062/actual.js b/test/fixtures/esprima/invalid-syntax/migrated_0062/actual.js new file mode 100644 index 0000000000..90e4e14a24 --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0062/actual.js @@ -0,0 +1,2 @@ +var x = / +/ diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0062/options.json b/test/fixtures/esprima/invalid-syntax/migrated_0062/options.json new file mode 100644 index 0000000000..d5e4b52d5c --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0062/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Unterminated regular expression (1:9)" +} \ No newline at end of file diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0063/actual.js b/test/fixtures/esprima/invalid-syntax/migrated_0063/actual.js new file mode 100644 index 0000000000..66386204a9 --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0063/actual.js @@ -0,0 +1 @@ +var x = " diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0063/options.json b/test/fixtures/esprima/invalid-syntax/migrated_0063/options.json new file mode 100644 index 0000000000..78a668d16d --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0063/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Unterminated string constant (1:8)" +} \ No newline at end of file diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0064/actual.js b/test/fixtures/esprima/invalid-syntax/migrated_0064/actual.js new file mode 100644 index 0000000000..9c2ca5814d --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0064/actual.js @@ -0,0 +1 @@ +var if = 42 diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0064/options.json b/test/fixtures/esprima/invalid-syntax/migrated_0064/options.json new file mode 100644 index 0000000000..9f7910a413 --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0064/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Unexpected token (1:4)" +} \ No newline at end of file diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0065/actual.js b/test/fixtures/esprima/invalid-syntax/migrated_0065/actual.js new file mode 100644 index 0000000000..04b9f4b9e6 --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0065/actual.js @@ -0,0 +1 @@ +i #= 42 diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0065/options.json b/test/fixtures/esprima/invalid-syntax/migrated_0065/options.json new file mode 100644 index 0000000000..852d412611 --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0065/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Unexpected character '#' (1:2)" +} \ No newline at end of file diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0066/actual.js b/test/fixtures/esprima/invalid-syntax/migrated_0066/actual.js new file mode 100644 index 0000000000..6474a49009 --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0066/actual.js @@ -0,0 +1 @@ +i + 2 = 42 diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0066/options.json b/test/fixtures/esprima/invalid-syntax/migrated_0066/options.json new file mode 100644 index 0000000000..de19a8ed39 --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0066/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Assigning to rvalue (1:0)" +} \ No newline at end of file diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0067/actual.js b/test/fixtures/esprima/invalid-syntax/migrated_0067/actual.js new file mode 100644 index 0000000000..f9eaf60b60 --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0067/actual.js @@ -0,0 +1 @@ ++i = 42 diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0067/options.json b/test/fixtures/esprima/invalid-syntax/migrated_0067/options.json new file mode 100644 index 0000000000..de19a8ed39 --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0067/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Assigning to rvalue (1:0)" +} \ No newline at end of file diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0068/actual.js b/test/fixtures/esprima/invalid-syntax/migrated_0068/actual.js new file mode 100644 index 0000000000..49be204801 --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0068/actual.js @@ -0,0 +1 @@ +1 + ( diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0068/options.json b/test/fixtures/esprima/invalid-syntax/migrated_0068/options.json new file mode 100644 index 0000000000..0ab445fe47 --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0068/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Unexpected token (1:5)" +} \ No newline at end of file diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0069/actual.js b/test/fixtures/esprima/invalid-syntax/migrated_0069/actual.js new file mode 100644 index 0000000000..98232c64fc --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0069/actual.js @@ -0,0 +1 @@ +{ diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0069/options.json b/test/fixtures/esprima/invalid-syntax/migrated_0069/options.json new file mode 100644 index 0000000000..04b967a2ee --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0069/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Unexpected token (1:1)" +} \ No newline at end of file diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0070/actual.js b/test/fixtures/esprima/invalid-syntax/migrated_0070/actual.js new file mode 100644 index 0000000000..e0b089091d --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0070/actual.js @@ -0,0 +1,3 @@ +/* Some multiline +comment */ +) diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0070/options.json b/test/fixtures/esprima/invalid-syntax/migrated_0070/options.json new file mode 100644 index 0000000000..aa8239233c --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0070/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Unexpected token (3:0)" +} \ No newline at end of file diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0071/actual.js b/test/fixtures/esprima/invalid-syntax/migrated_0071/actual.js new file mode 100644 index 0000000000..6f0c9a74a2 --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0071/actual.js @@ -0,0 +1 @@ +{ set 1 } diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0071/options.json b/test/fixtures/esprima/invalid-syntax/migrated_0071/options.json new file mode 100644 index 0000000000..515b971673 --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0071/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Unexpected token (1:6)" +} \ No newline at end of file diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0072/actual.js b/test/fixtures/esprima/invalid-syntax/migrated_0072/actual.js new file mode 100644 index 0000000000..0718d8d1a0 --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0072/actual.js @@ -0,0 +1 @@ +{ get 2 } diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0072/options.json b/test/fixtures/esprima/invalid-syntax/migrated_0072/options.json new file mode 100644 index 0000000000..515b971673 --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0072/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Unexpected token (1:6)" +} \ No newline at end of file diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0073/actual.js b/test/fixtures/esprima/invalid-syntax/migrated_0073/actual.js new file mode 100644 index 0000000000..0bfede151f --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0073/actual.js @@ -0,0 +1 @@ +({ set: s(if) { } }) diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0073/options.json b/test/fixtures/esprima/invalid-syntax/migrated_0073/options.json new file mode 100644 index 0000000000..328b1ddde8 --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0073/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Unexpected token (1:10)" +} \ No newline at end of file diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0074/actual.js b/test/fixtures/esprima/invalid-syntax/migrated_0074/actual.js new file mode 100644 index 0000000000..74ef97f8fc --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0074/actual.js @@ -0,0 +1 @@ +({ set s(.) { } }) diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0074/options.json b/test/fixtures/esprima/invalid-syntax/migrated_0074/options.json new file mode 100644 index 0000000000..93db7641c7 --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0074/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Unexpected token (1:9)" +} \ No newline at end of file diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0075/actual.js b/test/fixtures/esprima/invalid-syntax/migrated_0075/actual.js new file mode 100644 index 0000000000..d511811854 --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0075/actual.js @@ -0,0 +1 @@ +({ set s() { } }) diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0075/options.json b/test/fixtures/esprima/invalid-syntax/migrated_0075/options.json new file mode 100644 index 0000000000..0341c5637c --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0075/options.json @@ -0,0 +1,3 @@ +{ + "throws": "setter should have exactly one param (1:8)" +} \ No newline at end of file diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0076/actual.js b/test/fixtures/esprima/invalid-syntax/migrated_0076/actual.js new file mode 100644 index 0000000000..d016bfac86 --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0076/actual.js @@ -0,0 +1 @@ +({ set: s() { } }) diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0076/options.json b/test/fixtures/esprima/invalid-syntax/migrated_0076/options.json new file mode 100644 index 0000000000..358068a16a --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0076/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Unexpected token (1:12)" +} \ No newline at end of file diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0077/actual.js b/test/fixtures/esprima/invalid-syntax/migrated_0077/actual.js new file mode 100644 index 0000000000..3565cf9420 --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0077/actual.js @@ -0,0 +1 @@ +({ set: s(a, b) { } }) diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0077/options.json b/test/fixtures/esprima/invalid-syntax/migrated_0077/options.json new file mode 100644 index 0000000000..89e36d9013 --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0077/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Unexpected token (1:16)" +} \ No newline at end of file diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0078/actual.js b/test/fixtures/esprima/invalid-syntax/migrated_0078/actual.js new file mode 100644 index 0000000000..0c8721bff2 --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0078/actual.js @@ -0,0 +1 @@ +({ get: g(d) { } }) diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0078/options.json b/test/fixtures/esprima/invalid-syntax/migrated_0078/options.json new file mode 100644 index 0000000000..27f6e27de8 --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0078/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Unexpected token (1:13)" +} \ No newline at end of file diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0080/actual.js b/test/fixtures/esprima/invalid-syntax/migrated_0080/actual.js new file mode 100644 index 0000000000..1de1532eef --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0080/actual.js @@ -0,0 +1 @@ +({[a,b]:0}) diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0080/options.json b/test/fixtures/esprima/invalid-syntax/migrated_0080/options.json new file mode 100644 index 0000000000..9f7910a413 --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0080/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Unexpected token (1:4)" +} \ No newline at end of file diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0081/actual.js b/test/fixtures/esprima/invalid-syntax/migrated_0081/actual.js new file mode 100644 index 0000000000..be1b0c7ed0 --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0081/actual.js @@ -0,0 +1 @@ +({get[a,b]:0}) diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0081/options.json b/test/fixtures/esprima/invalid-syntax/migrated_0081/options.json new file mode 100644 index 0000000000..167116741e --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0081/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Unexpected token (1:7)" +} \ No newline at end of file diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0082/actual.js b/test/fixtures/esprima/invalid-syntax/migrated_0082/actual.js new file mode 100644 index 0000000000..90278627e4 --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0082/actual.js @@ -0,0 +1 @@ +({(a):0}) diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0082/options.json b/test/fixtures/esprima/invalid-syntax/migrated_0082/options.json new file mode 100644 index 0000000000..e68fbb6aec --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0082/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Unexpected token (1:2)" +} \ No newline at end of file diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0083/actual.js b/test/fixtures/esprima/invalid-syntax/migrated_0083/actual.js new file mode 100644 index 0000000000..31d05430f1 --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0083/actual.js @@ -0,0 +1 @@ +({get{a}:0}) diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0083/options.json b/test/fixtures/esprima/invalid-syntax/migrated_0083/options.json new file mode 100644 index 0000000000..0ab445fe47 --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0083/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Unexpected token (1:5)" +} \ No newline at end of file diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0084/actual.js b/test/fixtures/esprima/invalid-syntax/migrated_0084/actual.js new file mode 100644 index 0000000000..f505a44ce5 --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0084/actual.js @@ -0,0 +1 @@ +({get diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0084/options.json b/test/fixtures/esprima/invalid-syntax/migrated_0084/options.json new file mode 100644 index 0000000000..0ab445fe47 --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0084/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Unexpected token (1:5)" +} \ No newline at end of file diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0085/actual.js b/test/fixtures/esprima/invalid-syntax/migrated_0085/actual.js new file mode 100644 index 0000000000..375e21014c --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0085/actual.js @@ -0,0 +1 @@ +((a)) => 42 diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0085/options.json b/test/fixtures/esprima/invalid-syntax/migrated_0085/options.json new file mode 100644 index 0000000000..04b967a2ee --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0085/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Unexpected token (1:1)" +} \ No newline at end of file diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0086/actual.js b/test/fixtures/esprima/invalid-syntax/migrated_0086/actual.js new file mode 100644 index 0000000000..89739afb96 --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0086/actual.js @@ -0,0 +1 @@ +(a, (b)) => 42 diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0086/options.json b/test/fixtures/esprima/invalid-syntax/migrated_0086/options.json new file mode 100644 index 0000000000..9f7910a413 --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0086/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Unexpected token (1:4)" +} \ No newline at end of file diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0087/actual.js b/test/fixtures/esprima/invalid-syntax/migrated_0087/actual.js new file mode 100644 index 0000000000..04e1f360a9 --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0087/actual.js @@ -0,0 +1 @@ +"use strict"; (eval = 10) => 42 diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0087/options.json b/test/fixtures/esprima/invalid-syntax/migrated_0087/options.json new file mode 100644 index 0000000000..7ba6713b58 --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0087/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Assigning to eval in strict mode (1:15)" +} \ No newline at end of file diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0088/actual.js b/test/fixtures/esprima/invalid-syntax/migrated_0088/actual.js new file mode 100644 index 0000000000..a2477b1895 --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0088/actual.js @@ -0,0 +1 @@ +"use strict"; eval => 42 diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0088/options.json b/test/fixtures/esprima/invalid-syntax/migrated_0088/options.json new file mode 100644 index 0000000000..734b22815e --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0088/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Binding eval in strict mode (1:14)" +} \ No newline at end of file diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0089/actual.js b/test/fixtures/esprima/invalid-syntax/migrated_0089/actual.js new file mode 100644 index 0000000000..6c508673a1 --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0089/actual.js @@ -0,0 +1 @@ +"use strict"; arguments => 42 diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0089/options.json b/test/fixtures/esprima/invalid-syntax/migrated_0089/options.json new file mode 100644 index 0000000000..a3af8401ae --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0089/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Binding arguments in strict mode (1:14)" +} \ No newline at end of file diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0090/actual.js b/test/fixtures/esprima/invalid-syntax/migrated_0090/actual.js new file mode 100644 index 0000000000..520fa01c1f --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0090/actual.js @@ -0,0 +1 @@ +"use strict"; (eval, a) => 42 diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0090/options.json b/test/fixtures/esprima/invalid-syntax/migrated_0090/options.json new file mode 100644 index 0000000000..8de33328ad --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0090/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Binding eval in strict mode (1:15)" +} \ No newline at end of file diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0091/actual.js b/test/fixtures/esprima/invalid-syntax/migrated_0091/actual.js new file mode 100644 index 0000000000..7fd870b9dd --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0091/actual.js @@ -0,0 +1 @@ +"use strict"; (arguments, a) => 42 diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0091/options.json b/test/fixtures/esprima/invalid-syntax/migrated_0091/options.json new file mode 100644 index 0000000000..e2b36a2437 --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0091/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Binding arguments in strict mode (1:15)" +} \ No newline at end of file diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0092/actual.js b/test/fixtures/esprima/invalid-syntax/migrated_0092/actual.js new file mode 100644 index 0000000000..4c4b266635 --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0092/actual.js @@ -0,0 +1 @@ +(a, a) => 42 diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0092/expected.json b/test/fixtures/esprima/invalid-syntax/migrated_0092/expected.json new file mode 100644 index 0000000000..89326051bc --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0092/expected.json @@ -0,0 +1,118 @@ +{ + "type": "File", + "start": 0, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "expression": { + "type": "ArrowFunctionExpression", + "start": 0, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "id": null, + "generator": false, + "expression": true, + "params": [ + { + "type": "Identifier", + "start": 1, + "end": 2, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 2 + } + }, + "name": "a" + }, + { + "type": "Identifier", + "start": 4, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "name": "a" + } + ], + "body": { + "type": "Literal", + "start": 10, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "value": 42, + "rawValue": 42, + "raw": "42" + } + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0092/options.json b/test/fixtures/esprima/invalid-syntax/migrated_0092/options.json new file mode 100644 index 0000000000..167116741e --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0092/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Unexpected token (1:7)" +} \ No newline at end of file diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0093/actual.js b/test/fixtures/esprima/invalid-syntax/migrated_0093/actual.js new file mode 100644 index 0000000000..c6a78ee8e5 --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0093/actual.js @@ -0,0 +1 @@ +"use strict"; (a, a) => 42 diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0093/options.json b/test/fixtures/esprima/invalid-syntax/migrated_0093/options.json new file mode 100644 index 0000000000..8d80c05650 --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0093/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Argument name clash in strict mode (1:18)" +} \ No newline at end of file diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0094/actual.js b/test/fixtures/esprima/invalid-syntax/migrated_0094/actual.js new file mode 100644 index 0000000000..93bfca5079 --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0094/actual.js @@ -0,0 +1 @@ +"use strict"; (a) => 00 diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0094/options.json b/test/fixtures/esprima/invalid-syntax/migrated_0094/options.json new file mode 100644 index 0000000000..2fdbbb1bc8 --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0094/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Invalid number (1:21)" +} \ No newline at end of file diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0095/actual.js b/test/fixtures/esprima/invalid-syntax/migrated_0095/actual.js new file mode 100644 index 0000000000..150c7e8b14 --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0095/actual.js @@ -0,0 +1 @@ +() <= 42 diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0095/options.json b/test/fixtures/esprima/invalid-syntax/migrated_0095/options.json new file mode 100644 index 0000000000..04b967a2ee --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0095/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Unexpected token (1:1)" +} \ No newline at end of file diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0096/actual.js b/test/fixtures/esprima/invalid-syntax/migrated_0096/actual.js new file mode 100644 index 0000000000..d0b3ff9746 --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0096/actual.js @@ -0,0 +1 @@ +() ? 42 diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0096/options.json b/test/fixtures/esprima/invalid-syntax/migrated_0096/options.json new file mode 100644 index 0000000000..04b967a2ee --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0096/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Unexpected token (1:1)" +} \ No newline at end of file diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0097/actual.js b/test/fixtures/esprima/invalid-syntax/migrated_0097/actual.js new file mode 100644 index 0000000000..f70424ee94 --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0097/actual.js @@ -0,0 +1 @@ +() + 42 diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0097/options.json b/test/fixtures/esprima/invalid-syntax/migrated_0097/options.json new file mode 100644 index 0000000000..04b967a2ee --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0097/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Unexpected token (1:1)" +} \ No newline at end of file diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0098/actual.js b/test/fixtures/esprima/invalid-syntax/migrated_0098/actual.js new file mode 100644 index 0000000000..c8c983560f --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0098/actual.js @@ -0,0 +1 @@ +(10) => 00 diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0098/options.json b/test/fixtures/esprima/invalid-syntax/migrated_0098/options.json new file mode 100644 index 0000000000..4d699b8b0c --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0098/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Assigning to rvalue (1:1)" +} \ No newline at end of file diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0099/actual.js b/test/fixtures/esprima/invalid-syntax/migrated_0099/actual.js new file mode 100644 index 0000000000..147de1b125 --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0099/actual.js @@ -0,0 +1 @@ +(10, 20) => 00 diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0099/options.json b/test/fixtures/esprima/invalid-syntax/migrated_0099/options.json new file mode 100644 index 0000000000..4d699b8b0c --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0099/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Assigning to rvalue (1:1)" +} \ No newline at end of file diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0100/actual.js b/test/fixtures/esprima/invalid-syntax/migrated_0100/actual.js new file mode 100644 index 0000000000..352636041d --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0100/actual.js @@ -0,0 +1 @@ +"use strict"; (eval) => 42 diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0100/options.json b/test/fixtures/esprima/invalid-syntax/migrated_0100/options.json new file mode 100644 index 0000000000..8de33328ad --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0100/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Binding eval in strict mode (1:15)" +} \ No newline at end of file diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0101/actual.js b/test/fixtures/esprima/invalid-syntax/migrated_0101/actual.js new file mode 100644 index 0000000000..a27d9ae050 --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0101/actual.js @@ -0,0 +1 @@ +(eval) => { "use strict"; 42 } diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0101/expected.json b/test/fixtures/esprima/invalid-syntax/migrated_0101/expected.json new file mode 100644 index 0000000000..338190dde1 --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0101/expected.json @@ -0,0 +1,167 @@ +{ + "type": "File", + "start": 0, + "end": 30, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 30 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 30, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 30 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 30, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 30 + } + }, + "expression": { + "type": "ArrowFunctionExpression", + "start": 0, + "end": 30, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 30 + } + }, + "id": null, + "generator": false, + "expression": false, + "params": [ + { + "type": "Identifier", + "start": 1, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "name": "eval" + } + ], + "body": { + "type": "BlockStatement", + "start": 10, + "end": 30, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 30 + } + }, + "body": [ + { + "type": "ExpressionStatement", + "start": 12, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 12 + }, + "end": { + "line": 1, + "column": 25 + } + }, + "expression": { + "type": "Literal", + "start": 12, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 12 + }, + "end": { + "line": 1, + "column": 24 + } + }, + "value": "use strict", + "rawValue": "use strict", + "raw": "\"use strict\"" + } + }, + { + "type": "ExpressionStatement", + "start": 26, + "end": 28, + "loc": { + "start": { + "line": 1, + "column": 26 + }, + "end": { + "line": 1, + "column": 28 + } + }, + "expression": { + "type": "Literal", + "start": 26, + "end": 28, + "loc": { + "start": { + "line": 1, + "column": 26 + }, + "end": { + "line": 1, + "column": 28 + } + }, + "value": 42, + "rawValue": 42, + "raw": "42" + } + } + ] + } + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0101/options.json b/test/fixtures/esprima/invalid-syntax/migrated_0101/options.json new file mode 100644 index 0000000000..4bd43226c1 --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0101/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Binding eval in strict mode (1:1)" +} \ No newline at end of file diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0102/actual.js b/test/fixtures/esprima/invalid-syntax/migrated_0102/actual.js new file mode 100644 index 0000000000..ccaeb93a8c --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0102/actual.js @@ -0,0 +1 @@ +p = { q/ } diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0102/options.json b/test/fixtures/esprima/invalid-syntax/migrated_0102/options.json new file mode 100644 index 0000000000..167116741e --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0102/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Unexpected token (1:7)" +} \ No newline at end of file diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0103/actual.js b/test/fixtures/esprima/invalid-syntax/migrated_0103/actual.js new file mode 100644 index 0000000000..82bba3473a --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0103/actual.js @@ -0,0 +1 @@ +p = { "q"/ } diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0103/options.json b/test/fixtures/esprima/invalid-syntax/migrated_0103/options.json new file mode 100644 index 0000000000..93db7641c7 --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0103/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Unexpected token (1:9)" +} \ No newline at end of file diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0104/actual.js b/test/fixtures/esprima/invalid-syntax/migrated_0104/actual.js new file mode 100644 index 0000000000..9d44939080 --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0104/actual.js @@ -0,0 +1 @@ +function t(if) { } diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0104/options.json b/test/fixtures/esprima/invalid-syntax/migrated_0104/options.json new file mode 100644 index 0000000000..3e33f7730f --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0104/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Unexpected token (1:11)" +} \ No newline at end of file diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0105/actual.js b/test/fixtures/esprima/invalid-syntax/migrated_0105/actual.js new file mode 100644 index 0000000000..d7516ce611 --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0105/actual.js @@ -0,0 +1 @@ +function t(true) { } diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0105/options.json b/test/fixtures/esprima/invalid-syntax/migrated_0105/options.json new file mode 100644 index 0000000000..3e33f7730f --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0105/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Unexpected token (1:11)" +} \ No newline at end of file diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0106/actual.js b/test/fixtures/esprima/invalid-syntax/migrated_0106/actual.js new file mode 100644 index 0000000000..e8edce8239 --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0106/actual.js @@ -0,0 +1 @@ +function t(false) { } diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0106/options.json b/test/fixtures/esprima/invalid-syntax/migrated_0106/options.json new file mode 100644 index 0000000000..3e33f7730f --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0106/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Unexpected token (1:11)" +} \ No newline at end of file diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0107/actual.js b/test/fixtures/esprima/invalid-syntax/migrated_0107/actual.js new file mode 100644 index 0000000000..86c3d224d0 --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0107/actual.js @@ -0,0 +1 @@ +function t(null) { } diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0107/options.json b/test/fixtures/esprima/invalid-syntax/migrated_0107/options.json new file mode 100644 index 0000000000..3e33f7730f --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0107/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Unexpected token (1:11)" +} \ No newline at end of file diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0108/actual.js b/test/fixtures/esprima/invalid-syntax/migrated_0108/actual.js new file mode 100644 index 0000000000..6cafc79275 --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0108/actual.js @@ -0,0 +1 @@ +function null() { } diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0108/options.json b/test/fixtures/esprima/invalid-syntax/migrated_0108/options.json new file mode 100644 index 0000000000..93db7641c7 --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0108/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Unexpected token (1:9)" +} \ No newline at end of file diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0109/actual.js b/test/fixtures/esprima/invalid-syntax/migrated_0109/actual.js new file mode 100644 index 0000000000..bc1d04c212 --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0109/actual.js @@ -0,0 +1 @@ +function true() { } diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0109/options.json b/test/fixtures/esprima/invalid-syntax/migrated_0109/options.json new file mode 100644 index 0000000000..93db7641c7 --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0109/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Unexpected token (1:9)" +} \ No newline at end of file diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0110/actual.js b/test/fixtures/esprima/invalid-syntax/migrated_0110/actual.js new file mode 100644 index 0000000000..4480e07b7d --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0110/actual.js @@ -0,0 +1 @@ +function false() { } diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0110/options.json b/test/fixtures/esprima/invalid-syntax/migrated_0110/options.json new file mode 100644 index 0000000000..93db7641c7 --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0110/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Unexpected token (1:9)" +} \ No newline at end of file diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0111/actual.js b/test/fixtures/esprima/invalid-syntax/migrated_0111/actual.js new file mode 100644 index 0000000000..df1aa5f561 --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0111/actual.js @@ -0,0 +1 @@ +function if() { } diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0111/options.json b/test/fixtures/esprima/invalid-syntax/migrated_0111/options.json new file mode 100644 index 0000000000..93db7641c7 --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0111/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Unexpected token (1:9)" +} \ No newline at end of file diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0112/actual.js b/test/fixtures/esprima/invalid-syntax/migrated_0112/actual.js new file mode 100644 index 0000000000..067469daeb --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0112/actual.js @@ -0,0 +1 @@ +a b; diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0112/options.json b/test/fixtures/esprima/invalid-syntax/migrated_0112/options.json new file mode 100644 index 0000000000..e68fbb6aec --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0112/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Unexpected token (1:2)" +} \ No newline at end of file diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0113/actual.js b/test/fixtures/esprima/invalid-syntax/migrated_0113/actual.js new file mode 100644 index 0000000000..4656d46fe7 --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0113/actual.js @@ -0,0 +1 @@ +if.a; diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0113/options.json b/test/fixtures/esprima/invalid-syntax/migrated_0113/options.json new file mode 100644 index 0000000000..e68fbb6aec --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0113/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Unexpected token (1:2)" +} \ No newline at end of file diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0114/actual.js b/test/fixtures/esprima/invalid-syntax/migrated_0114/actual.js new file mode 100644 index 0000000000..50a58c6f8e --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0114/actual.js @@ -0,0 +1 @@ +a if; diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0114/options.json b/test/fixtures/esprima/invalid-syntax/migrated_0114/options.json new file mode 100644 index 0000000000..e68fbb6aec --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0114/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Unexpected token (1:2)" +} \ No newline at end of file diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0115/actual.js b/test/fixtures/esprima/invalid-syntax/migrated_0115/actual.js new file mode 100644 index 0000000000..f27f0312fd --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0115/actual.js @@ -0,0 +1 @@ +a enum; diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0115/options.json b/test/fixtures/esprima/invalid-syntax/migrated_0115/options.json new file mode 100644 index 0000000000..e68fbb6aec --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0115/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Unexpected token (1:2)" +} \ No newline at end of file diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0116/actual.js b/test/fixtures/esprima/invalid-syntax/migrated_0116/actual.js new file mode 100644 index 0000000000..bf3fdcd662 --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0116/actual.js @@ -0,0 +1 @@ +break diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0116/options.json b/test/fixtures/esprima/invalid-syntax/migrated_0116/options.json new file mode 100644 index 0000000000..6ccbfe923d --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0116/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Unsyntactic break (1:0)" +} \ No newline at end of file diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0117/actual.js b/test/fixtures/esprima/invalid-syntax/migrated_0117/actual.js new file mode 100644 index 0000000000..b15d781d74 --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0117/actual.js @@ -0,0 +1 @@ +break 1; diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0117/options.json b/test/fixtures/esprima/invalid-syntax/migrated_0117/options.json new file mode 100644 index 0000000000..515b971673 --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0117/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Unexpected token (1:6)" +} \ No newline at end of file diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0118/actual.js b/test/fixtures/esprima/invalid-syntax/migrated_0118/actual.js new file mode 100644 index 0000000000..44c5d7d65e --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0118/actual.js @@ -0,0 +1 @@ +continue diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0118/options.json b/test/fixtures/esprima/invalid-syntax/migrated_0118/options.json new file mode 100644 index 0000000000..14a50290d0 --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0118/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Unsyntactic continue (1:0)" +} \ No newline at end of file diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0119/actual.js b/test/fixtures/esprima/invalid-syntax/migrated_0119/actual.js new file mode 100644 index 0000000000..d3ea6dec54 --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0119/actual.js @@ -0,0 +1 @@ +continue 2; diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0119/options.json b/test/fixtures/esprima/invalid-syntax/migrated_0119/options.json new file mode 100644 index 0000000000..93db7641c7 --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0119/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Unexpected token (1:9)" +} \ No newline at end of file diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0120/actual.js b/test/fixtures/esprima/invalid-syntax/migrated_0120/actual.js new file mode 100644 index 0000000000..18db166649 --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0120/actual.js @@ -0,0 +1 @@ +throw diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0120/options.json b/test/fixtures/esprima/invalid-syntax/migrated_0120/options.json new file mode 100644 index 0000000000..0ab445fe47 --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0120/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Unexpected token (1:5)" +} \ No newline at end of file diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0121/actual.js b/test/fixtures/esprima/invalid-syntax/migrated_0121/actual.js new file mode 100644 index 0000000000..647703f8c2 --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0121/actual.js @@ -0,0 +1 @@ +throw; diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0121/options.json b/test/fixtures/esprima/invalid-syntax/migrated_0121/options.json new file mode 100644 index 0000000000..0ab445fe47 --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0121/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Unexpected token (1:5)" +} \ No newline at end of file diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0122/actual.js b/test/fixtures/esprima/invalid-syntax/migrated_0122/actual.js new file mode 100644 index 0000000000..18db166649 --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0122/actual.js @@ -0,0 +1 @@ +throw diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0122/options.json b/test/fixtures/esprima/invalid-syntax/migrated_0122/options.json new file mode 100644 index 0000000000..0ab445fe47 --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0122/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Unexpected token (1:5)" +} \ No newline at end of file diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0123/actual.js b/test/fixtures/esprima/invalid-syntax/migrated_0123/actual.js new file mode 100644 index 0000000000..93db8e824f --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0123/actual.js @@ -0,0 +1 @@ +for (var i, i2 in {}); diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0123/options.json b/test/fixtures/esprima/invalid-syntax/migrated_0123/options.json new file mode 100644 index 0000000000..7ca1e1ffbb --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0123/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Unexpected token (1:15)" +} \ No newline at end of file diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0124/actual.js b/test/fixtures/esprima/invalid-syntax/migrated_0124/actual.js new file mode 100644 index 0000000000..8a28bcd011 --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0124/actual.js @@ -0,0 +1 @@ +for ((i in {})); diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0124/options.json b/test/fixtures/esprima/invalid-syntax/migrated_0124/options.json new file mode 100644 index 0000000000..51c483f3d3 --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0124/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Unexpected token (1:14)" +} \ No newline at end of file diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0125/actual.js b/test/fixtures/esprima/invalid-syntax/migrated_0125/actual.js new file mode 100644 index 0000000000..726bd139c1 --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0125/actual.js @@ -0,0 +1 @@ +for (i + 1 in {}); diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0125/options.json b/test/fixtures/esprima/invalid-syntax/migrated_0125/options.json new file mode 100644 index 0000000000..85f6f01102 --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0125/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Assigning to rvalue (1:5)" +} \ No newline at end of file diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0126/actual.js b/test/fixtures/esprima/invalid-syntax/migrated_0126/actual.js new file mode 100644 index 0000000000..5f2c966c28 --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0126/actual.js @@ -0,0 +1 @@ +for (+i in {}); diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0126/options.json b/test/fixtures/esprima/invalid-syntax/migrated_0126/options.json new file mode 100644 index 0000000000..85f6f01102 --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0126/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Assigning to rvalue (1:5)" +} \ No newline at end of file diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0127/actual.js b/test/fixtures/esprima/invalid-syntax/migrated_0127/actual.js new file mode 100644 index 0000000000..cec627f0c4 --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0127/actual.js @@ -0,0 +1 @@ +if(false) diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0127/options.json b/test/fixtures/esprima/invalid-syntax/migrated_0127/options.json new file mode 100644 index 0000000000..93db7641c7 --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0127/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Unexpected token (1:9)" +} \ No newline at end of file diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0128/actual.js b/test/fixtures/esprima/invalid-syntax/migrated_0128/actual.js new file mode 100644 index 0000000000..e75fa10598 --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0128/actual.js @@ -0,0 +1 @@ +if(false) doThis(); else diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0128/options.json b/test/fixtures/esprima/invalid-syntax/migrated_0128/options.json new file mode 100644 index 0000000000..0c5f4deed6 --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0128/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Unexpected token (1:24)" +} \ No newline at end of file diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0129/actual.js b/test/fixtures/esprima/invalid-syntax/migrated_0129/actual.js new file mode 100644 index 0000000000..91ebb18bbb --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0129/actual.js @@ -0,0 +1 @@ +do diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0129/options.json b/test/fixtures/esprima/invalid-syntax/migrated_0129/options.json new file mode 100644 index 0000000000..e68fbb6aec --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0129/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Unexpected token (1:2)" +} \ No newline at end of file diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0130/actual.js b/test/fixtures/esprima/invalid-syntax/migrated_0130/actual.js new file mode 100644 index 0000000000..98dcc6eb86 --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0130/actual.js @@ -0,0 +1 @@ +while(false) diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0130/options.json b/test/fixtures/esprima/invalid-syntax/migrated_0130/options.json new file mode 100644 index 0000000000..358068a16a --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0130/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Unexpected token (1:12)" +} \ No newline at end of file diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0131/actual.js b/test/fixtures/esprima/invalid-syntax/migrated_0131/actual.js new file mode 100644 index 0000000000..c046779af2 --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0131/actual.js @@ -0,0 +1 @@ +for(;;) diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0131/options.json b/test/fixtures/esprima/invalid-syntax/migrated_0131/options.json new file mode 100644 index 0000000000..167116741e --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0131/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Unexpected token (1:7)" +} \ No newline at end of file diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0132/actual.js b/test/fixtures/esprima/invalid-syntax/migrated_0132/actual.js new file mode 100644 index 0000000000..293dcc9270 --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0132/actual.js @@ -0,0 +1 @@ +with(x) diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0132/options.json b/test/fixtures/esprima/invalid-syntax/migrated_0132/options.json new file mode 100644 index 0000000000..167116741e --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0132/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Unexpected token (1:7)" +} \ No newline at end of file diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0133/actual.js b/test/fixtures/esprima/invalid-syntax/migrated_0133/actual.js new file mode 100644 index 0000000000..7340c58dc3 --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0133/actual.js @@ -0,0 +1 @@ +try { } diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0133/options.json b/test/fixtures/esprima/invalid-syntax/migrated_0133/options.json new file mode 100644 index 0000000000..9b3d4185f1 --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0133/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Missing catch or finally clause (1:0)" +} \ No newline at end of file diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0134/actual.js b/test/fixtures/esprima/invalid-syntax/migrated_0134/actual.js new file mode 100644 index 0000000000..5b0413681b --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0134/actual.js @@ -0,0 +1 @@ +try {} catch (42) {} diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0134/options.json b/test/fixtures/esprima/invalid-syntax/migrated_0134/options.json new file mode 100644 index 0000000000..51c483f3d3 --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0134/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Unexpected token (1:14)" +} \ No newline at end of file diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0135/actual.js b/test/fixtures/esprima/invalid-syntax/migrated_0135/actual.js new file mode 100644 index 0000000000..4667a13b69 --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0135/actual.js @@ -0,0 +1 @@ +try {} catch (answer()) {} diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0135/options.json b/test/fixtures/esprima/invalid-syntax/migrated_0135/options.json new file mode 100644 index 0000000000..aca079ee39 --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0135/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Unexpected token (1:20)" +} \ No newline at end of file diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0136/actual.js b/test/fixtures/esprima/invalid-syntax/migrated_0136/actual.js new file mode 100644 index 0000000000..7b5aa84de3 --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0136/actual.js @@ -0,0 +1 @@ +try {} catch (-x) {} diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0136/options.json b/test/fixtures/esprima/invalid-syntax/migrated_0136/options.json new file mode 100644 index 0000000000..51c483f3d3 --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0136/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Unexpected token (1:14)" +} \ No newline at end of file diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0137/actual.js b/test/fixtures/esprima/invalid-syntax/migrated_0137/actual.js new file mode 100644 index 0000000000..93e2a300f1 --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0137/actual.js @@ -0,0 +1 @@ +var source = '\u203F = 10'; diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0137/expected.json b/test/fixtures/esprima/invalid-syntax/migrated_0137/expected.json new file mode 100644 index 0000000000..c910512d1a --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0137/expected.json @@ -0,0 +1,100 @@ +{ + "type": "File", + "start": 0, + "end": 27, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 27 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 27, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 27 + } + }, + "sourceType": "script", + "body": [ + { + "type": "VariableDeclaration", + "start": 0, + "end": 27, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 27 + } + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 4, + "end": 26, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 26 + } + }, + "id": { + "type": "Identifier", + "start": 4, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "name": "source" + }, + "init": { + "type": "Literal", + "start": 13, + "end": 26, + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 1, + "column": 26 + } + }, + "value": "‿ = 10", + "rawValue": "‿ = 10", + "raw": "'\\u203F = 10'" + } + } + ], + "kind": "var" + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0137/options.json b/test/fixtures/esprima/invalid-syntax/migrated_0137/options.json new file mode 100644 index 0000000000..04b967a2ee --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0137/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Unexpected token (1:1)" +} \ No newline at end of file diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0138/actual.js b/test/fixtures/esprima/invalid-syntax/migrated_0138/actual.js new file mode 100644 index 0000000000..fcefec567e --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0138/actual.js @@ -0,0 +1 @@ +const x = 12, y; diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0138/expected.json b/test/fixtures/esprima/invalid-syntax/migrated_0138/expected.json new file mode 100644 index 0000000000..b5b53bc87a --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0138/expected.json @@ -0,0 +1,132 @@ +{ + "type": "File", + "start": 0, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "sourceType": "script", + "body": [ + { + "type": "VariableDeclaration", + "start": 0, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 6, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "id": { + "type": "Identifier", + "start": 6, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "name": "x" + }, + "init": { + "type": "Literal", + "start": 10, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "value": 12, + "rawValue": 12, + "raw": "12" + } + }, + { + "type": "VariableDeclarator", + "start": 14, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 14 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "id": { + "type": "Identifier", + "start": 14, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 14 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "name": "y" + }, + "init": null + } + ], + "kind": "var" + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0138/options.json b/test/fixtures/esprima/invalid-syntax/migrated_0138/options.json new file mode 100644 index 0000000000..7ca1e1ffbb --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0138/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Unexpected token (1:15)" +} \ No newline at end of file diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0139/actual.js b/test/fixtures/esprima/invalid-syntax/migrated_0139/actual.js new file mode 100644 index 0000000000..147d061751 --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0139/actual.js @@ -0,0 +1 @@ +const x, y = 12; diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0139/expected.json b/test/fixtures/esprima/invalid-syntax/migrated_0139/expected.json new file mode 100644 index 0000000000..0d296d31a9 --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0139/expected.json @@ -0,0 +1,132 @@ +{ + "type": "File", + "start": 0, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "sourceType": "script", + "body": [ + { + "type": "VariableDeclaration", + "start": 0, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 6, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "id": { + "type": "Identifier", + "start": 6, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "name": "x" + }, + "init": null + }, + { + "type": "VariableDeclarator", + "start": 9, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "id": { + "type": "Identifier", + "start": 9, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "name": "y" + }, + "init": { + "type": "Literal", + "start": 13, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "value": 12, + "rawValue": 12, + "raw": "12" + } + } + ], + "kind": "var" + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0139/options.json b/test/fixtures/esprima/invalid-syntax/migrated_0139/options.json new file mode 100644 index 0000000000..167116741e --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0139/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Unexpected token (1:7)" +} \ No newline at end of file diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0140/actual.js b/test/fixtures/esprima/invalid-syntax/migrated_0140/actual.js new file mode 100644 index 0000000000..59607d92f5 --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0140/actual.js @@ -0,0 +1 @@ +const x; diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0140/expected.json b/test/fixtures/esprima/invalid-syntax/migrated_0140/expected.json new file mode 100644 index 0000000000..cc88fe2b7e --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0140/expected.json @@ -0,0 +1,83 @@ +{ + "type": "File", + "start": 0, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "sourceType": "script", + "body": [ + { + "type": "VariableDeclaration", + "start": 0, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 6, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "id": { + "type": "Identifier", + "start": 6, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "name": "x" + }, + "init": null + } + ], + "kind": "var" + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0140/options.json b/test/fixtures/esprima/invalid-syntax/migrated_0140/options.json new file mode 100644 index 0000000000..167116741e --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0140/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Unexpected token (1:7)" +} \ No newline at end of file diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0141/actual.js b/test/fixtures/esprima/invalid-syntax/migrated_0141/actual.js new file mode 100644 index 0000000000..4e5970dfdc --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0141/actual.js @@ -0,0 +1 @@ +if(true) let a = 1; diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0141/options.json b/test/fixtures/esprima/invalid-syntax/migrated_0141/options.json new file mode 100644 index 0000000000..93db7641c7 --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0141/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Unexpected token (1:9)" +} \ No newline at end of file diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0142/actual.js b/test/fixtures/esprima/invalid-syntax/migrated_0142/actual.js new file mode 100644 index 0000000000..6f01bff4f3 --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0142/actual.js @@ -0,0 +1 @@ +if(true) const a = 1; diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0142/options.json b/test/fixtures/esprima/invalid-syntax/migrated_0142/options.json new file mode 100644 index 0000000000..93db7641c7 --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0142/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Unexpected token (1:9)" +} \ No newline at end of file diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0143/actual.js b/test/fixtures/esprima/invalid-syntax/migrated_0143/actual.js new file mode 100644 index 0000000000..93f1fa378c --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0143/actual.js @@ -0,0 +1 @@ +switch (c) { default: default: } diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0143/options.json b/test/fixtures/esprima/invalid-syntax/migrated_0143/options.json new file mode 100644 index 0000000000..8ded4af443 --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0143/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Multiple default clauses (1:22)" +} \ No newline at end of file diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0144/actual.js b/test/fixtures/esprima/invalid-syntax/migrated_0144/actual.js new file mode 100644 index 0000000000..597bda3644 --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0144/actual.js @@ -0,0 +1 @@ +new X()."s" diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0144/options.json b/test/fixtures/esprima/invalid-syntax/migrated_0144/options.json new file mode 100644 index 0000000000..65ef4a184a --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0144/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Unexpected token (1:8)" +} \ No newline at end of file diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0145/actual.js b/test/fixtures/esprima/invalid-syntax/migrated_0145/actual.js new file mode 100644 index 0000000000..33662f5545 --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0145/actual.js @@ -0,0 +1 @@ +/* diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0145/options.json b/test/fixtures/esprima/invalid-syntax/migrated_0145/options.json new file mode 100644 index 0000000000..228eff80e8 --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0145/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Unterminated comment (1:0)" +} \ No newline at end of file diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0146/actual.js b/test/fixtures/esprima/invalid-syntax/migrated_0146/actual.js new file mode 100644 index 0000000000..33662f5545 --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0146/actual.js @@ -0,0 +1 @@ +/* diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0146/options.json b/test/fixtures/esprima/invalid-syntax/migrated_0146/options.json new file mode 100644 index 0000000000..228eff80e8 --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0146/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Unterminated comment (1:0)" +} \ No newline at end of file diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0147/actual.js b/test/fixtures/esprima/invalid-syntax/migrated_0147/actual.js new file mode 100644 index 0000000000..ad79f5619a --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0147/actual.js @@ -0,0 +1 @@ +/** diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0147/options.json b/test/fixtures/esprima/invalid-syntax/migrated_0147/options.json new file mode 100644 index 0000000000..228eff80e8 --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0147/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Unterminated comment (1:0)" +} \ No newline at end of file diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0148/actual.js b/test/fixtures/esprima/invalid-syntax/migrated_0148/actual.js new file mode 100644 index 0000000000..ffbafd018e --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0148/actual.js @@ -0,0 +1,3 @@ +/* + +* diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0148/options.json b/test/fixtures/esprima/invalid-syntax/migrated_0148/options.json new file mode 100644 index 0000000000..228eff80e8 --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0148/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Unterminated comment (1:0)" +} \ No newline at end of file diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0149/actual.js b/test/fixtures/esprima/invalid-syntax/migrated_0149/actual.js new file mode 100644 index 0000000000..dae851dfe1 --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0149/actual.js @@ -0,0 +1 @@ +/*hello diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0149/options.json b/test/fixtures/esprima/invalid-syntax/migrated_0149/options.json new file mode 100644 index 0000000000..228eff80e8 --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0149/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Unterminated comment (1:0)" +} \ No newline at end of file diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0150/actual.js b/test/fixtures/esprima/invalid-syntax/migrated_0150/actual.js new file mode 100644 index 0000000000..e63adfb071 --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0150/actual.js @@ -0,0 +1 @@ +/*hello * diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0150/options.json b/test/fixtures/esprima/invalid-syntax/migrated_0150/options.json new file mode 100644 index 0000000000..228eff80e8 --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0150/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Unterminated comment (1:0)" +} \ No newline at end of file diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0151/actual.js b/test/fixtures/esprima/invalid-syntax/migrated_0151/actual.js new file mode 100644 index 0000000000..079b5796ef --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0151/actual.js @@ -0,0 +1 @@ +] diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0151/options.json b/test/fixtures/esprima/invalid-syntax/migrated_0151/options.json new file mode 100644 index 0000000000..919c05ec87 --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0151/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Unexpected token (1:0)" +} \ No newline at end of file diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0152/actual.js b/test/fixtures/esprima/invalid-syntax/migrated_0152/actual.js new file mode 100644 index 0000000000..079b5796ef --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0152/actual.js @@ -0,0 +1 @@ +] diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0152/options.json b/test/fixtures/esprima/invalid-syntax/migrated_0152/options.json new file mode 100644 index 0000000000..919c05ec87 --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0152/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Unexpected token (1:0)" +} \ No newline at end of file diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0153/actual.js b/test/fixtures/esprima/invalid-syntax/migrated_0153/actual.js new file mode 100644 index 0000000000..079b5796ef --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0153/actual.js @@ -0,0 +1 @@ +] diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0153/options.json b/test/fixtures/esprima/invalid-syntax/migrated_0153/options.json new file mode 100644 index 0000000000..919c05ec87 --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0153/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Unexpected token (1:0)" +} \ No newline at end of file diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0154/actual.js b/test/fixtures/esprima/invalid-syntax/migrated_0154/actual.js new file mode 100644 index 0000000000..079b5796ef --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0154/actual.js @@ -0,0 +1 @@ +] diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0154/options.json b/test/fixtures/esprima/invalid-syntax/migrated_0154/options.json new file mode 100644 index 0000000000..919c05ec87 --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0154/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Unexpected token (1:0)" +} \ No newline at end of file diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0155/actual.js b/test/fixtures/esprima/invalid-syntax/migrated_0155/actual.js new file mode 100644 index 0000000000..dd8e38b429 --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0155/actual.js @@ -0,0 +1,2 @@ +// +] diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0155/options.json b/test/fixtures/esprima/invalid-syntax/migrated_0155/options.json new file mode 100644 index 0000000000..0361d7c7d2 --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0155/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Unexpected token (2:0)" +} \ No newline at end of file diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0156/actual.js b/test/fixtures/esprima/invalid-syntax/migrated_0156/actual.js new file mode 100644 index 0000000000..b31647414c --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0156/actual.js @@ -0,0 +1,2 @@ +// + ] diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0156/options.json b/test/fixtures/esprima/invalid-syntax/migrated_0156/options.json new file mode 100644 index 0000000000..aa8239233c --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0156/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Unexpected token (3:0)" +} \ No newline at end of file diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0157/actual.js b/test/fixtures/esprima/invalid-syntax/migrated_0157/actual.js new file mode 100644 index 0000000000..bdad89d19c --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0157/actual.js @@ -0,0 +1,2 @@ +/a\ +/ diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0157/options.json b/test/fixtures/esprima/invalid-syntax/migrated_0157/options.json new file mode 100644 index 0000000000..e07b72599f --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0157/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Unterminated regular expression (1:1)" +} \ No newline at end of file diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0158/actual.js b/test/fixtures/esprima/invalid-syntax/migrated_0158/actual.js new file mode 100644 index 0000000000..6e011fcd2d --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0158/actual.js @@ -0,0 +1,2 @@ +// +] diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0158/options.json b/test/fixtures/esprima/invalid-syntax/migrated_0158/options.json new file mode 100644 index 0000000000..aa8239233c --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0158/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Unexpected token (3:0)" +} \ No newline at end of file diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0159/actual.js b/test/fixtures/esprima/invalid-syntax/migrated_0159/actual.js new file mode 100644 index 0000000000..583aa13ef8 --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0159/actual.js @@ -0,0 +1,2 @@ +/* +*/] diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0159/options.json b/test/fixtures/esprima/invalid-syntax/migrated_0159/options.json new file mode 100644 index 0000000000..0b22a698d6 --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0159/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Unexpected token (2:2)" +} \ No newline at end of file diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0160/actual.js b/test/fixtures/esprima/invalid-syntax/migrated_0160/actual.js new file mode 100644 index 0000000000..038a61d463 --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0160/actual.js @@ -0,0 +1,2 @@ +/* + */] diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0160/options.json b/test/fixtures/esprima/invalid-syntax/migrated_0160/options.json new file mode 100644 index 0000000000..02c5500083 --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0160/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Unexpected token (3:2)" +} \ No newline at end of file diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0161/actual.js b/test/fixtures/esprima/invalid-syntax/migrated_0161/actual.js new file mode 100644 index 0000000000..1a12d8e361 --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0161/actual.js @@ -0,0 +1,2 @@ +/* +*/] diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0161/options.json b/test/fixtures/esprima/invalid-syntax/migrated_0161/options.json new file mode 100644 index 0000000000..02c5500083 --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0161/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Unexpected token (3:2)" +} \ No newline at end of file diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0162/actual.js b/test/fixtures/esprima/invalid-syntax/migrated_0162/actual.js new file mode 100644 index 0000000000..adcf3cef43 --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0162/actual.js @@ -0,0 +1 @@ +\\ diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0162/options.json b/test/fixtures/esprima/invalid-syntax/migrated_0162/options.json new file mode 100644 index 0000000000..c5a8baf2b8 --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0162/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Expecting Unicode escape sequence \\uXXXX (1:1)" +} \ No newline at end of file diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0163/actual.js b/test/fixtures/esprima/invalid-syntax/migrated_0163/actual.js new file mode 100644 index 0000000000..cd1103629d --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0163/actual.js @@ -0,0 +1 @@ +var source = '\\u005c'; diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0163/expected.json b/test/fixtures/esprima/invalid-syntax/migrated_0163/expected.json new file mode 100644 index 0000000000..e3f4ea1270 --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0163/expected.json @@ -0,0 +1,100 @@ +{ + "type": "File", + "start": 0, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "sourceType": "script", + "body": [ + { + "type": "VariableDeclaration", + "start": 0, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 4, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "id": { + "type": "Identifier", + "start": 4, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "name": "source" + }, + "init": { + "type": "Literal", + "start": 13, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "value": "\\u005c", + "rawValue": "\\u005c", + "raw": "'\\\\u005c'" + } + } + ], + "kind": "var" + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0163/options.json b/test/fixtures/esprima/invalid-syntax/migrated_0163/options.json new file mode 100644 index 0000000000..167116741e --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0163/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Unexpected token (1:7)" +} \ No newline at end of file diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0164/actual.js b/test/fixtures/esprima/invalid-syntax/migrated_0164/actual.js new file mode 100644 index 0000000000..2c955a68ab --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0164/actual.js @@ -0,0 +1 @@ +\x diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0164/options.json b/test/fixtures/esprima/invalid-syntax/migrated_0164/options.json new file mode 100644 index 0000000000..c5a8baf2b8 --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0164/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Expecting Unicode escape sequence \\uXXXX (1:1)" +} \ No newline at end of file diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0165/actual.js b/test/fixtures/esprima/invalid-syntax/migrated_0165/actual.js new file mode 100644 index 0000000000..aa31feb7ec --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0165/actual.js @@ -0,0 +1 @@ +var source = '\\u0000'; diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0165/expected.json b/test/fixtures/esprima/invalid-syntax/migrated_0165/expected.json new file mode 100644 index 0000000000..968d4f6a66 --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0165/expected.json @@ -0,0 +1,100 @@ +{ + "type": "File", + "start": 0, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "sourceType": "script", + "body": [ + { + "type": "VariableDeclaration", + "start": 0, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 4, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "id": { + "type": "Identifier", + "start": 4, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "name": "source" + }, + "init": { + "type": "Literal", + "start": 13, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "value": "\\u0000", + "rawValue": "\\u0000", + "raw": "'\\\\u0000'" + } + } + ], + "kind": "var" + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0165/options.json b/test/fixtures/esprima/invalid-syntax/migrated_0165/options.json new file mode 100644 index 0000000000..167116741e --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0165/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Unexpected token (1:7)" +} \ No newline at end of file diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0166/actual.js b/test/fixtures/esprima/invalid-syntax/migrated_0166/actual.js new file mode 100644 index 0000000000..29a288bee4 --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0166/actual.js @@ -0,0 +1 @@ +var source = '\u200C = []'; diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0166/expected.json b/test/fixtures/esprima/invalid-syntax/migrated_0166/expected.json new file mode 100644 index 0000000000..f9b68dd718 --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0166/expected.json @@ -0,0 +1,100 @@ +{ + "type": "File", + "start": 0, + "end": 27, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 27 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 27, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 27 + } + }, + "sourceType": "script", + "body": [ + { + "type": "VariableDeclaration", + "start": 0, + "end": 27, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 27 + } + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 4, + "end": 26, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 26 + } + }, + "id": { + "type": "Identifier", + "start": 4, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "name": "source" + }, + "init": { + "type": "Literal", + "start": 13, + "end": 26, + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 1, + "column": 26 + } + }, + "value": "‌ = []", + "rawValue": "‌ = []", + "raw": "'\\u200C = []'" + } + } + ], + "kind": "var" + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0166/options.json b/test/fixtures/esprima/invalid-syntax/migrated_0166/options.json new file mode 100644 index 0000000000..04b967a2ee --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0166/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Unexpected token (1:1)" +} \ No newline at end of file diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0167/actual.js b/test/fixtures/esprima/invalid-syntax/migrated_0167/actual.js new file mode 100644 index 0000000000..ec9a56e78c --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0167/actual.js @@ -0,0 +1 @@ +var source = '\u200D = []'; diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0167/expected.json b/test/fixtures/esprima/invalid-syntax/migrated_0167/expected.json new file mode 100644 index 0000000000..238759889e --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0167/expected.json @@ -0,0 +1,100 @@ +{ + "type": "File", + "start": 0, + "end": 27, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 27 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 27, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 27 + } + }, + "sourceType": "script", + "body": [ + { + "type": "VariableDeclaration", + "start": 0, + "end": 27, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 27 + } + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 4, + "end": 26, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 26 + } + }, + "id": { + "type": "Identifier", + "start": 4, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "name": "source" + }, + "init": { + "type": "Literal", + "start": 13, + "end": 26, + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 1, + "column": 26 + } + }, + "value": "‍ = []", + "rawValue": "‍ = []", + "raw": "'\\u200D = []'" + } + } + ], + "kind": "var" + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0167/options.json b/test/fixtures/esprima/invalid-syntax/migrated_0167/options.json new file mode 100644 index 0000000000..04b967a2ee --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0167/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Unexpected token (1:1)" +} \ No newline at end of file diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0168/actual.js b/test/fixtures/esprima/invalid-syntax/migrated_0168/actual.js new file mode 100644 index 0000000000..032d059cb6 --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0168/actual.js @@ -0,0 +1 @@ +"\ diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0168/options.json b/test/fixtures/esprima/invalid-syntax/migrated_0168/options.json new file mode 100644 index 0000000000..a760565b1b --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0168/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Unterminated string constant (1:0)" +} \ No newline at end of file diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0169/actual.js b/test/fixtures/esprima/invalid-syntax/migrated_0169/actual.js new file mode 100644 index 0000000000..481ef9c808 --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0169/actual.js @@ -0,0 +1 @@ +var source = '"\\u'; diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0169/expected.json b/test/fixtures/esprima/invalid-syntax/migrated_0169/expected.json new file mode 100644 index 0000000000..5dcccc5d34 --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0169/expected.json @@ -0,0 +1,100 @@ +{ + "type": "File", + "start": 0, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "sourceType": "script", + "body": [ + { + "type": "VariableDeclaration", + "start": 0, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 4, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 19 + } + }, + "id": { + "type": "Identifier", + "start": 4, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "name": "source" + }, + "init": { + "type": "Literal", + "start": 13, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 1, + "column": 19 + } + }, + "value": "\"\\u", + "rawValue": "\"\\u", + "raw": "'\"\\\\u'" + } + } + ], + "kind": "var" + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0169/options.json b/test/fixtures/esprima/invalid-syntax/migrated_0169/options.json new file mode 100644 index 0000000000..9f7910a413 --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0169/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Unexpected token (1:4)" +} \ No newline at end of file diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0170/actual.js b/test/fixtures/esprima/invalid-syntax/migrated_0170/actual.js new file mode 100644 index 0000000000..ecabda4f10 --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0170/actual.js @@ -0,0 +1 @@ +try { } catch() {} diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0170/options.json b/test/fixtures/esprima/invalid-syntax/migrated_0170/options.json new file mode 100644 index 0000000000..51c483f3d3 --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0170/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Unexpected token (1:14)" +} \ No newline at end of file diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0171/actual.js b/test/fixtures/esprima/invalid-syntax/migrated_0171/actual.js new file mode 100644 index 0000000000..a09c86384f --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0171/actual.js @@ -0,0 +1 @@ +return diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0171/options.json b/test/fixtures/esprima/invalid-syntax/migrated_0171/options.json new file mode 100644 index 0000000000..dececd0e83 --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0171/options.json @@ -0,0 +1,3 @@ +{ + "throws": "'return' outside of function (1:0)" +} \ No newline at end of file diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0172/actual.js b/test/fixtures/esprima/invalid-syntax/migrated_0172/actual.js new file mode 100644 index 0000000000..bf3fdcd662 --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0172/actual.js @@ -0,0 +1 @@ +break diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0172/options.json b/test/fixtures/esprima/invalid-syntax/migrated_0172/options.json new file mode 100644 index 0000000000..6ccbfe923d --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0172/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Unsyntactic break (1:0)" +} \ No newline at end of file diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0173/actual.js b/test/fixtures/esprima/invalid-syntax/migrated_0173/actual.js new file mode 100644 index 0000000000..44c5d7d65e --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0173/actual.js @@ -0,0 +1 @@ +continue diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0173/options.json b/test/fixtures/esprima/invalid-syntax/migrated_0173/options.json new file mode 100644 index 0000000000..14a50290d0 --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0173/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Unsyntactic continue (1:0)" +} \ No newline at end of file diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0174/actual.js b/test/fixtures/esprima/invalid-syntax/migrated_0174/actual.js new file mode 100644 index 0000000000..a586b85c82 --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0174/actual.js @@ -0,0 +1 @@ +switch (x) { default: continue; } diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0174/options.json b/test/fixtures/esprima/invalid-syntax/migrated_0174/options.json new file mode 100644 index 0000000000..332366a21c --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0174/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Unsyntactic continue (1:22)" +} \ No newline at end of file diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0175/actual.js b/test/fixtures/esprima/invalid-syntax/migrated_0175/actual.js new file mode 100644 index 0000000000..6cffa7b720 --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0175/actual.js @@ -0,0 +1 @@ +do { x } * diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0175/options.json b/test/fixtures/esprima/invalid-syntax/migrated_0175/options.json new file mode 100644 index 0000000000..93db7641c7 --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0175/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Unexpected token (1:9)" +} \ No newline at end of file diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0176/actual.js b/test/fixtures/esprima/invalid-syntax/migrated_0176/actual.js new file mode 100644 index 0000000000..8c1c0d5511 --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0176/actual.js @@ -0,0 +1 @@ +while (true) { break x; } diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0176/options.json b/test/fixtures/esprima/invalid-syntax/migrated_0176/options.json new file mode 100644 index 0000000000..33bf5f84b8 --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0176/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Unsyntactic break (1:15)" +} \ No newline at end of file diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0177/actual.js b/test/fixtures/esprima/invalid-syntax/migrated_0177/actual.js new file mode 100644 index 0000000000..0764ef527f --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0177/actual.js @@ -0,0 +1 @@ +while (true) { continue x; } diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0177/options.json b/test/fixtures/esprima/invalid-syntax/migrated_0177/options.json new file mode 100644 index 0000000000..e75cfed858 --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0177/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Unsyntactic continue (1:15)" +} \ No newline at end of file diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0178/actual.js b/test/fixtures/esprima/invalid-syntax/migrated_0178/actual.js new file mode 100644 index 0000000000..b404785be3 --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0178/actual.js @@ -0,0 +1 @@ +x: while (true) { (function () { break x; }); } diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0178/options.json b/test/fixtures/esprima/invalid-syntax/migrated_0178/options.json new file mode 100644 index 0000000000..8008848be3 --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0178/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Unsyntactic break (1:33)" +} \ No newline at end of file diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0179/actual.js b/test/fixtures/esprima/invalid-syntax/migrated_0179/actual.js new file mode 100644 index 0000000000..c2f322687c --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0179/actual.js @@ -0,0 +1 @@ +x: while (true) { (function () { continue x; }); } diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0179/options.json b/test/fixtures/esprima/invalid-syntax/migrated_0179/options.json new file mode 100644 index 0000000000..f0faa7faaa --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0179/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Unsyntactic continue (1:33)" +} \ No newline at end of file diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0180/actual.js b/test/fixtures/esprima/invalid-syntax/migrated_0180/actual.js new file mode 100644 index 0000000000..af82a69c63 --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0180/actual.js @@ -0,0 +1 @@ +x: while (true) { (function () { break; }); } diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0180/options.json b/test/fixtures/esprima/invalid-syntax/migrated_0180/options.json new file mode 100644 index 0000000000..8008848be3 --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0180/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Unsyntactic break (1:33)" +} \ No newline at end of file diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0181/actual.js b/test/fixtures/esprima/invalid-syntax/migrated_0181/actual.js new file mode 100644 index 0000000000..3e0d6d7a29 --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0181/actual.js @@ -0,0 +1 @@ +x: while (true) { (function () { continue; }); } diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0181/options.json b/test/fixtures/esprima/invalid-syntax/migrated_0181/options.json new file mode 100644 index 0000000000..f0faa7faaa --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0181/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Unsyntactic continue (1:33)" +} \ No newline at end of file diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0182/actual.js b/test/fixtures/esprima/invalid-syntax/migrated_0182/actual.js new file mode 100644 index 0000000000..f7285406ee --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0182/actual.js @@ -0,0 +1 @@ +x: while (true) { x: while (true) { } } diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0182/options.json b/test/fixtures/esprima/invalid-syntax/migrated_0182/options.json new file mode 100644 index 0000000000..a430baffb5 --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0182/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Label 'x' is already declared (1:18)" +} \ No newline at end of file diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0183/actual.js b/test/fixtures/esprima/invalid-syntax/migrated_0183/actual.js new file mode 100644 index 0000000000..8da08f63cf --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0183/actual.js @@ -0,0 +1 @@ +(function () { 'use strict'; delete i; }()) diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0183/options.json b/test/fixtures/esprima/invalid-syntax/migrated_0183/options.json new file mode 100644 index 0000000000..8112470453 --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0183/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Deleting local variable in strict mode (1:29)" +} \ No newline at end of file diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0184/actual.js b/test/fixtures/esprima/invalid-syntax/migrated_0184/actual.js new file mode 100644 index 0000000000..83f5153160 --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0184/actual.js @@ -0,0 +1 @@ +(function () { 'use strict'; with (i); }()) diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0184/options.json b/test/fixtures/esprima/invalid-syntax/migrated_0184/options.json new file mode 100644 index 0000000000..1b86ef2104 --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0184/options.json @@ -0,0 +1,3 @@ +{ + "throws": "'with' in strict mode (1:29)" +} \ No newline at end of file diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0185/actual.js b/test/fixtures/esprima/invalid-syntax/migrated_0185/actual.js new file mode 100644 index 0000000000..3da2a6ce2f --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0185/actual.js @@ -0,0 +1 @@ +function hello() {'use strict'; var eval = 10; } diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0185/options.json b/test/fixtures/esprima/invalid-syntax/migrated_0185/options.json new file mode 100644 index 0000000000..0e72c82fe8 --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0185/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Binding eval in strict mode (1:36)" +} \ No newline at end of file diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0186/actual.js b/test/fixtures/esprima/invalid-syntax/migrated_0186/actual.js new file mode 100644 index 0000000000..317faa2c4b --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0186/actual.js @@ -0,0 +1 @@ +function hello() {'use strict'; var arguments = 10; } diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0186/options.json b/test/fixtures/esprima/invalid-syntax/migrated_0186/options.json new file mode 100644 index 0000000000..f171e1b2c8 --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0186/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Binding arguments in strict mode (1:36)" +} \ No newline at end of file diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0187/actual.js b/test/fixtures/esprima/invalid-syntax/migrated_0187/actual.js new file mode 100644 index 0000000000..414967c2aa --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0187/actual.js @@ -0,0 +1 @@ +function hello() {'use strict'; try { } catch (eval) { } } diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0187/options.json b/test/fixtures/esprima/invalid-syntax/migrated_0187/options.json new file mode 100644 index 0000000000..52cc5e0c10 --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0187/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Binding eval in strict mode (1:47)" +} \ No newline at end of file diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0188/actual.js b/test/fixtures/esprima/invalid-syntax/migrated_0188/actual.js new file mode 100644 index 0000000000..99e1121230 --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0188/actual.js @@ -0,0 +1 @@ +function hello() {'use strict'; try { } catch (arguments) { } } diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0188/options.json b/test/fixtures/esprima/invalid-syntax/migrated_0188/options.json new file mode 100644 index 0000000000..1c09320e14 --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0188/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Binding arguments in strict mode (1:47)" +} \ No newline at end of file diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0189/actual.js b/test/fixtures/esprima/invalid-syntax/migrated_0189/actual.js new file mode 100644 index 0000000000..473b0eb964 --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0189/actual.js @@ -0,0 +1 @@ +function hello() {'use strict'; eval = 10; } diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0189/options.json b/test/fixtures/esprima/invalid-syntax/migrated_0189/options.json new file mode 100644 index 0000000000..e606855bd2 --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0189/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Assigning to eval in strict mode (1:32)" +} \ No newline at end of file diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0190/actual.js b/test/fixtures/esprima/invalid-syntax/migrated_0190/actual.js new file mode 100644 index 0000000000..4fca40040b --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0190/actual.js @@ -0,0 +1 @@ +function hello() {'use strict'; arguments = 10; } diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0190/options.json b/test/fixtures/esprima/invalid-syntax/migrated_0190/options.json new file mode 100644 index 0000000000..d66800268f --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0190/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Assigning to arguments in strict mode (1:32)" +} \ No newline at end of file diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0191/actual.js b/test/fixtures/esprima/invalid-syntax/migrated_0191/actual.js new file mode 100644 index 0000000000..9476f553f4 --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0191/actual.js @@ -0,0 +1 @@ +function hello() {'use strict'; ++eval; } diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0191/options.json b/test/fixtures/esprima/invalid-syntax/migrated_0191/options.json new file mode 100644 index 0000000000..194b27c0a0 --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0191/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Assigning to eval in strict mode (1:34)" +} \ No newline at end of file diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0192/actual.js b/test/fixtures/esprima/invalid-syntax/migrated_0192/actual.js new file mode 100644 index 0000000000..b19aafdefe --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0192/actual.js @@ -0,0 +1 @@ +function hello() {'use strict'; --eval; } diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0192/options.json b/test/fixtures/esprima/invalid-syntax/migrated_0192/options.json new file mode 100644 index 0000000000..194b27c0a0 --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0192/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Assigning to eval in strict mode (1:34)" +} \ No newline at end of file diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0193/actual.js b/test/fixtures/esprima/invalid-syntax/migrated_0193/actual.js new file mode 100644 index 0000000000..e9604fa799 --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0193/actual.js @@ -0,0 +1 @@ +function hello() {'use strict'; ++arguments; } diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0193/options.json b/test/fixtures/esprima/invalid-syntax/migrated_0193/options.json new file mode 100644 index 0000000000..fa7fd234e5 --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0193/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Assigning to arguments in strict mode (1:34)" +} \ No newline at end of file diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0194/actual.js b/test/fixtures/esprima/invalid-syntax/migrated_0194/actual.js new file mode 100644 index 0000000000..d13dfec134 --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0194/actual.js @@ -0,0 +1 @@ +function hello() {'use strict'; --arguments; } diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0194/options.json b/test/fixtures/esprima/invalid-syntax/migrated_0194/options.json new file mode 100644 index 0000000000..fa7fd234e5 --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0194/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Assigning to arguments in strict mode (1:34)" +} \ No newline at end of file diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0195/actual.js b/test/fixtures/esprima/invalid-syntax/migrated_0195/actual.js new file mode 100644 index 0000000000..13f1fda122 --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0195/actual.js @@ -0,0 +1 @@ +function hello() {'use strict'; eval++; } diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0195/options.json b/test/fixtures/esprima/invalid-syntax/migrated_0195/options.json new file mode 100644 index 0000000000..e606855bd2 --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0195/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Assigning to eval in strict mode (1:32)" +} \ No newline at end of file diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0196/actual.js b/test/fixtures/esprima/invalid-syntax/migrated_0196/actual.js new file mode 100644 index 0000000000..3376981d90 --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0196/actual.js @@ -0,0 +1 @@ +function hello() {'use strict'; eval--; } diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0196/options.json b/test/fixtures/esprima/invalid-syntax/migrated_0196/options.json new file mode 100644 index 0000000000..e606855bd2 --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0196/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Assigning to eval in strict mode (1:32)" +} \ No newline at end of file diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0197/actual.js b/test/fixtures/esprima/invalid-syntax/migrated_0197/actual.js new file mode 100644 index 0000000000..a15d29e178 --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0197/actual.js @@ -0,0 +1 @@ +function hello() {'use strict'; arguments++; } diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0197/options.json b/test/fixtures/esprima/invalid-syntax/migrated_0197/options.json new file mode 100644 index 0000000000..d66800268f --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0197/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Assigning to arguments in strict mode (1:32)" +} \ No newline at end of file diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0198/actual.js b/test/fixtures/esprima/invalid-syntax/migrated_0198/actual.js new file mode 100644 index 0000000000..85bdb41f7f --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0198/actual.js @@ -0,0 +1 @@ +function hello() {'use strict'; arguments--; } diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0198/options.json b/test/fixtures/esprima/invalid-syntax/migrated_0198/options.json new file mode 100644 index 0000000000..d66800268f --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0198/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Assigning to arguments in strict mode (1:32)" +} \ No newline at end of file diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0199/actual.js b/test/fixtures/esprima/invalid-syntax/migrated_0199/actual.js new file mode 100644 index 0000000000..63383f2064 --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0199/actual.js @@ -0,0 +1 @@ +function hello() {'use strict'; function eval() { } } diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0199/options.json b/test/fixtures/esprima/invalid-syntax/migrated_0199/options.json new file mode 100644 index 0000000000..74aee2c177 --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0199/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Binding eval in strict mode (1:41)" +} \ No newline at end of file diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0200/actual.js b/test/fixtures/esprima/invalid-syntax/migrated_0200/actual.js new file mode 100644 index 0000000000..9ded5a17a2 --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0200/actual.js @@ -0,0 +1 @@ +function hello() {'use strict'; function arguments() { } } diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0200/options.json b/test/fixtures/esprima/invalid-syntax/migrated_0200/options.json new file mode 100644 index 0000000000..cb4087319e --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0200/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Binding arguments in strict mode (1:41)" +} \ No newline at end of file diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0201/actual.js b/test/fixtures/esprima/invalid-syntax/migrated_0201/actual.js new file mode 100644 index 0000000000..5fbe3c38ee --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0201/actual.js @@ -0,0 +1 @@ +function eval() {'use strict'; } diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0201/expected.json b/test/fixtures/esprima/invalid-syntax/migrated_0201/expected.json new file mode 100644 index 0000000000..c110e76a57 --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0201/expected.json @@ -0,0 +1,117 @@ +{ + "type": "File", + "start": 0, + "end": 32, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 32 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 32, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 32 + } + }, + "sourceType": "script", + "body": [ + { + "type": "FunctionDeclaration", + "start": 0, + "end": 32, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 32 + } + }, + "id": { + "type": "Identifier", + "start": 9, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "name": "eval" + }, + "generator": false, + "expression": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 16, + "end": 32, + "loc": { + "start": { + "line": 1, + "column": 16 + }, + "end": { + "line": 1, + "column": 32 + } + }, + "body": [ + { + "type": "ExpressionStatement", + "start": 17, + "end": 30, + "loc": { + "start": { + "line": 1, + "column": 17 + }, + "end": { + "line": 1, + "column": 30 + } + }, + "expression": { + "type": "Literal", + "start": 17, + "end": 29, + "loc": { + "start": { + "line": 1, + "column": 17 + }, + "end": { + "line": 1, + "column": 29 + } + }, + "value": "use strict", + "rawValue": "use strict", + "raw": "'use strict'" + } + } + ] + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0201/options.json b/test/fixtures/esprima/invalid-syntax/migrated_0201/options.json new file mode 100644 index 0000000000..a49374fb46 --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0201/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Binding eval in strict mode (1:9)" +} \ No newline at end of file diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0202/actual.js b/test/fixtures/esprima/invalid-syntax/migrated_0202/actual.js new file mode 100644 index 0000000000..a849a16ce4 --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0202/actual.js @@ -0,0 +1 @@ +function arguments() {'use strict'; } diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0202/expected.json b/test/fixtures/esprima/invalid-syntax/migrated_0202/expected.json new file mode 100644 index 0000000000..817f907aee --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0202/expected.json @@ -0,0 +1,117 @@ +{ + "type": "File", + "start": 0, + "end": 37, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 37 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 37, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 37 + } + }, + "sourceType": "script", + "body": [ + { + "type": "FunctionDeclaration", + "start": 0, + "end": 37, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 37 + } + }, + "id": { + "type": "Identifier", + "start": 9, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "name": "arguments" + }, + "generator": false, + "expression": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 21, + "end": 37, + "loc": { + "start": { + "line": 1, + "column": 21 + }, + "end": { + "line": 1, + "column": 37 + } + }, + "body": [ + { + "type": "ExpressionStatement", + "start": 22, + "end": 35, + "loc": { + "start": { + "line": 1, + "column": 22 + }, + "end": { + "line": 1, + "column": 35 + } + }, + "expression": { + "type": "Literal", + "start": 22, + "end": 34, + "loc": { + "start": { + "line": 1, + "column": 22 + }, + "end": { + "line": 1, + "column": 34 + } + }, + "value": "use strict", + "rawValue": "use strict", + "raw": "'use strict'" + } + } + ] + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0202/options.json b/test/fixtures/esprima/invalid-syntax/migrated_0202/options.json new file mode 100644 index 0000000000..8a3871a0d1 --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0202/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Binding arguments in strict mode (1:9)" +} \ No newline at end of file diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0203/actual.js b/test/fixtures/esprima/invalid-syntax/migrated_0203/actual.js new file mode 100644 index 0000000000..1a911e9452 --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0203/actual.js @@ -0,0 +1 @@ +function hello() {'use strict'; (function eval() { }()) } diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0203/options.json b/test/fixtures/esprima/invalid-syntax/migrated_0203/options.json new file mode 100644 index 0000000000..9c41225e97 --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0203/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Binding eval in strict mode (1:42)" +} \ No newline at end of file diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0204/actual.js b/test/fixtures/esprima/invalid-syntax/migrated_0204/actual.js new file mode 100644 index 0000000000..59c6ac030f --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0204/actual.js @@ -0,0 +1 @@ +function hello() {'use strict'; (function arguments() { }()) } diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0204/options.json b/test/fixtures/esprima/invalid-syntax/migrated_0204/options.json new file mode 100644 index 0000000000..bc7c65ae7b --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0204/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Binding arguments in strict mode (1:42)" +} \ No newline at end of file diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0205/actual.js b/test/fixtures/esprima/invalid-syntax/migrated_0205/actual.js new file mode 100644 index 0000000000..dcdb7294e1 --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0205/actual.js @@ -0,0 +1 @@ +(function eval() {'use strict'; })() diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0205/expected.json b/test/fixtures/esprima/invalid-syntax/migrated_0205/expected.json new file mode 100644 index 0000000000..1a995ca123 --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0205/expected.json @@ -0,0 +1,149 @@ +{ + "type": "File", + "start": 0, + "end": 36, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 36 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 36, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 36 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 36, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 36 + } + }, + "expression": { + "type": "CallExpression", + "start": 0, + "end": 36, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 36 + } + }, + "callee": { + "type": "FunctionExpression", + "start": 1, + "end": 33, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 33 + } + }, + "id": { + "type": "Identifier", + "start": 10, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "name": "eval" + }, + "generator": false, + "expression": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 17, + "end": 33, + "loc": { + "start": { + "line": 1, + "column": 17 + }, + "end": { + "line": 1, + "column": 33 + } + }, + "body": [ + { + "type": "ExpressionStatement", + "start": 18, + "end": 31, + "loc": { + "start": { + "line": 1, + "column": 18 + }, + "end": { + "line": 1, + "column": 31 + } + }, + "expression": { + "type": "Literal", + "start": 18, + "end": 30, + "loc": { + "start": { + "line": 1, + "column": 18 + }, + "end": { + "line": 1, + "column": 30 + } + }, + "value": "use strict", + "rawValue": "use strict", + "raw": "'use strict'" + } + } + ] + }, + "parenthesizedExpression": true + }, + "arguments": [] + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0205/options.json b/test/fixtures/esprima/invalid-syntax/migrated_0205/options.json new file mode 100644 index 0000000000..0dcd2b3e58 --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0205/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Binding eval in strict mode (1:10)" +} \ No newline at end of file diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0206/actual.js b/test/fixtures/esprima/invalid-syntax/migrated_0206/actual.js new file mode 100644 index 0000000000..16037653d0 --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0206/actual.js @@ -0,0 +1 @@ +(function arguments() {'use strict'; })() diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0206/expected.json b/test/fixtures/esprima/invalid-syntax/migrated_0206/expected.json new file mode 100644 index 0000000000..34984de2e0 --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0206/expected.json @@ -0,0 +1,149 @@ +{ + "type": "File", + "start": 0, + "end": 41, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 41 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 41, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 41 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 41, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 41 + } + }, + "expression": { + "type": "CallExpression", + "start": 0, + "end": 41, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 41 + } + }, + "callee": { + "type": "FunctionExpression", + "start": 1, + "end": 38, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 38 + } + }, + "id": { + "type": "Identifier", + "start": 10, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 19 + } + }, + "name": "arguments" + }, + "generator": false, + "expression": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 22, + "end": 38, + "loc": { + "start": { + "line": 1, + "column": 22 + }, + "end": { + "line": 1, + "column": 38 + } + }, + "body": [ + { + "type": "ExpressionStatement", + "start": 23, + "end": 36, + "loc": { + "start": { + "line": 1, + "column": 23 + }, + "end": { + "line": 1, + "column": 36 + } + }, + "expression": { + "type": "Literal", + "start": 23, + "end": 35, + "loc": { + "start": { + "line": 1, + "column": 23 + }, + "end": { + "line": 1, + "column": 35 + } + }, + "value": "use strict", + "rawValue": "use strict", + "raw": "'use strict'" + } + } + ] + }, + "parenthesizedExpression": true + }, + "arguments": [] + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0206/options.json b/test/fixtures/esprima/invalid-syntax/migrated_0206/options.json new file mode 100644 index 0000000000..57ba0014b4 --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0206/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Binding arguments in strict mode (1:10)" +} \ No newline at end of file diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0207/actual.js b/test/fixtures/esprima/invalid-syntax/migrated_0207/actual.js new file mode 100644 index 0000000000..022bc8130c --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0207/actual.js @@ -0,0 +1 @@ +function hello() {'use strict'; ({ s: function eval() { } }); } diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0207/options.json b/test/fixtures/esprima/invalid-syntax/migrated_0207/options.json new file mode 100644 index 0000000000..52cc5e0c10 --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0207/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Binding eval in strict mode (1:47)" +} \ No newline at end of file diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0208/actual.js b/test/fixtures/esprima/invalid-syntax/migrated_0208/actual.js new file mode 100644 index 0000000000..6ff7af500d --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0208/actual.js @@ -0,0 +1 @@ +(function package() {'use strict'; })() diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0208/expected.json b/test/fixtures/esprima/invalid-syntax/migrated_0208/expected.json new file mode 100644 index 0000000000..d0765fadb6 --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0208/expected.json @@ -0,0 +1,149 @@ +{ + "type": "File", + "start": 0, + "end": 39, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 39 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 39, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 39 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 39, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 39 + } + }, + "expression": { + "type": "CallExpression", + "start": 0, + "end": 39, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 39 + } + }, + "callee": { + "type": "FunctionExpression", + "start": 1, + "end": 36, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 36 + } + }, + "id": { + "type": "Identifier", + "start": 10, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "name": "package" + }, + "generator": false, + "expression": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 20, + "end": 36, + "loc": { + "start": { + "line": 1, + "column": 20 + }, + "end": { + "line": 1, + "column": 36 + } + }, + "body": [ + { + "type": "ExpressionStatement", + "start": 21, + "end": 34, + "loc": { + "start": { + "line": 1, + "column": 21 + }, + "end": { + "line": 1, + "column": 34 + } + }, + "expression": { + "type": "Literal", + "start": 21, + "end": 33, + "loc": { + "start": { + "line": 1, + "column": 21 + }, + "end": { + "line": 1, + "column": 33 + } + }, + "value": "use strict", + "rawValue": "use strict", + "raw": "'use strict'" + } + } + ] + }, + "parenthesizedExpression": true + }, + "arguments": [] + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0208/options.json b/test/fixtures/esprima/invalid-syntax/migrated_0208/options.json new file mode 100644 index 0000000000..94e937fa7c --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0208/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Binding package in strict mode (1:10)" +} \ No newline at end of file diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0209/actual.js b/test/fixtures/esprima/invalid-syntax/migrated_0209/actual.js new file mode 100644 index 0000000000..9be1bda833 --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0209/actual.js @@ -0,0 +1 @@ +function hello() {'use strict'; ({ i: 10, set s(eval) { } }); } diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0209/options.json b/test/fixtures/esprima/invalid-syntax/migrated_0209/options.json new file mode 100644 index 0000000000..d6f5d89ca6 --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0209/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Binding eval in strict mode (1:48)" +} \ No newline at end of file diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0210/actual.js b/test/fixtures/esprima/invalid-syntax/migrated_0210/actual.js new file mode 100644 index 0000000000..a8c4c44203 --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0210/actual.js @@ -0,0 +1 @@ +function hello() {'use strict'; ({ set s(eval) { } }); } diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0210/options.json b/test/fixtures/esprima/invalid-syntax/migrated_0210/options.json new file mode 100644 index 0000000000..74aee2c177 --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0210/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Binding eval in strict mode (1:41)" +} \ No newline at end of file diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0211/actual.js b/test/fixtures/esprima/invalid-syntax/migrated_0211/actual.js new file mode 100644 index 0000000000..f5aabcc792 --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0211/actual.js @@ -0,0 +1 @@ +function hello() {'use strict'; ({ s: function s(eval) { } }); } diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0211/options.json b/test/fixtures/esprima/invalid-syntax/migrated_0211/options.json new file mode 100644 index 0000000000..c181de42a2 --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0211/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Binding eval in strict mode (1:49)" +} \ No newline at end of file diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0212/actual.js b/test/fixtures/esprima/invalid-syntax/migrated_0212/actual.js new file mode 100644 index 0000000000..0cbf5e4f14 --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0212/actual.js @@ -0,0 +1 @@ +function hello(eval) {'use strict';} diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0212/expected.json b/test/fixtures/esprima/invalid-syntax/migrated_0212/expected.json new file mode 100644 index 0000000000..6aa54306ed --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0212/expected.json @@ -0,0 +1,134 @@ +{ + "type": "File", + "start": 0, + "end": 36, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 36 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 36, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 36 + } + }, + "sourceType": "script", + "body": [ + { + "type": "FunctionDeclaration", + "start": 0, + "end": 36, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 36 + } + }, + "id": { + "type": "Identifier", + "start": 9, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "name": "hello" + }, + "generator": false, + "expression": false, + "params": [ + { + "type": "Identifier", + "start": 15, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 19 + } + }, + "name": "eval" + } + ], + "body": { + "type": "BlockStatement", + "start": 21, + "end": 36, + "loc": { + "start": { + "line": 1, + "column": 21 + }, + "end": { + "line": 1, + "column": 36 + } + }, + "body": [ + { + "type": "ExpressionStatement", + "start": 22, + "end": 35, + "loc": { + "start": { + "line": 1, + "column": 22 + }, + "end": { + "line": 1, + "column": 35 + } + }, + "expression": { + "type": "Literal", + "start": 22, + "end": 34, + "loc": { + "start": { + "line": 1, + "column": 22 + }, + "end": { + "line": 1, + "column": 34 + } + }, + "value": "use strict", + "rawValue": "use strict", + "raw": "'use strict'" + } + } + ] + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0212/options.json b/test/fixtures/esprima/invalid-syntax/migrated_0212/options.json new file mode 100644 index 0000000000..8de33328ad --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0212/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Binding eval in strict mode (1:15)" +} \ No newline at end of file diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0213/actual.js b/test/fixtures/esprima/invalid-syntax/migrated_0213/actual.js new file mode 100644 index 0000000000..7d75fa5662 --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0213/actual.js @@ -0,0 +1 @@ +function hello(arguments) {'use strict';} diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0213/expected.json b/test/fixtures/esprima/invalid-syntax/migrated_0213/expected.json new file mode 100644 index 0000000000..5fbf9ec4b8 --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0213/expected.json @@ -0,0 +1,134 @@ +{ + "type": "File", + "start": 0, + "end": 41, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 41 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 41, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 41 + } + }, + "sourceType": "script", + "body": [ + { + "type": "FunctionDeclaration", + "start": 0, + "end": 41, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 41 + } + }, + "id": { + "type": "Identifier", + "start": 9, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "name": "hello" + }, + "generator": false, + "expression": false, + "params": [ + { + "type": "Identifier", + "start": 15, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 24 + } + }, + "name": "arguments" + } + ], + "body": { + "type": "BlockStatement", + "start": 26, + "end": 41, + "loc": { + "start": { + "line": 1, + "column": 26 + }, + "end": { + "line": 1, + "column": 41 + } + }, + "body": [ + { + "type": "ExpressionStatement", + "start": 27, + "end": 40, + "loc": { + "start": { + "line": 1, + "column": 27 + }, + "end": { + "line": 1, + "column": 40 + } + }, + "expression": { + "type": "Literal", + "start": 27, + "end": 39, + "loc": { + "start": { + "line": 1, + "column": 27 + }, + "end": { + "line": 1, + "column": 39 + } + }, + "value": "use strict", + "rawValue": "use strict", + "raw": "'use strict'" + } + } + ] + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0213/options.json b/test/fixtures/esprima/invalid-syntax/migrated_0213/options.json new file mode 100644 index 0000000000..e2b36a2437 --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0213/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Binding arguments in strict mode (1:15)" +} \ No newline at end of file diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0214/actual.js b/test/fixtures/esprima/invalid-syntax/migrated_0214/actual.js new file mode 100644 index 0000000000..25ed54273b --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0214/actual.js @@ -0,0 +1 @@ +function hello() { 'use strict'; function inner(eval) {} } diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0214/options.json b/test/fixtures/esprima/invalid-syntax/migrated_0214/options.json new file mode 100644 index 0000000000..d6f5d89ca6 --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0214/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Binding eval in strict mode (1:48)" +} \ No newline at end of file diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0215/actual.js b/test/fixtures/esprima/invalid-syntax/migrated_0215/actual.js new file mode 100644 index 0000000000..2862cd1587 --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0215/actual.js @@ -0,0 +1 @@ +function hello() { 'use strict'; function inner(arguments) {} } diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0215/options.json b/test/fixtures/esprima/invalid-syntax/migrated_0215/options.json new file mode 100644 index 0000000000..8ee11e66ca --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0215/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Binding arguments in strict mode (1:48)" +} \ No newline at end of file diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0216/actual.js b/test/fixtures/esprima/invalid-syntax/migrated_0216/actual.js new file mode 100644 index 0000000000..23a8ca47f5 --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0216/actual.js @@ -0,0 +1 @@ +"\1"; 'use strict'; diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0216/expected.json b/test/fixtures/esprima/invalid-syntax/migrated_0216/expected.json new file mode 100644 index 0000000000..77fb11145f --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0216/expected.json @@ -0,0 +1,99 @@ +{ + "type": "File", + "start": 0, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 19 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 19 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "expression": { + "type": "Literal", + "start": 0, + "end": 4, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 4 + } + }, + "value": "\u0001", + "rawValue": "\u0001", + "raw": "\"\\1\"" + } + }, + { + "type": "ExpressionStatement", + "start": 6, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 19 + } + }, + "expression": { + "type": "Literal", + "start": 6, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "value": "use strict", + "rawValue": "use strict", + "raw": "'use strict'" + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0216/options.json b/test/fixtures/esprima/invalid-syntax/migrated_0216/options.json new file mode 100644 index 0000000000..e68fbb6aec --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0216/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Unexpected token (1:2)" +} \ No newline at end of file diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0217/actual.js b/test/fixtures/esprima/invalid-syntax/migrated_0217/actual.js new file mode 100644 index 0000000000..1f718ed734 --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0217/actual.js @@ -0,0 +1 @@ +function hello() { 'use strict'; "\1"; } diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0217/options.json b/test/fixtures/esprima/invalid-syntax/migrated_0217/options.json new file mode 100644 index 0000000000..68bfd75832 --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0217/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Octal literal in strict mode (1:34)" +} \ No newline at end of file diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0218/actual.js b/test/fixtures/esprima/invalid-syntax/migrated_0218/actual.js new file mode 100644 index 0000000000..f18ece6395 --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0218/actual.js @@ -0,0 +1 @@ +function hello() { 'use strict'; 021; } diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0218/options.json b/test/fixtures/esprima/invalid-syntax/migrated_0218/options.json new file mode 100644 index 0000000000..3711f38eef --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0218/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Invalid number (1:33)" +} \ No newline at end of file diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0219/actual.js b/test/fixtures/esprima/invalid-syntax/migrated_0219/actual.js new file mode 100644 index 0000000000..24426d5e8d --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0219/actual.js @@ -0,0 +1 @@ +function hello() { 'use strict'; ({ "\1": 42 }); } diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0219/options.json b/test/fixtures/esprima/invalid-syntax/migrated_0219/options.json new file mode 100644 index 0000000000..fa3a33b55e --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0219/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Octal literal in strict mode (1:37)" +} \ No newline at end of file diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0220/actual.js b/test/fixtures/esprima/invalid-syntax/migrated_0220/actual.js new file mode 100644 index 0000000000..b6ab67b4f3 --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0220/actual.js @@ -0,0 +1 @@ +function hello() { 'use strict'; ({ 021: 42 }); } diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0220/options.json b/test/fixtures/esprima/invalid-syntax/migrated_0220/options.json new file mode 100644 index 0000000000..a864ada0fe --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0220/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Invalid number (1:36)" +} \ No newline at end of file diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0221/actual.js b/test/fixtures/esprima/invalid-syntax/migrated_0221/actual.js new file mode 100644 index 0000000000..7f3ba60659 --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0221/actual.js @@ -0,0 +1 @@ +function hello() { "octal directive\1"; "use strict"; } diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0221/expected.json b/test/fixtures/esprima/invalid-syntax/migrated_0221/expected.json new file mode 100644 index 0000000000..b8a30a0e6a --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0221/expected.json @@ -0,0 +1,150 @@ +{ + "type": "File", + "start": 0, + "end": 55, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 55 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 55, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 55 + } + }, + "sourceType": "script", + "body": [ + { + "type": "FunctionDeclaration", + "start": 0, + "end": 55, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 55 + } + }, + "id": { + "type": "Identifier", + "start": 9, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "name": "hello" + }, + "generator": false, + "expression": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 17, + "end": 55, + "loc": { + "start": { + "line": 1, + "column": 17 + }, + "end": { + "line": 1, + "column": 55 + } + }, + "body": [ + { + "type": "ExpressionStatement", + "start": 19, + "end": 39, + "loc": { + "start": { + "line": 1, + "column": 19 + }, + "end": { + "line": 1, + "column": 39 + } + }, + "expression": { + "type": "Literal", + "start": 19, + "end": 38, + "loc": { + "start": { + "line": 1, + "column": 19 + }, + "end": { + "line": 1, + "column": 38 + } + }, + "value": "octal directive\u0001", + "rawValue": "octal directive\u0001", + "raw": "\"octal directive\\1\"" + } + }, + { + "type": "ExpressionStatement", + "start": 40, + "end": 53, + "loc": { + "start": { + "line": 1, + "column": 40 + }, + "end": { + "line": 1, + "column": 53 + } + }, + "expression": { + "type": "Literal", + "start": 40, + "end": 52, + "loc": { + "start": { + "line": 1, + "column": 40 + }, + "end": { + "line": 1, + "column": 52 + } + }, + "value": "use strict", + "rawValue": "use strict", + "raw": "\"use strict\"" + } + } + ] + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0221/options.json b/test/fixtures/esprima/invalid-syntax/migrated_0221/options.json new file mode 100644 index 0000000000..aca079ee39 --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0221/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Unexpected token (1:20)" +} \ No newline at end of file diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0222/actual.js b/test/fixtures/esprima/invalid-syntax/migrated_0222/actual.js new file mode 100644 index 0000000000..01cf42721c --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0222/actual.js @@ -0,0 +1 @@ +function hello() { "octal directive\1"; "octal directive\2"; "use strict"; } diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0222/expected.json b/test/fixtures/esprima/invalid-syntax/migrated_0222/expected.json new file mode 100644 index 0000000000..61e775efcf --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0222/expected.json @@ -0,0 +1,183 @@ +{ + "type": "File", + "start": 0, + "end": 76, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 76 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 76, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 76 + } + }, + "sourceType": "script", + "body": [ + { + "type": "FunctionDeclaration", + "start": 0, + "end": 76, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 76 + } + }, + "id": { + "type": "Identifier", + "start": 9, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "name": "hello" + }, + "generator": false, + "expression": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 17, + "end": 76, + "loc": { + "start": { + "line": 1, + "column": 17 + }, + "end": { + "line": 1, + "column": 76 + } + }, + "body": [ + { + "type": "ExpressionStatement", + "start": 19, + "end": 39, + "loc": { + "start": { + "line": 1, + "column": 19 + }, + "end": { + "line": 1, + "column": 39 + } + }, + "expression": { + "type": "Literal", + "start": 19, + "end": 38, + "loc": { + "start": { + "line": 1, + "column": 19 + }, + "end": { + "line": 1, + "column": 38 + } + }, + "value": "octal directive\u0001", + "rawValue": "octal directive\u0001", + "raw": "\"octal directive\\1\"" + } + }, + { + "type": "ExpressionStatement", + "start": 40, + "end": 60, + "loc": { + "start": { + "line": 1, + "column": 40 + }, + "end": { + "line": 1, + "column": 60 + } + }, + "expression": { + "type": "Literal", + "start": 40, + "end": 59, + "loc": { + "start": { + "line": 1, + "column": 40 + }, + "end": { + "line": 1, + "column": 59 + } + }, + "value": "octal directive\u0002", + "rawValue": "octal directive\u0002", + "raw": "\"octal directive\\2\"" + } + }, + { + "type": "ExpressionStatement", + "start": 61, + "end": 74, + "loc": { + "start": { + "line": 1, + "column": 61 + }, + "end": { + "line": 1, + "column": 74 + } + }, + "expression": { + "type": "Literal", + "start": 61, + "end": 73, + "loc": { + "start": { + "line": 1, + "column": 61 + }, + "end": { + "line": 1, + "column": 73 + } + }, + "value": "use strict", + "rawValue": "use strict", + "raw": "\"use strict\"" + } + } + ] + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0222/options.json b/test/fixtures/esprima/invalid-syntax/migrated_0222/options.json new file mode 100644 index 0000000000..aca079ee39 --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0222/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Unexpected token (1:20)" +} \ No newline at end of file diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0223/actual.js b/test/fixtures/esprima/invalid-syntax/migrated_0223/actual.js new file mode 100644 index 0000000000..106319650b --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0223/actual.js @@ -0,0 +1 @@ +function hello() { "use strict"; function inner() { "octal directive\1"; } } diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0223/options.json b/test/fixtures/esprima/invalid-syntax/migrated_0223/options.json new file mode 100644 index 0000000000..e689079a79 --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0223/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Octal literal in strict mode (1:68)" +} \ No newline at end of file diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0224/actual.js b/test/fixtures/esprima/invalid-syntax/migrated_0224/actual.js new file mode 100644 index 0000000000..a24a2f642e --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0224/actual.js @@ -0,0 +1 @@ +function hello() { "use strict"; var implements; } diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0224/options.json b/test/fixtures/esprima/invalid-syntax/migrated_0224/options.json new file mode 100644 index 0000000000..a130c92268 --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0224/options.json @@ -0,0 +1,3 @@ +{ + "throws": "The keyword 'implements' is reserved (1:37)" +} \ No newline at end of file diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0225/actual.js b/test/fixtures/esprima/invalid-syntax/migrated_0225/actual.js new file mode 100644 index 0000000000..c8ac6e7c06 --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0225/actual.js @@ -0,0 +1 @@ +function hello() { "use strict"; var interface; } diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0225/options.json b/test/fixtures/esprima/invalid-syntax/migrated_0225/options.json new file mode 100644 index 0000000000..c70c06968d --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0225/options.json @@ -0,0 +1,3 @@ +{ + "throws": "The keyword 'interface' is reserved (1:37)" +} \ No newline at end of file diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0226/actual.js b/test/fixtures/esprima/invalid-syntax/migrated_0226/actual.js new file mode 100644 index 0000000000..ed58aa94a7 --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0226/actual.js @@ -0,0 +1 @@ +function hello() { "use strict"; var package; } diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0226/options.json b/test/fixtures/esprima/invalid-syntax/migrated_0226/options.json new file mode 100644 index 0000000000..ac7ab9bdb7 --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0226/options.json @@ -0,0 +1,3 @@ +{ + "throws": "The keyword 'package' is reserved (1:37)" +} \ No newline at end of file diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0227/actual.js b/test/fixtures/esprima/invalid-syntax/migrated_0227/actual.js new file mode 100644 index 0000000000..3c63082b72 --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0227/actual.js @@ -0,0 +1 @@ +function hello() { "use strict"; var private; } diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0227/options.json b/test/fixtures/esprima/invalid-syntax/migrated_0227/options.json new file mode 100644 index 0000000000..735d540526 --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0227/options.json @@ -0,0 +1,3 @@ +{ + "throws": "The keyword 'private' is reserved (1:37)" +} \ No newline at end of file diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0228/actual.js b/test/fixtures/esprima/invalid-syntax/migrated_0228/actual.js new file mode 100644 index 0000000000..ffb8aa0cb9 --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0228/actual.js @@ -0,0 +1 @@ +function hello() { "use strict"; var protected; } diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0228/options.json b/test/fixtures/esprima/invalid-syntax/migrated_0228/options.json new file mode 100644 index 0000000000..a8145dcb6a --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0228/options.json @@ -0,0 +1,3 @@ +{ + "throws": "The keyword 'protected' is reserved (1:37)" +} \ No newline at end of file diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0229/actual.js b/test/fixtures/esprima/invalid-syntax/migrated_0229/actual.js new file mode 100644 index 0000000000..929f62327f --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0229/actual.js @@ -0,0 +1 @@ +function hello() { "use strict"; var public; } diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0229/options.json b/test/fixtures/esprima/invalid-syntax/migrated_0229/options.json new file mode 100644 index 0000000000..232b3cba94 --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0229/options.json @@ -0,0 +1,3 @@ +{ + "throws": "The keyword 'public' is reserved (1:37)" +} \ No newline at end of file diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0230/actual.js b/test/fixtures/esprima/invalid-syntax/migrated_0230/actual.js new file mode 100644 index 0000000000..fcbef3215a --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0230/actual.js @@ -0,0 +1 @@ +function hello() { "use strict"; var static; } diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0230/options.json b/test/fixtures/esprima/invalid-syntax/migrated_0230/options.json new file mode 100644 index 0000000000..47fe5aafaf --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0230/options.json @@ -0,0 +1,3 @@ +{ + "throws": "The keyword 'static' is reserved (1:37)" +} \ No newline at end of file diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0231/actual.js b/test/fixtures/esprima/invalid-syntax/migrated_0231/actual.js new file mode 100644 index 0000000000..7f5d158aa2 --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0231/actual.js @@ -0,0 +1 @@ +function hello() { "use strict"; var yield; } diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0231/options.json b/test/fixtures/esprima/invalid-syntax/migrated_0231/options.json new file mode 100644 index 0000000000..22d103a833 --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0231/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Unexpected token (1:37)" +} \ No newline at end of file diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0232/actual.js b/test/fixtures/esprima/invalid-syntax/migrated_0232/actual.js new file mode 100644 index 0000000000..40e528cda3 --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0232/actual.js @@ -0,0 +1 @@ +function hello() { "use strict"; var let; } diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0232/options.json b/test/fixtures/esprima/invalid-syntax/migrated_0232/options.json new file mode 100644 index 0000000000..22d103a833 --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0232/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Unexpected token (1:37)" +} \ No newline at end of file diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0233/actual.js b/test/fixtures/esprima/invalid-syntax/migrated_0233/actual.js new file mode 100644 index 0000000000..9989eb6e06 --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0233/actual.js @@ -0,0 +1 @@ +function hello(static) { "use strict"; } diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0233/expected.json b/test/fixtures/esprima/invalid-syntax/migrated_0233/expected.json new file mode 100644 index 0000000000..9454908513 --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0233/expected.json @@ -0,0 +1,134 @@ +{ + "type": "File", + "start": 0, + "end": 40, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 40 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 40, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 40 + } + }, + "sourceType": "script", + "body": [ + { + "type": "FunctionDeclaration", + "start": 0, + "end": 40, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 40 + } + }, + "id": { + "type": "Identifier", + "start": 9, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "name": "hello" + }, + "generator": false, + "expression": false, + "params": [ + { + "type": "Identifier", + "start": 15, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 21 + } + }, + "name": "static" + } + ], + "body": { + "type": "BlockStatement", + "start": 23, + "end": 40, + "loc": { + "start": { + "line": 1, + "column": 23 + }, + "end": { + "line": 1, + "column": 40 + } + }, + "body": [ + { + "type": "ExpressionStatement", + "start": 25, + "end": 38, + "loc": { + "start": { + "line": 1, + "column": 25 + }, + "end": { + "line": 1, + "column": 38 + } + }, + "expression": { + "type": "Literal", + "start": 25, + "end": 37, + "loc": { + "start": { + "line": 1, + "column": 25 + }, + "end": { + "line": 1, + "column": 37 + } + }, + "value": "use strict", + "rawValue": "use strict", + "raw": "\"use strict\"" + } + } + ] + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0233/options.json b/test/fixtures/esprima/invalid-syntax/migrated_0233/options.json new file mode 100644 index 0000000000..07a8c1c0f1 --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0233/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Binding static in strict mode (1:15)" +} \ No newline at end of file diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0234/actual.js b/test/fixtures/esprima/invalid-syntax/migrated_0234/actual.js new file mode 100644 index 0000000000..5a6fe505bc --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0234/actual.js @@ -0,0 +1 @@ +function static() { "use strict"; } diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0234/expected.json b/test/fixtures/esprima/invalid-syntax/migrated_0234/expected.json new file mode 100644 index 0000000000..42dbd8e915 --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0234/expected.json @@ -0,0 +1,117 @@ +{ + "type": "File", + "start": 0, + "end": 35, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 35 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 35, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 35 + } + }, + "sourceType": "script", + "body": [ + { + "type": "FunctionDeclaration", + "start": 0, + "end": 35, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 35 + } + }, + "id": { + "type": "Identifier", + "start": 9, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "name": "static" + }, + "generator": false, + "expression": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 18, + "end": 35, + "loc": { + "start": { + "line": 1, + "column": 18 + }, + "end": { + "line": 1, + "column": 35 + } + }, + "body": [ + { + "type": "ExpressionStatement", + "start": 20, + "end": 33, + "loc": { + "start": { + "line": 1, + "column": 20 + }, + "end": { + "line": 1, + "column": 33 + } + }, + "expression": { + "type": "Literal", + "start": 20, + "end": 32, + "loc": { + "start": { + "line": 1, + "column": 20 + }, + "end": { + "line": 1, + "column": 32 + } + }, + "value": "use strict", + "rawValue": "use strict", + "raw": "\"use strict\"" + } + } + ] + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0234/options.json b/test/fixtures/esprima/invalid-syntax/migrated_0234/options.json new file mode 100644 index 0000000000..f7524a3327 --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0234/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Binding static in strict mode (1:9)" +} \ No newline at end of file diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0235/actual.js b/test/fixtures/esprima/invalid-syntax/migrated_0235/actual.js new file mode 100644 index 0000000000..95b11685e4 --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0235/actual.js @@ -0,0 +1 @@ +function eval(a) { "use strict"; } diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0235/expected.json b/test/fixtures/esprima/invalid-syntax/migrated_0235/expected.json new file mode 100644 index 0000000000..ae4c951249 --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0235/expected.json @@ -0,0 +1,134 @@ +{ + "type": "File", + "start": 0, + "end": 34, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 34 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 34, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 34 + } + }, + "sourceType": "script", + "body": [ + { + "type": "FunctionDeclaration", + "start": 0, + "end": 34, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 34 + } + }, + "id": { + "type": "Identifier", + "start": 9, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "name": "eval" + }, + "generator": false, + "expression": false, + "params": [ + { + "type": "Identifier", + "start": 14, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 14 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "name": "a" + } + ], + "body": { + "type": "BlockStatement", + "start": 17, + "end": 34, + "loc": { + "start": { + "line": 1, + "column": 17 + }, + "end": { + "line": 1, + "column": 34 + } + }, + "body": [ + { + "type": "ExpressionStatement", + "start": 19, + "end": 32, + "loc": { + "start": { + "line": 1, + "column": 19 + }, + "end": { + "line": 1, + "column": 32 + } + }, + "expression": { + "type": "Literal", + "start": 19, + "end": 31, + "loc": { + "start": { + "line": 1, + "column": 19 + }, + "end": { + "line": 1, + "column": 31 + } + }, + "value": "use strict", + "rawValue": "use strict", + "raw": "\"use strict\"" + } + } + ] + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0235/options.json b/test/fixtures/esprima/invalid-syntax/migrated_0235/options.json new file mode 100644 index 0000000000..a49374fb46 --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0235/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Binding eval in strict mode (1:9)" +} \ No newline at end of file diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0236/actual.js b/test/fixtures/esprima/invalid-syntax/migrated_0236/actual.js new file mode 100644 index 0000000000..304c94536b --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0236/actual.js @@ -0,0 +1 @@ +function arguments(a) { "use strict"; } diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0236/expected.json b/test/fixtures/esprima/invalid-syntax/migrated_0236/expected.json new file mode 100644 index 0000000000..4bd552372c --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0236/expected.json @@ -0,0 +1,134 @@ +{ + "type": "File", + "start": 0, + "end": 39, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 39 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 39, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 39 + } + }, + "sourceType": "script", + "body": [ + { + "type": "FunctionDeclaration", + "start": 0, + "end": 39, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 39 + } + }, + "id": { + "type": "Identifier", + "start": 9, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "name": "arguments" + }, + "generator": false, + "expression": false, + "params": [ + { + "type": "Identifier", + "start": 19, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 19 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "name": "a" + } + ], + "body": { + "type": "BlockStatement", + "start": 22, + "end": 39, + "loc": { + "start": { + "line": 1, + "column": 22 + }, + "end": { + "line": 1, + "column": 39 + } + }, + "body": [ + { + "type": "ExpressionStatement", + "start": 24, + "end": 37, + "loc": { + "start": { + "line": 1, + "column": 24 + }, + "end": { + "line": 1, + "column": 37 + } + }, + "expression": { + "type": "Literal", + "start": 24, + "end": 36, + "loc": { + "start": { + "line": 1, + "column": 24 + }, + "end": { + "line": 1, + "column": 36 + } + }, + "value": "use strict", + "rawValue": "use strict", + "raw": "\"use strict\"" + } + } + ] + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0236/options.json b/test/fixtures/esprima/invalid-syntax/migrated_0236/options.json new file mode 100644 index 0000000000..8a3871a0d1 --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0236/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Binding arguments in strict mode (1:9)" +} \ No newline at end of file diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0238/actual.js b/test/fixtures/esprima/invalid-syntax/migrated_0238/actual.js new file mode 100644 index 0000000000..c87b8eaaf4 --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0238/actual.js @@ -0,0 +1 @@ +var let diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0238/expected.json b/test/fixtures/esprima/invalid-syntax/migrated_0238/expected.json new file mode 100644 index 0000000000..f5cbcbeb1d --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0238/expected.json @@ -0,0 +1,83 @@ +{ + "type": "File", + "start": 0, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "sourceType": "script", + "body": [ + { + "type": "VariableDeclaration", + "start": 0, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 4, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "id": { + "type": "Identifier", + "start": 4, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "name": "let" + }, + "init": null + } + ], + "kind": "var" + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0238/options.json b/test/fixtures/esprima/invalid-syntax/migrated_0238/options.json new file mode 100644 index 0000000000..9f7910a413 --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0238/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Unexpected token (1:4)" +} \ No newline at end of file diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0239/actual.js b/test/fixtures/esprima/invalid-syntax/migrated_0239/actual.js new file mode 100644 index 0000000000..d38b6bace9 --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0239/actual.js @@ -0,0 +1 @@ +"use strict"; function static() { } diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0239/options.json b/test/fixtures/esprima/invalid-syntax/migrated_0239/options.json new file mode 100644 index 0000000000..07d74757d4 --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0239/options.json @@ -0,0 +1,3 @@ +{ + "throws": "The keyword 'static' is reserved (1:23)" +} \ No newline at end of file diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0240/actual.js b/test/fixtures/esprima/invalid-syntax/migrated_0240/actual.js new file mode 100644 index 0000000000..bd0106ab72 --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0240/actual.js @@ -0,0 +1 @@ +function a(t, t) { "use strict"; } diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0240/options.json b/test/fixtures/esprima/invalid-syntax/migrated_0240/options.json new file mode 100644 index 0000000000..421c28bbd6 --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0240/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Argument name clash in strict mode (1:14)" +} \ No newline at end of file diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0241/actual.js b/test/fixtures/esprima/invalid-syntax/migrated_0241/actual.js new file mode 100644 index 0000000000..cb2f36487e --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0241/actual.js @@ -0,0 +1 @@ +function a(eval) { "use strict"; } diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0241/expected.json b/test/fixtures/esprima/invalid-syntax/migrated_0241/expected.json new file mode 100644 index 0000000000..14824eac9f --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0241/expected.json @@ -0,0 +1,134 @@ +{ + "type": "File", + "start": 0, + "end": 34, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 34 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 34, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 34 + } + }, + "sourceType": "script", + "body": [ + { + "type": "FunctionDeclaration", + "start": 0, + "end": 34, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 34 + } + }, + "id": { + "type": "Identifier", + "start": 9, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "name": "a" + }, + "generator": false, + "expression": false, + "params": [ + { + "type": "Identifier", + "start": 11, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 11 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "name": "eval" + } + ], + "body": { + "type": "BlockStatement", + "start": 17, + "end": 34, + "loc": { + "start": { + "line": 1, + "column": 17 + }, + "end": { + "line": 1, + "column": 34 + } + }, + "body": [ + { + "type": "ExpressionStatement", + "start": 19, + "end": 32, + "loc": { + "start": { + "line": 1, + "column": 19 + }, + "end": { + "line": 1, + "column": 32 + } + }, + "expression": { + "type": "Literal", + "start": 19, + "end": 31, + "loc": { + "start": { + "line": 1, + "column": 19 + }, + "end": { + "line": 1, + "column": 31 + } + }, + "value": "use strict", + "rawValue": "use strict", + "raw": "\"use strict\"" + } + } + ] + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0241/options.json b/test/fixtures/esprima/invalid-syntax/migrated_0241/options.json new file mode 100644 index 0000000000..301643713f --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0241/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Binding eval in strict mode (1:11)" +} \ No newline at end of file diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0242/actual.js b/test/fixtures/esprima/invalid-syntax/migrated_0242/actual.js new file mode 100644 index 0000000000..4c24f21c91 --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0242/actual.js @@ -0,0 +1 @@ +function a(package) { "use strict"; } diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0242/expected.json b/test/fixtures/esprima/invalid-syntax/migrated_0242/expected.json new file mode 100644 index 0000000000..b18233c76a --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0242/expected.json @@ -0,0 +1,134 @@ +{ + "type": "File", + "start": 0, + "end": 37, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 37 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 37, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 37 + } + }, + "sourceType": "script", + "body": [ + { + "type": "FunctionDeclaration", + "start": 0, + "end": 37, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 37 + } + }, + "id": { + "type": "Identifier", + "start": 9, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "name": "a" + }, + "generator": false, + "expression": false, + "params": [ + { + "type": "Identifier", + "start": 11, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 11 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "name": "package" + } + ], + "body": { + "type": "BlockStatement", + "start": 20, + "end": 37, + "loc": { + "start": { + "line": 1, + "column": 20 + }, + "end": { + "line": 1, + "column": 37 + } + }, + "body": [ + { + "type": "ExpressionStatement", + "start": 22, + "end": 35, + "loc": { + "start": { + "line": 1, + "column": 22 + }, + "end": { + "line": 1, + "column": 35 + } + }, + "expression": { + "type": "Literal", + "start": 22, + "end": 34, + "loc": { + "start": { + "line": 1, + "column": 22 + }, + "end": { + "line": 1, + "column": 34 + } + }, + "value": "use strict", + "rawValue": "use strict", + "raw": "\"use strict\"" + } + } + ] + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0242/options.json b/test/fixtures/esprima/invalid-syntax/migrated_0242/options.json new file mode 100644 index 0000000000..31ebd9508d --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0242/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Binding package in strict mode (1:11)" +} \ No newline at end of file diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0243/actual.js b/test/fixtures/esprima/invalid-syntax/migrated_0243/actual.js new file mode 100644 index 0000000000..830cb897d3 --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0243/actual.js @@ -0,0 +1 @@ +function a() { "use strict"; function b(t, t) { }; } diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0243/options.json b/test/fixtures/esprima/invalid-syntax/migrated_0243/options.json new file mode 100644 index 0000000000..9db3dfc50c --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0243/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Argument name clash in strict mode (1:43)" +} \ No newline at end of file diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0244/actual.js b/test/fixtures/esprima/invalid-syntax/migrated_0244/actual.js new file mode 100644 index 0000000000..9fa07b0a2a --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0244/actual.js @@ -0,0 +1 @@ +(function a(t, t) { "use strict"; }) diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0244/options.json b/test/fixtures/esprima/invalid-syntax/migrated_0244/options.json new file mode 100644 index 0000000000..13e320a983 --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0244/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Argument name clash in strict mode (1:15)" +} \ No newline at end of file diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0245/actual.js b/test/fixtures/esprima/invalid-syntax/migrated_0245/actual.js new file mode 100644 index 0000000000..424f432ff6 --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0245/actual.js @@ -0,0 +1 @@ +function a() { "use strict"; (function b(t, t) { }); } diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0245/options.json b/test/fixtures/esprima/invalid-syntax/migrated_0245/options.json new file mode 100644 index 0000000000..0e4f27a823 --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0245/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Argument name clash in strict mode (1:44)" +} \ No newline at end of file diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0246/actual.js b/test/fixtures/esprima/invalid-syntax/migrated_0246/actual.js new file mode 100644 index 0000000000..340ca59613 --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0246/actual.js @@ -0,0 +1 @@ +(function a(eval) { "use strict"; }) diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0246/expected.json b/test/fixtures/esprima/invalid-syntax/migrated_0246/expected.json new file mode 100644 index 0000000000..a4e3e8cbd5 --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0246/expected.json @@ -0,0 +1,150 @@ +{ + "type": "File", + "start": 0, + "end": 36, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 36 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 36, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 36 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 36, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 36 + } + }, + "expression": { + "type": "FunctionExpression", + "start": 1, + "end": 35, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 35 + } + }, + "id": { + "type": "Identifier", + "start": 10, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "name": "a" + }, + "generator": false, + "expression": false, + "params": [ + { + "type": "Identifier", + "start": 12, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 12 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "name": "eval" + } + ], + "body": { + "type": "BlockStatement", + "start": 18, + "end": 35, + "loc": { + "start": { + "line": 1, + "column": 18 + }, + "end": { + "line": 1, + "column": 35 + } + }, + "body": [ + { + "type": "ExpressionStatement", + "start": 20, + "end": 33, + "loc": { + "start": { + "line": 1, + "column": 20 + }, + "end": { + "line": 1, + "column": 33 + } + }, + "expression": { + "type": "Literal", + "start": 20, + "end": 32, + "loc": { + "start": { + "line": 1, + "column": 20 + }, + "end": { + "line": 1, + "column": 32 + } + }, + "value": "use strict", + "rawValue": "use strict", + "raw": "\"use strict\"" + } + } + ] + }, + "parenthesizedExpression": true + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0246/options.json b/test/fixtures/esprima/invalid-syntax/migrated_0246/options.json new file mode 100644 index 0000000000..c9df15d6ef --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0246/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Binding eval in strict mode (1:12)" +} \ No newline at end of file diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0247/actual.js b/test/fixtures/esprima/invalid-syntax/migrated_0247/actual.js new file mode 100644 index 0000000000..2d07eeebbf --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0247/actual.js @@ -0,0 +1 @@ +(function a(package) { "use strict"; }) diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0247/expected.json b/test/fixtures/esprima/invalid-syntax/migrated_0247/expected.json new file mode 100644 index 0000000000..63264f0559 --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0247/expected.json @@ -0,0 +1,150 @@ +{ + "type": "File", + "start": 0, + "end": 39, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 39 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 39, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 39 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 39, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 39 + } + }, + "expression": { + "type": "FunctionExpression", + "start": 1, + "end": 38, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 38 + } + }, + "id": { + "type": "Identifier", + "start": 10, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "name": "a" + }, + "generator": false, + "expression": false, + "params": [ + { + "type": "Identifier", + "start": 12, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 12 + }, + "end": { + "line": 1, + "column": 19 + } + }, + "name": "package" + } + ], + "body": { + "type": "BlockStatement", + "start": 21, + "end": 38, + "loc": { + "start": { + "line": 1, + "column": 21 + }, + "end": { + "line": 1, + "column": 38 + } + }, + "body": [ + { + "type": "ExpressionStatement", + "start": 23, + "end": 36, + "loc": { + "start": { + "line": 1, + "column": 23 + }, + "end": { + "line": 1, + "column": 36 + } + }, + "expression": { + "type": "Literal", + "start": 23, + "end": 35, + "loc": { + "start": { + "line": 1, + "column": 23 + }, + "end": { + "line": 1, + "column": 35 + } + }, + "value": "use strict", + "rawValue": "use strict", + "raw": "\"use strict\"" + } + } + ] + }, + "parenthesizedExpression": true + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0247/options.json b/test/fixtures/esprima/invalid-syntax/migrated_0247/options.json new file mode 100644 index 0000000000..87abf59529 --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0247/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Binding package in strict mode (1:12)" +} \ No newline at end of file diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0248/actual.js b/test/fixtures/esprima/invalid-syntax/migrated_0248/actual.js new file mode 100644 index 0000000000..3d2f790772 --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0248/actual.js @@ -0,0 +1 @@ +__proto__: __proto__: 42; diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0248/options.json b/test/fixtures/esprima/invalid-syntax/migrated_0248/options.json new file mode 100644 index 0000000000..bb0741872a --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0248/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Label '__proto__' is already declared (1:11)" +} \ No newline at end of file diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0249/actual.js b/test/fixtures/esprima/invalid-syntax/migrated_0249/actual.js new file mode 100644 index 0000000000..6d657e5531 --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0249/actual.js @@ -0,0 +1 @@ +"use strict"; function t(__proto__, __proto__) { } diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0249/options.json b/test/fixtures/esprima/invalid-syntax/migrated_0249/options.json new file mode 100644 index 0000000000..e887380a58 --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0249/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Argument name clash in strict mode (1:36)" +} \ No newline at end of file diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0250/actual.js b/test/fixtures/esprima/invalid-syntax/migrated_0250/actual.js new file mode 100644 index 0000000000..b38460128f --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0250/actual.js @@ -0,0 +1 @@ +x = { __proto__: 42, __proto__: 43 } diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0250/options.json b/test/fixtures/esprima/invalid-syntax/migrated_0250/options.json new file mode 100644 index 0000000000..ae09c6ae48 --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0250/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Redefinition of __proto__ property (1:21)" +} \ No newline at end of file diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0252/actual.js b/test/fixtures/esprima/invalid-syntax/migrated_0252/actual.js new file mode 100644 index 0000000000..186857b9e8 --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0252/actual.js @@ -0,0 +1 @@ +var diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0252/options.json b/test/fixtures/esprima/invalid-syntax/migrated_0252/options.json new file mode 100644 index 0000000000..3b5e811628 --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0252/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Unexpected token (1:3)" +} \ No newline at end of file diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0253/actual.js b/test/fixtures/esprima/invalid-syntax/migrated_0253/actual.js new file mode 100644 index 0000000000..564a1caa1c --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0253/actual.js @@ -0,0 +1 @@ +let diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0253/expected.json b/test/fixtures/esprima/invalid-syntax/migrated_0253/expected.json new file mode 100644 index 0000000000..51d622d320 --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0253/expected.json @@ -0,0 +1,64 @@ +{ + "type": "File", + "start": 0, + "end": 3, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 3 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 3, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 3 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 3, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 3 + } + }, + "expression": { + "type": "Identifier", + "start": 0, + "end": 3, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 3 + } + }, + "name": "let" + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0253/options.json b/test/fixtures/esprima/invalid-syntax/migrated_0253/options.json new file mode 100644 index 0000000000..3b5e811628 --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0253/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Unexpected token (1:3)" +} \ No newline at end of file diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0254/actual.js b/test/fixtures/esprima/invalid-syntax/migrated_0254/actual.js new file mode 100644 index 0000000000..aaae4e1105 --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0254/actual.js @@ -0,0 +1 @@ +const diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0254/options.json b/test/fixtures/esprima/invalid-syntax/migrated_0254/options.json new file mode 100644 index 0000000000..0ab445fe47 --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0254/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Unexpected token (1:5)" +} \ No newline at end of file diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0255/actual.js b/test/fixtures/esprima/invalid-syntax/migrated_0255/actual.js new file mode 100644 index 0000000000..1349ddc4b7 --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0255/actual.js @@ -0,0 +1 @@ +{ ; ; diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0255/options.json b/test/fixtures/esprima/invalid-syntax/migrated_0255/options.json new file mode 100644 index 0000000000..515b971673 --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0255/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Unexpected token (1:6)" +} \ No newline at end of file diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0256/actual.js b/test/fixtures/esprima/invalid-syntax/migrated_0256/actual.js new file mode 100644 index 0000000000..7a651b7dab --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0256/actual.js @@ -0,0 +1 @@ +function t() { ; ; diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0256/options.json b/test/fixtures/esprima/invalid-syntax/migrated_0256/options.json new file mode 100644 index 0000000000..1e730e1707 --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0256/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Unexpected token (1:19)" +} \ No newline at end of file diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0257/actual.js b/test/fixtures/esprima/invalid-syntax/migrated_0257/actual.js new file mode 100644 index 0000000000..d05111f2b1 --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0257/actual.js @@ -0,0 +1 @@ +'use strict'; a package diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0257/options.json b/test/fixtures/esprima/invalid-syntax/migrated_0257/options.json new file mode 100644 index 0000000000..89e36d9013 --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0257/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Unexpected token (1:16)" +} \ No newline at end of file diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0258/actual.js b/test/fixtures/esprima/invalid-syntax/migrated_0258/actual.js new file mode 100644 index 0000000000..efd31c6d91 --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0258/actual.js @@ -0,0 +1 @@ +function f(a, ...b, c){} diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0258/options.json b/test/fixtures/esprima/invalid-syntax/migrated_0258/options.json new file mode 100644 index 0000000000..2a73699bc2 --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0258/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Unexpected token (1:18)" +} \ No newline at end of file diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0259/actual.js b/test/fixtures/esprima/invalid-syntax/migrated_0259/actual.js new file mode 100644 index 0000000000..e632766388 --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0259/actual.js @@ -0,0 +1 @@ +function x(...{ a }){} diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0259/options.json b/test/fixtures/esprima/invalid-syntax/migrated_0259/options.json new file mode 100644 index 0000000000..51c483f3d3 --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0259/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Unexpected token (1:14)" +} \ No newline at end of file diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0260/actual.js b/test/fixtures/esprima/invalid-syntax/migrated_0260/actual.js new file mode 100644 index 0000000000..ce8895825f --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0260/actual.js @@ -0,0 +1 @@ +function x(...a = 1){} diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0260/options.json b/test/fixtures/esprima/invalid-syntax/migrated_0260/options.json new file mode 100644 index 0000000000..89e36d9013 --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0260/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Unexpected token (1:16)" +} \ No newline at end of file diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0261/actual.js b/test/fixtures/esprima/invalid-syntax/migrated_0261/actual.js new file mode 100644 index 0000000000..b544cd3a5a --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0261/actual.js @@ -0,0 +1 @@ +class diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0261/options.json b/test/fixtures/esprima/invalid-syntax/migrated_0261/options.json new file mode 100644 index 0000000000..0ab445fe47 --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0261/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Unexpected token (1:5)" +} \ No newline at end of file diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0262/actual.js b/test/fixtures/esprima/invalid-syntax/migrated_0262/actual.js new file mode 100644 index 0000000000..b544cd3a5a --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0262/actual.js @@ -0,0 +1 @@ +class diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0262/options.json b/test/fixtures/esprima/invalid-syntax/migrated_0262/options.json new file mode 100644 index 0000000000..0ab445fe47 --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0262/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Unexpected token (1:5)" +} \ No newline at end of file diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0263/actual.js b/test/fixtures/esprima/invalid-syntax/migrated_0263/actual.js new file mode 100644 index 0000000000..5514733de2 --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0263/actual.js @@ -0,0 +1 @@ +class; diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0263/options.json b/test/fixtures/esprima/invalid-syntax/migrated_0263/options.json new file mode 100644 index 0000000000..0ab445fe47 --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0263/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Unexpected token (1:5)" +} \ No newline at end of file diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0264/actual.js b/test/fixtures/esprima/invalid-syntax/migrated_0264/actual.js new file mode 100644 index 0000000000..377c52d036 --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0264/actual.js @@ -0,0 +1 @@ +class A extends a + b {} diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0264/options.json b/test/fixtures/esprima/invalid-syntax/migrated_0264/options.json new file mode 100644 index 0000000000..2a73699bc2 --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0264/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Unexpected token (1:18)" +} \ No newline at end of file diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0265/actual.js b/test/fixtures/esprima/invalid-syntax/migrated_0265/actual.js new file mode 100644 index 0000000000..83d15dc739 --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0265/actual.js @@ -0,0 +1 @@ +class A diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0265/options.json b/test/fixtures/esprima/invalid-syntax/migrated_0265/options.json new file mode 100644 index 0000000000..167116741e --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0265/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Unexpected token (1:7)" +} \ No newline at end of file diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0266/actual.js b/test/fixtures/esprima/invalid-syntax/migrated_0266/actual.js new file mode 100644 index 0000000000..352b0f29c9 --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0266/actual.js @@ -0,0 +1 @@ +class A { diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0266/options.json b/test/fixtures/esprima/invalid-syntax/migrated_0266/options.json new file mode 100644 index 0000000000..93db7641c7 --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0266/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Unexpected token (1:9)" +} \ No newline at end of file diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0267/actual.js b/test/fixtures/esprima/invalid-syntax/migrated_0267/actual.js new file mode 100644 index 0000000000..a8921ee1b1 --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0267/actual.js @@ -0,0 +1 @@ +class A; diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0267/options.json b/test/fixtures/esprima/invalid-syntax/migrated_0267/options.json new file mode 100644 index 0000000000..167116741e --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0267/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Unexpected token (1:7)" +} \ No newline at end of file diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0268/actual.js b/test/fixtures/esprima/invalid-syntax/migrated_0268/actual.js new file mode 100644 index 0000000000..a90634119b --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0268/actual.js @@ -0,0 +1 @@ +class A {a:0} diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0268/options.json b/test/fixtures/esprima/invalid-syntax/migrated_0268/options.json new file mode 100644 index 0000000000..328b1ddde8 --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0268/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Unexpected token (1:10)" +} \ No newline at end of file diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0269/actual.js b/test/fixtures/esprima/invalid-syntax/migrated_0269/actual.js new file mode 100644 index 0000000000..5168697dfb --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0269/actual.js @@ -0,0 +1 @@ +class A {a(){},b(){}} diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0269/options.json b/test/fixtures/esprima/invalid-syntax/migrated_0269/options.json new file mode 100644 index 0000000000..51c483f3d3 --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0269/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Unexpected token (1:14)" +} \ No newline at end of file diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0270/actual.js b/test/fixtures/esprima/invalid-syntax/migrated_0270/actual.js new file mode 100644 index 0000000000..1dd45cdc92 --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0270/actual.js @@ -0,0 +1 @@ +class A {static prototype(){}} diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0270/expected.json b/test/fixtures/esprima/invalid-syntax/migrated_0270/expected.json new file mode 100644 index 0000000000..5830cef10e --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0270/expected.json @@ -0,0 +1,151 @@ +{ + "type": "File", + "start": 0, + "end": 30, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 30 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 30, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 30 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ClassDeclaration", + "start": 0, + "end": 30, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 30 + } + }, + "id": { + "type": "Identifier", + "start": 6, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "name": "A" + }, + "superClass": null, + "body": { + "type": "ClassBody", + "start": 8, + "end": 30, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 30 + } + }, + "body": [ + { + "type": "MethodDefinition", + "start": 9, + "end": 29, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 29 + } + }, + "computed": false, + "key": { + "type": "Identifier", + "start": 16, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 16 + }, + "end": { + "line": 1, + "column": 25 + } + }, + "name": "prototype" + }, + "static": true, + "kind": "method", + "value": { + "type": "FunctionExpression", + "start": 25, + "end": 29, + "loc": { + "start": { + "line": 1, + "column": 25 + }, + "end": { + "line": 1, + "column": 29 + } + }, + "id": null, + "generator": false, + "expression": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 27, + "end": 29, + "loc": { + "start": { + "line": 1, + "column": 27 + }, + "end": { + "line": 1, + "column": 29 + } + }, + "body": [] + } + } + } + ] + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0270/options.json b/test/fixtures/esprima/invalid-syntax/migrated_0270/options.json new file mode 100644 index 0000000000..8bb9a5f99b --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0270/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Unexpected token (1:17)" +} \ No newline at end of file diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0271/actual.js b/test/fixtures/esprima/invalid-syntax/migrated_0271/actual.js new file mode 100644 index 0000000000..1eda932405 --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0271/actual.js @@ -0,0 +1 @@ +class A {static "prototype"(){}} diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0271/expected.json b/test/fixtures/esprima/invalid-syntax/migrated_0271/expected.json new file mode 100644 index 0000000000..6cc3ea74c2 --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0271/expected.json @@ -0,0 +1,153 @@ +{ + "type": "File", + "start": 0, + "end": 32, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 32 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 32, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 32 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ClassDeclaration", + "start": 0, + "end": 32, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 32 + } + }, + "id": { + "type": "Identifier", + "start": 6, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "name": "A" + }, + "superClass": null, + "body": { + "type": "ClassBody", + "start": 8, + "end": 32, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 32 + } + }, + "body": [ + { + "type": "MethodDefinition", + "start": 9, + "end": 31, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 31 + } + }, + "computed": false, + "key": { + "type": "Literal", + "start": 16, + "end": 27, + "loc": { + "start": { + "line": 1, + "column": 16 + }, + "end": { + "line": 1, + "column": 27 + } + }, + "value": "prototype", + "rawValue": "prototype", + "raw": "\"prototype\"" + }, + "static": true, + "kind": "method", + "value": { + "type": "FunctionExpression", + "start": 27, + "end": 31, + "loc": { + "start": { + "line": 1, + "column": 27 + }, + "end": { + "line": 1, + "column": 31 + } + }, + "id": null, + "generator": false, + "expression": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 29, + "end": 31, + "loc": { + "start": { + "line": 1, + "column": 29 + }, + "end": { + "line": 1, + "column": 31 + } + }, + "body": [] + } + } + } + ] + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0271/options.json b/test/fixtures/esprima/invalid-syntax/migrated_0271/options.json new file mode 100644 index 0000000000..8bb9a5f99b --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0271/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Unexpected token (1:17)" +} \ No newline at end of file diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0272/actual.js b/test/fixtures/esprima/invalid-syntax/migrated_0272/actual.js new file mode 100644 index 0000000000..819ff281ef --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0272/actual.js @@ -0,0 +1 @@ +class A {get constructor(){}} diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0272/options.json b/test/fixtures/esprima/invalid-syntax/migrated_0272/options.json new file mode 100644 index 0000000000..cbb8e10c8d --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0272/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Constructor can't have get/set modifier (1:13)" +} \ No newline at end of file diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0273/actual.js b/test/fixtures/esprima/invalid-syntax/migrated_0273/actual.js new file mode 100644 index 0000000000..b92c5fd75f --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0273/actual.js @@ -0,0 +1 @@ +class A {set constructor(m){}} diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0273/options.json b/test/fixtures/esprima/invalid-syntax/migrated_0273/options.json new file mode 100644 index 0000000000..cbb8e10c8d --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0273/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Constructor can't have get/set modifier (1:13)" +} \ No newline at end of file diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0274/actual.js b/test/fixtures/esprima/invalid-syntax/migrated_0274/actual.js new file mode 100644 index 0000000000..dd0fd8728d --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0274/actual.js @@ -0,0 +1 @@ +class A {constructor(){} "constructor"(){}} diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0274/options.json b/test/fixtures/esprima/invalid-syntax/migrated_0274/options.json new file mode 100644 index 0000000000..cf2d761794 --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0274/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Duplicate constructor in the same class (1:25)" +} \ No newline at end of file diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0275/actual.js b/test/fixtures/esprima/invalid-syntax/migrated_0275/actual.js new file mode 100644 index 0000000000..9db4aa8388 --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0275/actual.js @@ -0,0 +1 @@ +class A {a static(){}} diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0275/options.json b/test/fixtures/esprima/invalid-syntax/migrated_0275/options.json new file mode 100644 index 0000000000..3e33f7730f --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0275/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Unexpected token (1:11)" +} \ No newline at end of file diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0276/actual.js b/test/fixtures/esprima/invalid-syntax/migrated_0276/actual.js new file mode 100644 index 0000000000..baca917bf1 --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0276/actual.js @@ -0,0 +1 @@ +class A {static static static(){}} diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0276/options.json b/test/fixtures/esprima/invalid-syntax/migrated_0276/options.json new file mode 100644 index 0000000000..2ddc9e708f --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0276/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Unexpected token (1:23)" +} \ No newline at end of file diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0277/actual.js b/test/fixtures/esprima/invalid-syntax/migrated_0277/actual.js new file mode 100644 index 0000000000..72959842be --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0277/actual.js @@ -0,0 +1 @@ +class A {a(enum){}} diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0277/expected.json b/test/fixtures/esprima/invalid-syntax/migrated_0277/expected.json new file mode 100644 index 0000000000..0fa4cd9032 --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0277/expected.json @@ -0,0 +1,168 @@ +{ + "type": "File", + "start": 0, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 19 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 19 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ClassDeclaration", + "start": 0, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 19 + } + }, + "id": { + "type": "Identifier", + "start": 6, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "name": "A" + }, + "superClass": null, + "body": { + "type": "ClassBody", + "start": 8, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 19 + } + }, + "body": [ + { + "type": "MethodDefinition", + "start": 9, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "computed": false, + "key": { + "type": "Identifier", + "start": 9, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "name": "a" + }, + "static": false, + "kind": "method", + "value": { + "type": "FunctionExpression", + "start": 10, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "id": null, + "generator": false, + "expression": false, + "params": [ + { + "type": "Identifier", + "start": 11, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 11 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "name": "enum" + } + ], + "body": { + "type": "BlockStatement", + "start": 16, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 16 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "body": [] + } + } + } + ] + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0277/options.json b/test/fixtures/esprima/invalid-syntax/migrated_0277/options.json new file mode 100644 index 0000000000..358068a16a --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0277/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Unexpected token (1:12)" +} \ No newline at end of file diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0278/actual.js b/test/fixtures/esprima/invalid-syntax/migrated_0278/actual.js new file mode 100644 index 0000000000..bdd71a4d67 --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0278/actual.js @@ -0,0 +1 @@ +class A {static [static](){};} diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0278/expected.json b/test/fixtures/esprima/invalid-syntax/migrated_0278/expected.json new file mode 100644 index 0000000000..966e05ade4 --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0278/expected.json @@ -0,0 +1,151 @@ +{ + "type": "File", + "start": 0, + "end": 30, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 30 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 30, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 30 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ClassDeclaration", + "start": 0, + "end": 30, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 30 + } + }, + "id": { + "type": "Identifier", + "start": 6, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "name": "A" + }, + "superClass": null, + "body": { + "type": "ClassBody", + "start": 8, + "end": 30, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 30 + } + }, + "body": [ + { + "type": "MethodDefinition", + "start": 9, + "end": 28, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 28 + } + }, + "computed": true, + "key": { + "type": "Identifier", + "start": 17, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 17 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "name": "static" + }, + "static": true, + "kind": "method", + "value": { + "type": "FunctionExpression", + "start": 24, + "end": 28, + "loc": { + "start": { + "line": 1, + "column": 24 + }, + "end": { + "line": 1, + "column": 28 + } + }, + "id": null, + "generator": false, + "expression": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 26, + "end": 28, + "loc": { + "start": { + "line": 1, + "column": 26 + }, + "end": { + "line": 1, + "column": 28 + } + }, + "body": [] + } + } + } + ] + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0278/options.json b/test/fixtures/esprima/invalid-syntax/migrated_0278/options.json new file mode 100644 index 0000000000..2a73699bc2 --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0278/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Unexpected token (1:18)" +} \ No newline at end of file diff --git a/test/fixtures/esprima/statement-block/migrated_0000/actual.js b/test/fixtures/esprima/statement-block/migrated_0000/actual.js new file mode 100644 index 0000000000..7a5352faf7 --- /dev/null +++ b/test/fixtures/esprima/statement-block/migrated_0000/actual.js @@ -0,0 +1 @@ +{ foo } diff --git a/test/fixtures/esprima/statement-block/migrated_0000/expected.json b/test/fixtures/esprima/statement-block/migrated_0000/expected.json new file mode 100644 index 0000000000..5d5053da91 --- /dev/null +++ b/test/fixtures/esprima/statement-block/migrated_0000/expected.json @@ -0,0 +1,81 @@ +{ + "type": "File", + "start": 0, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "sourceType": "script", + "body": [ + { + "type": "BlockStatement", + "start": 0, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "body": [ + { + "type": "ExpressionStatement", + "start": 2, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 2 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "expression": { + "type": "Identifier", + "start": 2, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 2 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "name": "foo" + } + } + ] + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/statement-block/migrated_0001/actual.js b/test/fixtures/esprima/statement-block/migrated_0001/actual.js new file mode 100644 index 0000000000..50a6ea322a --- /dev/null +++ b/test/fixtures/esprima/statement-block/migrated_0001/actual.js @@ -0,0 +1 @@ +{ doThis(); doThat(); } diff --git a/test/fixtures/esprima/statement-block/migrated_0001/expected.json b/test/fixtures/esprima/statement-block/migrated_0001/expected.json new file mode 100644 index 0000000000..eec6775871 --- /dev/null +++ b/test/fixtures/esprima/statement-block/migrated_0001/expected.json @@ -0,0 +1,144 @@ +{ + "type": "File", + "start": 0, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "sourceType": "script", + "body": [ + { + "type": "BlockStatement", + "start": 0, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "body": [ + { + "type": "ExpressionStatement", + "start": 2, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 2 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "expression": { + "type": "CallExpression", + "start": 2, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 2 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "callee": { + "type": "Identifier", + "start": 2, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 2 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "name": "doThis" + }, + "arguments": [] + } + }, + { + "type": "ExpressionStatement", + "start": 12, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 12 + }, + "end": { + "line": 1, + "column": 21 + } + }, + "expression": { + "type": "CallExpression", + "start": 12, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 12 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "callee": { + "type": "Identifier", + "start": 12, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 12 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "name": "doThat" + }, + "arguments": [] + } + } + ] + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/statement-block/migrated_0002/actual.js b/test/fixtures/esprima/statement-block/migrated_0002/actual.js new file mode 100644 index 0000000000..0967ef424b --- /dev/null +++ b/test/fixtures/esprima/statement-block/migrated_0002/actual.js @@ -0,0 +1 @@ +{} diff --git a/test/fixtures/esprima/statement-block/migrated_0002/expected.json b/test/fixtures/esprima/statement-block/migrated_0002/expected.json new file mode 100644 index 0000000000..5792211240 --- /dev/null +++ b/test/fixtures/esprima/statement-block/migrated_0002/expected.json @@ -0,0 +1,49 @@ +{ + "type": "File", + "start": 0, + "end": 2, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 2 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 2, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 2 + } + }, + "sourceType": "script", + "body": [ + { + "type": "BlockStatement", + "start": 0, + "end": 2, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 2 + } + }, + "body": [] + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/statement-break/migrated_0000/actual.js b/test/fixtures/esprima/statement-break/migrated_0000/actual.js new file mode 100644 index 0000000000..c566e0aa46 --- /dev/null +++ b/test/fixtures/esprima/statement-break/migrated_0000/actual.js @@ -0,0 +1 @@ +while (true) { break } diff --git a/test/fixtures/esprima/statement-break/migrated_0000/expected.json b/test/fixtures/esprima/statement-break/migrated_0000/expected.json new file mode 100644 index 0000000000..1d9fe4c071 --- /dev/null +++ b/test/fixtures/esprima/statement-break/migrated_0000/expected.json @@ -0,0 +1,99 @@ +{ + "type": "File", + "start": 0, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "sourceType": "script", + "body": [ + { + "type": "WhileStatement", + "start": 0, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "test": { + "type": "Literal", + "start": 7, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "value": true, + "rawValue": true, + "raw": "true" + }, + "body": { + "type": "BlockStatement", + "start": 13, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "body": [ + { + "type": "BreakStatement", + "start": 15, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "label": null + } + ] + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/statement-break/migrated_0001/actual.js b/test/fixtures/esprima/statement-break/migrated_0001/actual.js new file mode 100644 index 0000000000..9758f464a9 --- /dev/null +++ b/test/fixtures/esprima/statement-break/migrated_0001/actual.js @@ -0,0 +1 @@ +done: while (true) { break done } diff --git a/test/fixtures/esprima/statement-break/migrated_0001/expected.json b/test/fixtures/esprima/statement-break/migrated_0001/expected.json new file mode 100644 index 0000000000..de1ad554fa --- /dev/null +++ b/test/fixtures/esprima/statement-break/migrated_0001/expected.json @@ -0,0 +1,145 @@ +{ + "type": "File", + "start": 0, + "end": 33, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 33 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 33, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 33 + } + }, + "sourceType": "script", + "body": [ + { + "type": "LabeledStatement", + "start": 0, + "end": 33, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 33 + } + }, + "body": { + "type": "WhileStatement", + "start": 6, + "end": 33, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 33 + } + }, + "test": { + "type": "Literal", + "start": 13, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "value": true, + "rawValue": true, + "raw": "true" + }, + "body": { + "type": "BlockStatement", + "start": 19, + "end": 33, + "loc": { + "start": { + "line": 1, + "column": 19 + }, + "end": { + "line": 1, + "column": 33 + } + }, + "body": [ + { + "type": "BreakStatement", + "start": 21, + "end": 31, + "loc": { + "start": { + "line": 1, + "column": 21 + }, + "end": { + "line": 1, + "column": 31 + } + }, + "label": { + "type": "Identifier", + "start": 27, + "end": 31, + "loc": { + "start": { + "line": 1, + "column": 27 + }, + "end": { + "line": 1, + "column": 31 + } + }, + "name": "done" + } + } + ] + } + }, + "label": { + "type": "Identifier", + "start": 0, + "end": 4, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 4 + } + }, + "name": "done" + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/statement-break/migrated_0002/actual.js b/test/fixtures/esprima/statement-break/migrated_0002/actual.js new file mode 100644 index 0000000000..6e1ec8b25b --- /dev/null +++ b/test/fixtures/esprima/statement-break/migrated_0002/actual.js @@ -0,0 +1 @@ +done: while (true) { break done; } diff --git a/test/fixtures/esprima/statement-break/migrated_0002/expected.json b/test/fixtures/esprima/statement-break/migrated_0002/expected.json new file mode 100644 index 0000000000..62a3160e6e --- /dev/null +++ b/test/fixtures/esprima/statement-break/migrated_0002/expected.json @@ -0,0 +1,145 @@ +{ + "type": "File", + "start": 0, + "end": 34, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 34 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 34, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 34 + } + }, + "sourceType": "script", + "body": [ + { + "type": "LabeledStatement", + "start": 0, + "end": 34, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 34 + } + }, + "body": { + "type": "WhileStatement", + "start": 6, + "end": 34, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 34 + } + }, + "test": { + "type": "Literal", + "start": 13, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "value": true, + "rawValue": true, + "raw": "true" + }, + "body": { + "type": "BlockStatement", + "start": 19, + "end": 34, + "loc": { + "start": { + "line": 1, + "column": 19 + }, + "end": { + "line": 1, + "column": 34 + } + }, + "body": [ + { + "type": "BreakStatement", + "start": 21, + "end": 32, + "loc": { + "start": { + "line": 1, + "column": 21 + }, + "end": { + "line": 1, + "column": 32 + } + }, + "label": { + "type": "Identifier", + "start": 27, + "end": 31, + "loc": { + "start": { + "line": 1, + "column": 27 + }, + "end": { + "line": 1, + "column": 31 + } + }, + "name": "done" + } + } + ] + } + }, + "label": { + "type": "Identifier", + "start": 0, + "end": 4, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 4 + } + }, + "name": "done" + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/statement-break/migrated_0003/actual.js b/test/fixtures/esprima/statement-break/migrated_0003/actual.js new file mode 100644 index 0000000000..baafda3b83 --- /dev/null +++ b/test/fixtures/esprima/statement-break/migrated_0003/actual.js @@ -0,0 +1 @@ +__proto__: while (true) { break __proto__; } diff --git a/test/fixtures/esprima/statement-break/migrated_0003/expected.json b/test/fixtures/esprima/statement-break/migrated_0003/expected.json new file mode 100644 index 0000000000..afc5d3b147 --- /dev/null +++ b/test/fixtures/esprima/statement-break/migrated_0003/expected.json @@ -0,0 +1,145 @@ +{ + "type": "File", + "start": 0, + "end": 44, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 44 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 44, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 44 + } + }, + "sourceType": "script", + "body": [ + { + "type": "LabeledStatement", + "start": 0, + "end": 44, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 44 + } + }, + "body": { + "type": "WhileStatement", + "start": 11, + "end": 44, + "loc": { + "start": { + "line": 1, + "column": 11 + }, + "end": { + "line": 1, + "column": 44 + } + }, + "test": { + "type": "Literal", + "start": 18, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 18 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "value": true, + "rawValue": true, + "raw": "true" + }, + "body": { + "type": "BlockStatement", + "start": 24, + "end": 44, + "loc": { + "start": { + "line": 1, + "column": 24 + }, + "end": { + "line": 1, + "column": 44 + } + }, + "body": [ + { + "type": "BreakStatement", + "start": 26, + "end": 42, + "loc": { + "start": { + "line": 1, + "column": 26 + }, + "end": { + "line": 1, + "column": 42 + } + }, + "label": { + "type": "Identifier", + "start": 32, + "end": 41, + "loc": { + "start": { + "line": 1, + "column": 32 + }, + "end": { + "line": 1, + "column": 41 + } + }, + "name": "__proto__" + } + } + ] + } + }, + "label": { + "type": "Identifier", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "name": "__proto__" + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/statement-continue/migrated_0000/actual.js b/test/fixtures/esprima/statement-continue/migrated_0000/actual.js new file mode 100644 index 0000000000..f0c83b8f3d --- /dev/null +++ b/test/fixtures/esprima/statement-continue/migrated_0000/actual.js @@ -0,0 +1 @@ +while (true) { continue; } diff --git a/test/fixtures/esprima/statement-continue/migrated_0000/expected.json b/test/fixtures/esprima/statement-continue/migrated_0000/expected.json new file mode 100644 index 0000000000..9ea0854331 --- /dev/null +++ b/test/fixtures/esprima/statement-continue/migrated_0000/expected.json @@ -0,0 +1,99 @@ +{ + "type": "File", + "start": 0, + "end": 26, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 26 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 26, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 26 + } + }, + "sourceType": "script", + "body": [ + { + "type": "WhileStatement", + "start": 0, + "end": 26, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 26 + } + }, + "test": { + "type": "Literal", + "start": 7, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "value": true, + "rawValue": true, + "raw": "true" + }, + "body": { + "type": "BlockStatement", + "start": 13, + "end": 26, + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 1, + "column": 26 + } + }, + "body": [ + { + "type": "ContinueStatement", + "start": 15, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 24 + } + }, + "label": null + } + ] + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/statement-continue/migrated_0001/actual.js b/test/fixtures/esprima/statement-continue/migrated_0001/actual.js new file mode 100644 index 0000000000..211bd08851 --- /dev/null +++ b/test/fixtures/esprima/statement-continue/migrated_0001/actual.js @@ -0,0 +1 @@ +while (true) { continue } diff --git a/test/fixtures/esprima/statement-continue/migrated_0001/expected.json b/test/fixtures/esprima/statement-continue/migrated_0001/expected.json new file mode 100644 index 0000000000..3cadc13b16 --- /dev/null +++ b/test/fixtures/esprima/statement-continue/migrated_0001/expected.json @@ -0,0 +1,99 @@ +{ + "type": "File", + "start": 0, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 25 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 25 + } + }, + "sourceType": "script", + "body": [ + { + "type": "WhileStatement", + "start": 0, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 25 + } + }, + "test": { + "type": "Literal", + "start": 7, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "value": true, + "rawValue": true, + "raw": "true" + }, + "body": { + "type": "BlockStatement", + "start": 13, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 1, + "column": 25 + } + }, + "body": [ + { + "type": "ContinueStatement", + "start": 15, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "label": null + } + ] + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/statement-continue/migrated_0002/actual.js b/test/fixtures/esprima/statement-continue/migrated_0002/actual.js new file mode 100644 index 0000000000..aefcf0471a --- /dev/null +++ b/test/fixtures/esprima/statement-continue/migrated_0002/actual.js @@ -0,0 +1 @@ +done: while (true) { continue done } diff --git a/test/fixtures/esprima/statement-continue/migrated_0002/expected.json b/test/fixtures/esprima/statement-continue/migrated_0002/expected.json new file mode 100644 index 0000000000..661b7b9d0a --- /dev/null +++ b/test/fixtures/esprima/statement-continue/migrated_0002/expected.json @@ -0,0 +1,145 @@ +{ + "type": "File", + "start": 0, + "end": 36, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 36 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 36, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 36 + } + }, + "sourceType": "script", + "body": [ + { + "type": "LabeledStatement", + "start": 0, + "end": 36, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 36 + } + }, + "body": { + "type": "WhileStatement", + "start": 6, + "end": 36, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 36 + } + }, + "test": { + "type": "Literal", + "start": 13, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "value": true, + "rawValue": true, + "raw": "true" + }, + "body": { + "type": "BlockStatement", + "start": 19, + "end": 36, + "loc": { + "start": { + "line": 1, + "column": 19 + }, + "end": { + "line": 1, + "column": 36 + } + }, + "body": [ + { + "type": "ContinueStatement", + "start": 21, + "end": 34, + "loc": { + "start": { + "line": 1, + "column": 21 + }, + "end": { + "line": 1, + "column": 34 + } + }, + "label": { + "type": "Identifier", + "start": 30, + "end": 34, + "loc": { + "start": { + "line": 1, + "column": 30 + }, + "end": { + "line": 1, + "column": 34 + } + }, + "name": "done" + } + } + ] + } + }, + "label": { + "type": "Identifier", + "start": 0, + "end": 4, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 4 + } + }, + "name": "done" + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/statement-continue/migrated_0003/actual.js b/test/fixtures/esprima/statement-continue/migrated_0003/actual.js new file mode 100644 index 0000000000..c2c6225464 --- /dev/null +++ b/test/fixtures/esprima/statement-continue/migrated_0003/actual.js @@ -0,0 +1 @@ +done: while (true) { continue done; } diff --git a/test/fixtures/esprima/statement-continue/migrated_0003/expected.json b/test/fixtures/esprima/statement-continue/migrated_0003/expected.json new file mode 100644 index 0000000000..3c06ab2a96 --- /dev/null +++ b/test/fixtures/esprima/statement-continue/migrated_0003/expected.json @@ -0,0 +1,145 @@ +{ + "type": "File", + "start": 0, + "end": 37, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 37 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 37, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 37 + } + }, + "sourceType": "script", + "body": [ + { + "type": "LabeledStatement", + "start": 0, + "end": 37, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 37 + } + }, + "body": { + "type": "WhileStatement", + "start": 6, + "end": 37, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 37 + } + }, + "test": { + "type": "Literal", + "start": 13, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "value": true, + "rawValue": true, + "raw": "true" + }, + "body": { + "type": "BlockStatement", + "start": 19, + "end": 37, + "loc": { + "start": { + "line": 1, + "column": 19 + }, + "end": { + "line": 1, + "column": 37 + } + }, + "body": [ + { + "type": "ContinueStatement", + "start": 21, + "end": 35, + "loc": { + "start": { + "line": 1, + "column": 21 + }, + "end": { + "line": 1, + "column": 35 + } + }, + "label": { + "type": "Identifier", + "start": 30, + "end": 34, + "loc": { + "start": { + "line": 1, + "column": 30 + }, + "end": { + "line": 1, + "column": 34 + } + }, + "name": "done" + } + } + ] + } + }, + "label": { + "type": "Identifier", + "start": 0, + "end": 4, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 4 + } + }, + "name": "done" + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/statement-continue/migrated_0004/actual.js b/test/fixtures/esprima/statement-continue/migrated_0004/actual.js new file mode 100644 index 0000000000..c431504a7e --- /dev/null +++ b/test/fixtures/esprima/statement-continue/migrated_0004/actual.js @@ -0,0 +1 @@ +__proto__: while (true) { continue __proto__; } diff --git a/test/fixtures/esprima/statement-continue/migrated_0004/expected.json b/test/fixtures/esprima/statement-continue/migrated_0004/expected.json new file mode 100644 index 0000000000..9df58ecc04 --- /dev/null +++ b/test/fixtures/esprima/statement-continue/migrated_0004/expected.json @@ -0,0 +1,145 @@ +{ + "type": "File", + "start": 0, + "end": 47, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 47 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 47, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 47 + } + }, + "sourceType": "script", + "body": [ + { + "type": "LabeledStatement", + "start": 0, + "end": 47, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 47 + } + }, + "body": { + "type": "WhileStatement", + "start": 11, + "end": 47, + "loc": { + "start": { + "line": 1, + "column": 11 + }, + "end": { + "line": 1, + "column": 47 + } + }, + "test": { + "type": "Literal", + "start": 18, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 18 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "value": true, + "rawValue": true, + "raw": "true" + }, + "body": { + "type": "BlockStatement", + "start": 24, + "end": 47, + "loc": { + "start": { + "line": 1, + "column": 24 + }, + "end": { + "line": 1, + "column": 47 + } + }, + "body": [ + { + "type": "ContinueStatement", + "start": 26, + "end": 45, + "loc": { + "start": { + "line": 1, + "column": 26 + }, + "end": { + "line": 1, + "column": 45 + } + }, + "label": { + "type": "Identifier", + "start": 35, + "end": 44, + "loc": { + "start": { + "line": 1, + "column": 35 + }, + "end": { + "line": 1, + "column": 44 + } + }, + "name": "__proto__" + } + } + ] + } + }, + "label": { + "type": "Identifier", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "name": "__proto__" + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/statement-debugger/migrated_0000/actual.js b/test/fixtures/esprima/statement-debugger/migrated_0000/actual.js new file mode 100644 index 0000000000..eab7469213 --- /dev/null +++ b/test/fixtures/esprima/statement-debugger/migrated_0000/actual.js @@ -0,0 +1 @@ +debugger; diff --git a/test/fixtures/esprima/statement-debugger/migrated_0000/expected.json b/test/fixtures/esprima/statement-debugger/migrated_0000/expected.json new file mode 100644 index 0000000000..bf36100cfe --- /dev/null +++ b/test/fixtures/esprima/statement-debugger/migrated_0000/expected.json @@ -0,0 +1,48 @@ +{ + "type": "File", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "sourceType": "script", + "body": [ + { + "type": "DebuggerStatement", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + } + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/statement-empty/migrated_0000/actual.js b/test/fixtures/esprima/statement-empty/migrated_0000/actual.js new file mode 100644 index 0000000000..092bc2b041 --- /dev/null +++ b/test/fixtures/esprima/statement-empty/migrated_0000/actual.js @@ -0,0 +1 @@ +; diff --git a/test/fixtures/esprima/statement-empty/migrated_0000/expected.json b/test/fixtures/esprima/statement-empty/migrated_0000/expected.json new file mode 100644 index 0000000000..d76894f1aa --- /dev/null +++ b/test/fixtures/esprima/statement-empty/migrated_0000/expected.json @@ -0,0 +1,48 @@ +{ + "type": "File", + "start": 0, + "end": 1, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 1, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + } + }, + "sourceType": "script", + "body": [ + { + "type": "EmptyStatement", + "start": 0, + "end": 1, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + } + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/statement-expression/migrated_0000/actual.js b/test/fixtures/esprima/statement-expression/migrated_0000/actual.js new file mode 100644 index 0000000000..587be6b4c3 --- /dev/null +++ b/test/fixtures/esprima/statement-expression/migrated_0000/actual.js @@ -0,0 +1 @@ +x diff --git a/test/fixtures/esprima/statement-expression/migrated_0000/expected.json b/test/fixtures/esprima/statement-expression/migrated_0000/expected.json new file mode 100644 index 0000000000..470ad995ab --- /dev/null +++ b/test/fixtures/esprima/statement-expression/migrated_0000/expected.json @@ -0,0 +1,64 @@ +{ + "type": "File", + "start": 0, + "end": 1, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 1, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 1, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + } + }, + "expression": { + "type": "Identifier", + "start": 0, + "end": 1, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + } + }, + "name": "x" + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/statement-expression/migrated_0001/actual.js b/test/fixtures/esprima/statement-expression/migrated_0001/actual.js new file mode 100644 index 0000000000..b1c634757a --- /dev/null +++ b/test/fixtures/esprima/statement-expression/migrated_0001/actual.js @@ -0,0 +1 @@ +x, y diff --git a/test/fixtures/esprima/statement-expression/migrated_0001/expected.json b/test/fixtures/esprima/statement-expression/migrated_0001/expected.json new file mode 100644 index 0000000000..a1f0e67018 --- /dev/null +++ b/test/fixtures/esprima/statement-expression/migrated_0001/expected.json @@ -0,0 +1,97 @@ +{ + "type": "File", + "start": 0, + "end": 4, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 4 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 4, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 4 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 4, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 4 + } + }, + "expression": { + "type": "SequenceExpression", + "start": 0, + "end": 4, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 4 + } + }, + "expressions": [ + { + "type": "Identifier", + "start": 0, + "end": 1, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + } + }, + "name": "x" + }, + { + "type": "Identifier", + "start": 3, + "end": 4, + "loc": { + "start": { + "line": 1, + "column": 3 + }, + "end": { + "line": 1, + "column": 4 + } + }, + "name": "y" + } + ] + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/statement-expression/migrated_0002/actual.js b/test/fixtures/esprima/statement-expression/migrated_0002/actual.js new file mode 100644 index 0000000000..389d745825 --- /dev/null +++ b/test/fixtures/esprima/statement-expression/migrated_0002/actual.js @@ -0,0 +1 @@ +var source = '\\u0061'; diff --git a/test/fixtures/esprima/statement-expression/migrated_0002/expected.json b/test/fixtures/esprima/statement-expression/migrated_0002/expected.json new file mode 100644 index 0000000000..6ba5acf72c --- /dev/null +++ b/test/fixtures/esprima/statement-expression/migrated_0002/expected.json @@ -0,0 +1,100 @@ +{ + "type": "File", + "start": 0, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "sourceType": "script", + "body": [ + { + "type": "VariableDeclaration", + "start": 0, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 4, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "id": { + "type": "Identifier", + "start": 4, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "name": "source" + }, + "init": { + "type": "Literal", + "start": 13, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "value": "\\u0061", + "rawValue": "\\u0061", + "raw": "'\\\\u0061'" + } + } + ], + "kind": "var" + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/statement-expression/migrated_0003/actual.js b/test/fixtures/esprima/statement-expression/migrated_0003/actual.js new file mode 100644 index 0000000000..6524a1c4cf --- /dev/null +++ b/test/fixtures/esprima/statement-expression/migrated_0003/actual.js @@ -0,0 +1 @@ +var source = 'a\\u0061'; diff --git a/test/fixtures/esprima/statement-expression/migrated_0003/expected.json b/test/fixtures/esprima/statement-expression/migrated_0003/expected.json new file mode 100644 index 0000000000..f78a5fc028 --- /dev/null +++ b/test/fixtures/esprima/statement-expression/migrated_0003/expected.json @@ -0,0 +1,100 @@ +{ + "type": "File", + "start": 0, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 24 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 24 + } + }, + "sourceType": "script", + "body": [ + { + "type": "VariableDeclaration", + "start": 0, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 24 + } + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 4, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "id": { + "type": "Identifier", + "start": 4, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "name": "source" + }, + "init": { + "type": "Literal", + "start": 13, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "value": "a\\u0061", + "rawValue": "a\\u0061", + "raw": "'a\\\\u0061'" + } + } + ], + "kind": "var" + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/statement-expression/migrated_0004/actual.js b/test/fixtures/esprima/statement-expression/migrated_0004/actual.js new file mode 100644 index 0000000000..d4941e9313 --- /dev/null +++ b/test/fixtures/esprima/statement-expression/migrated_0004/actual.js @@ -0,0 +1 @@ +var source = '\\u0061a'; diff --git a/test/fixtures/esprima/statement-expression/migrated_0004/expected.json b/test/fixtures/esprima/statement-expression/migrated_0004/expected.json new file mode 100644 index 0000000000..cf73b407c2 --- /dev/null +++ b/test/fixtures/esprima/statement-expression/migrated_0004/expected.json @@ -0,0 +1,100 @@ +{ + "type": "File", + "start": 0, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 24 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 24 + } + }, + "sourceType": "script", + "body": [ + { + "type": "VariableDeclaration", + "start": 0, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 24 + } + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 4, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "id": { + "type": "Identifier", + "start": 4, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "name": "source" + }, + "init": { + "type": "Literal", + "start": 13, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "value": "\\u0061a", + "rawValue": "\\u0061a", + "raw": "'\\\\u0061a'" + } + } + ], + "kind": "var" + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/statement-expression/migrated_0005/actual.js b/test/fixtures/esprima/statement-expression/migrated_0005/actual.js new file mode 100644 index 0000000000..8e5a088c93 --- /dev/null +++ b/test/fixtures/esprima/statement-expression/migrated_0005/actual.js @@ -0,0 +1 @@ +var source = '\\u0061a '; diff --git a/test/fixtures/esprima/statement-expression/migrated_0005/expected.json b/test/fixtures/esprima/statement-expression/migrated_0005/expected.json new file mode 100644 index 0000000000..ab84cdb1ac --- /dev/null +++ b/test/fixtures/esprima/statement-expression/migrated_0005/expected.json @@ -0,0 +1,100 @@ +{ + "type": "File", + "start": 0, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 25 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 25 + } + }, + "sourceType": "script", + "body": [ + { + "type": "VariableDeclaration", + "start": 0, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 25 + } + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 4, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 24 + } + }, + "id": { + "type": "Identifier", + "start": 4, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "name": "source" + }, + "init": { + "type": "Literal", + "start": 13, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 1, + "column": 24 + } + }, + "value": "\\u0061a ", + "rawValue": "\\u0061a ", + "raw": "'\\\\u0061a '" + } + } + ], + "kind": "var" + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/statement-if/migrated_0000/actual.js b/test/fixtures/esprima/statement-if/migrated_0000/actual.js new file mode 100644 index 0000000000..a9fa4ad3a8 --- /dev/null +++ b/test/fixtures/esprima/statement-if/migrated_0000/actual.js @@ -0,0 +1 @@ +if (morning) goodMorning() diff --git a/test/fixtures/esprima/statement-if/migrated_0000/expected.json b/test/fixtures/esprima/statement-if/migrated_0000/expected.json new file mode 100644 index 0000000000..61f0887961 --- /dev/null +++ b/test/fixtures/esprima/statement-if/migrated_0000/expected.json @@ -0,0 +1,112 @@ +{ + "type": "File", + "start": 0, + "end": 26, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 26 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 26, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 26 + } + }, + "sourceType": "script", + "body": [ + { + "type": "IfStatement", + "start": 0, + "end": 26, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 26 + } + }, + "test": { + "type": "Identifier", + "start": 4, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "name": "morning" + }, + "consequent": { + "type": "ExpressionStatement", + "start": 13, + "end": 26, + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 1, + "column": 26 + } + }, + "expression": { + "type": "CallExpression", + "start": 13, + "end": 26, + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 1, + "column": 26 + } + }, + "callee": { + "type": "Identifier", + "start": 13, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 1, + "column": 24 + } + }, + "name": "goodMorning" + }, + "arguments": [] + } + }, + "alternate": null + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/statement-if/migrated_0001/actual.js b/test/fixtures/esprima/statement-if/migrated_0001/actual.js new file mode 100644 index 0000000000..ceaffa6308 --- /dev/null +++ b/test/fixtures/esprima/statement-if/migrated_0001/actual.js @@ -0,0 +1 @@ +if (morning) (function(){}) diff --git a/test/fixtures/esprima/statement-if/migrated_0001/expected.json b/test/fixtures/esprima/statement-if/migrated_0001/expected.json new file mode 100644 index 0000000000..97e2c0b335 --- /dev/null +++ b/test/fixtures/esprima/statement-if/migrated_0001/expected.json @@ -0,0 +1,116 @@ +{ + "type": "File", + "start": 0, + "end": 27, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 27 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 27, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 27 + } + }, + "sourceType": "script", + "body": [ + { + "type": "IfStatement", + "start": 0, + "end": 27, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 27 + } + }, + "test": { + "type": "Identifier", + "start": 4, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "name": "morning" + }, + "consequent": { + "type": "ExpressionStatement", + "start": 13, + "end": 27, + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 1, + "column": 27 + } + }, + "expression": { + "type": "FunctionExpression", + "start": 14, + "end": 26, + "loc": { + "start": { + "line": 1, + "column": 14 + }, + "end": { + "line": 1, + "column": 26 + } + }, + "id": null, + "generator": false, + "expression": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 24, + "end": 26, + "loc": { + "start": { + "line": 1, + "column": 24 + }, + "end": { + "line": 1, + "column": 26 + } + }, + "body": [] + }, + "parenthesizedExpression": true + } + }, + "alternate": null + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/statement-if/migrated_0002/actual.js b/test/fixtures/esprima/statement-if/migrated_0002/actual.js new file mode 100644 index 0000000000..8bc4513d98 --- /dev/null +++ b/test/fixtures/esprima/statement-if/migrated_0002/actual.js @@ -0,0 +1 @@ +if (morning) var x = 0; diff --git a/test/fixtures/esprima/statement-if/migrated_0002/expected.json b/test/fixtures/esprima/statement-if/migrated_0002/expected.json new file mode 100644 index 0000000000..c1930814e6 --- /dev/null +++ b/test/fixtures/esprima/statement-if/migrated_0002/expected.json @@ -0,0 +1,132 @@ +{ + "type": "File", + "start": 0, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "sourceType": "script", + "body": [ + { + "type": "IfStatement", + "start": 0, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "test": { + "type": "Identifier", + "start": 4, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "name": "morning" + }, + "consequent": { + "type": "VariableDeclaration", + "start": 13, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 17, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 17 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "id": { + "type": "Identifier", + "start": 17, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 17 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "name": "x" + }, + "init": { + "type": "Literal", + "start": 21, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 21 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "value": 0, + "rawValue": 0, + "raw": "0" + } + } + ], + "kind": "var" + }, + "alternate": null + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/statement-if/migrated_0003/actual.js b/test/fixtures/esprima/statement-if/migrated_0003/actual.js new file mode 100644 index 0000000000..04cb30d31b --- /dev/null +++ b/test/fixtures/esprima/statement-if/migrated_0003/actual.js @@ -0,0 +1 @@ +if (morning) function a(){} diff --git a/test/fixtures/esprima/statement-if/migrated_0004/actual.js b/test/fixtures/esprima/statement-if/migrated_0004/actual.js new file mode 100644 index 0000000000..e7e476724b --- /dev/null +++ b/test/fixtures/esprima/statement-if/migrated_0004/actual.js @@ -0,0 +1 @@ +if (morning) goodMorning(); else goodDay() diff --git a/test/fixtures/esprima/statement-if/migrated_0004/expected.json b/test/fixtures/esprima/statement-if/migrated_0004/expected.json new file mode 100644 index 0000000000..720f53798d --- /dev/null +++ b/test/fixtures/esprima/statement-if/migrated_0004/expected.json @@ -0,0 +1,158 @@ +{ + "type": "File", + "start": 0, + "end": 42, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 42 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 42, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 42 + } + }, + "sourceType": "script", + "body": [ + { + "type": "IfStatement", + "start": 0, + "end": 42, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 42 + } + }, + "test": { + "type": "Identifier", + "start": 4, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "name": "morning" + }, + "consequent": { + "type": "ExpressionStatement", + "start": 13, + "end": 27, + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 1, + "column": 27 + } + }, + "expression": { + "type": "CallExpression", + "start": 13, + "end": 26, + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 1, + "column": 26 + } + }, + "callee": { + "type": "Identifier", + "start": 13, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 1, + "column": 24 + } + }, + "name": "goodMorning" + }, + "arguments": [] + } + }, + "alternate": { + "type": "ExpressionStatement", + "start": 33, + "end": 42, + "loc": { + "start": { + "line": 1, + "column": 33 + }, + "end": { + "line": 1, + "column": 42 + } + }, + "expression": { + "type": "CallExpression", + "start": 33, + "end": 42, + "loc": { + "start": { + "line": 1, + "column": 33 + }, + "end": { + "line": 1, + "column": 42 + } + }, + "callee": { + "type": "Identifier", + "start": 33, + "end": 40, + "loc": { + "start": { + "line": 1, + "column": 33 + }, + "end": { + "line": 1, + "column": 40 + } + }, + "name": "goodDay" + }, + "arguments": [] + } + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/statement-if/migrated_0005/actual.js b/test/fixtures/esprima/statement-if/migrated_0005/actual.js new file mode 100644 index 0000000000..893e85746c --- /dev/null +++ b/test/fixtures/esprima/statement-if/migrated_0005/actual.js @@ -0,0 +1,2 @@ +if (true) that() +; else; diff --git a/test/fixtures/esprima/statement-if/migrated_0005/expected.json b/test/fixtures/esprima/statement-if/migrated_0005/expected.json new file mode 100644 index 0000000000..bede5565cc --- /dev/null +++ b/test/fixtures/esprima/statement-if/migrated_0005/expected.json @@ -0,0 +1,128 @@ +{ + "type": "File", + "start": 0, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 7 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 7 + } + }, + "sourceType": "script", + "body": [ + { + "type": "IfStatement", + "start": 0, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 7 + } + }, + "test": { + "type": "Literal", + "start": 4, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "value": true, + "rawValue": true, + "raw": "true" + }, + "consequent": { + "type": "ExpressionStatement", + "start": 10, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 2, + "column": 1 + } + }, + "expression": { + "type": "CallExpression", + "start": 10, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "callee": { + "type": "Identifier", + "start": 10, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "name": "that" + }, + "arguments": [] + } + }, + "alternate": { + "type": "EmptyStatement", + "start": 23, + "end": 24, + "loc": { + "start": { + "line": 2, + "column": 6 + }, + "end": { + "line": 2, + "column": 7 + } + } + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/statement-if/migrated_0006/actual.js b/test/fixtures/esprima/statement-if/migrated_0006/actual.js new file mode 100644 index 0000000000..4253fa10bc --- /dev/null +++ b/test/fixtures/esprima/statement-if/migrated_0006/actual.js @@ -0,0 +1 @@ +if (true) that(); else; diff --git a/test/fixtures/esprima/statement-if/migrated_0006/expected.json b/test/fixtures/esprima/statement-if/migrated_0006/expected.json new file mode 100644 index 0000000000..79b23952bd --- /dev/null +++ b/test/fixtures/esprima/statement-if/migrated_0006/expected.json @@ -0,0 +1,128 @@ +{ + "type": "File", + "start": 0, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "sourceType": "script", + "body": [ + { + "type": "IfStatement", + "start": 0, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "test": { + "type": "Literal", + "start": 4, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "value": true, + "rawValue": true, + "raw": "true" + }, + "consequent": { + "type": "ExpressionStatement", + "start": 10, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "expression": { + "type": "CallExpression", + "start": 10, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "callee": { + "type": "Identifier", + "start": 10, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "name": "that" + }, + "arguments": [] + } + }, + "alternate": { + "type": "EmptyStatement", + "start": 22, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 22 + }, + "end": { + "line": 1, + "column": 23 + } + } + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/statement-iteration/const_forin/actual.js b/test/fixtures/esprima/statement-iteration/const_forin/actual.js new file mode 100644 index 0000000000..48da176a2b --- /dev/null +++ b/test/fixtures/esprima/statement-iteration/const_forin/actual.js @@ -0,0 +1 @@ +for (const x in list) process(x); diff --git a/test/fixtures/esprima/statement-iteration/const_forin/expected.json b/test/fixtures/esprima/statement-iteration/const_forin/expected.json new file mode 100644 index 0000000000..24f754ab5a --- /dev/null +++ b/test/fixtures/esprima/statement-iteration/const_forin/expected.json @@ -0,0 +1,178 @@ +{ + "type": "File", + "start": 0, + "end": 33, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 33 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 33, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 33 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ForInStatement", + "start": 0, + "end": 33, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 33 + } + }, + "left": { + "type": "VariableDeclaration", + "start": 5, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 11, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 11 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "id": { + "type": "Identifier", + "start": 11, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 11 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "name": "x" + }, + "init": null + } + ], + "kind": "const" + }, + "right": { + "type": "Identifier", + "start": 16, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 16 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "name": "list" + }, + "body": { + "type": "ExpressionStatement", + "start": 22, + "end": 33, + "loc": { + "start": { + "line": 1, + "column": 22 + }, + "end": { + "line": 1, + "column": 33 + } + }, + "expression": { + "type": "CallExpression", + "start": 22, + "end": 32, + "loc": { + "start": { + "line": 1, + "column": 22 + }, + "end": { + "line": 1, + "column": 32 + } + }, + "callee": { + "type": "Identifier", + "start": 22, + "end": 29, + "loc": { + "start": { + "line": 1, + "column": 22 + }, + "end": { + "line": 1, + "column": 29 + } + }, + "name": "process" + }, + "arguments": [ + { + "type": "Identifier", + "start": 30, + "end": 31, + "loc": { + "start": { + "line": 1, + "column": 30 + }, + "end": { + "line": 1, + "column": 31 + } + }, + "name": "x" + } + ] + } + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/statement-iteration/for-statement-with-seq/actual.js b/test/fixtures/esprima/statement-iteration/for-statement-with-seq/actual.js new file mode 100644 index 0000000000..b44b084362 --- /dev/null +++ b/test/fixtures/esprima/statement-iteration/for-statement-with-seq/actual.js @@ -0,0 +1 @@ +for(a,b,c;;); diff --git a/test/fixtures/esprima/statement-iteration/for-statement-with-seq/expected.json b/test/fixtures/esprima/statement-iteration/for-statement-with-seq/expected.json new file mode 100644 index 0000000000..caaf4a9a96 --- /dev/null +++ b/test/fixtures/esprima/statement-iteration/for-statement-with-seq/expected.json @@ -0,0 +1,130 @@ +{ + "type": "File", + "start": 0, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ForStatement", + "start": 0, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "init": { + "type": "SequenceExpression", + "start": 4, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "expressions": [ + { + "type": "Identifier", + "start": 4, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "name": "a" + }, + { + "type": "Identifier", + "start": 6, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "name": "b" + }, + { + "type": "Identifier", + "start": 8, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "name": "c" + } + ] + }, + "test": null, + "update": null, + "body": { + "type": "EmptyStatement", + "start": 12, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 12 + }, + "end": { + "line": 1, + "column": 13 + } + } + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/statement-iteration/migrated_0000/actual.js b/test/fixtures/esprima/statement-iteration/migrated_0000/actual.js new file mode 100644 index 0000000000..02e1c8fda3 --- /dev/null +++ b/test/fixtures/esprima/statement-iteration/migrated_0000/actual.js @@ -0,0 +1 @@ +do keep(); while (true) diff --git a/test/fixtures/esprima/statement-iteration/migrated_0000/expected.json b/test/fixtures/esprima/statement-iteration/migrated_0000/expected.json new file mode 100644 index 0000000000..a065c54055 --- /dev/null +++ b/test/fixtures/esprima/statement-iteration/migrated_0000/expected.json @@ -0,0 +1,113 @@ +{ + "type": "File", + "start": 0, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "sourceType": "script", + "body": [ + { + "type": "DoWhileStatement", + "start": 0, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "body": { + "type": "ExpressionStatement", + "start": 3, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 3 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "expression": { + "type": "CallExpression", + "start": 3, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 3 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "callee": { + "type": "Identifier", + "start": 3, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 3 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "name": "keep" + }, + "arguments": [] + } + }, + "test": { + "type": "Literal", + "start": 18, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 18 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "value": true, + "rawValue": true, + "raw": "true" + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/statement-iteration/migrated_0001/actual.js b/test/fixtures/esprima/statement-iteration/migrated_0001/actual.js new file mode 100644 index 0000000000..25668b5db4 --- /dev/null +++ b/test/fixtures/esprima/statement-iteration/migrated_0001/actual.js @@ -0,0 +1 @@ +do keep(); while (true); diff --git a/test/fixtures/esprima/statement-iteration/migrated_0001/expected.json b/test/fixtures/esprima/statement-iteration/migrated_0001/expected.json new file mode 100644 index 0000000000..bcc441a257 --- /dev/null +++ b/test/fixtures/esprima/statement-iteration/migrated_0001/expected.json @@ -0,0 +1,113 @@ +{ + "type": "File", + "start": 0, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 24 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 24 + } + }, + "sourceType": "script", + "body": [ + { + "type": "DoWhileStatement", + "start": 0, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 24 + } + }, + "body": { + "type": "ExpressionStatement", + "start": 3, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 3 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "expression": { + "type": "CallExpression", + "start": 3, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 3 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "callee": { + "type": "Identifier", + "start": 3, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 3 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "name": "keep" + }, + "arguments": [] + } + }, + "test": { + "type": "Literal", + "start": 18, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 18 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "value": true, + "rawValue": true, + "raw": "true" + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/statement-iteration/migrated_0002/actual.js b/test/fixtures/esprima/statement-iteration/migrated_0002/actual.js new file mode 100644 index 0000000000..7c6b478431 --- /dev/null +++ b/test/fixtures/esprima/statement-iteration/migrated_0002/actual.js @@ -0,0 +1 @@ +do { x++; y--; } while (x < 10) diff --git a/test/fixtures/esprima/statement-iteration/migrated_0002/expected.json b/test/fixtures/esprima/statement-iteration/migrated_0002/expected.json new file mode 100644 index 0000000000..09c2e86050 --- /dev/null +++ b/test/fixtures/esprima/statement-iteration/migrated_0002/expected.json @@ -0,0 +1,211 @@ +{ + "type": "File", + "start": 0, + "end": 31, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 31 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 31, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 31 + } + }, + "sourceType": "script", + "body": [ + { + "type": "DoWhileStatement", + "start": 0, + "end": 31, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 31 + } + }, + "body": { + "type": "BlockStatement", + "start": 3, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 3 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "body": [ + { + "type": "ExpressionStatement", + "start": 5, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "expression": { + "type": "UpdateExpression", + "start": 5, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "operator": "++", + "prefix": false, + "argument": { + "type": "Identifier", + "start": 5, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "name": "x" + } + } + }, + { + "type": "ExpressionStatement", + "start": 10, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "expression": { + "type": "UpdateExpression", + "start": 10, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "operator": "--", + "prefix": false, + "argument": { + "type": "Identifier", + "start": 10, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "name": "y" + } + } + } + ] + }, + "test": { + "type": "BinaryExpression", + "start": 24, + "end": 30, + "loc": { + "start": { + "line": 1, + "column": 24 + }, + "end": { + "line": 1, + "column": 30 + } + }, + "left": { + "type": "Identifier", + "start": 24, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 24 + }, + "end": { + "line": 1, + "column": 25 + } + }, + "name": "x" + }, + "operator": "<", + "right": { + "type": "Literal", + "start": 28, + "end": 30, + "loc": { + "start": { + "line": 1, + "column": 28 + }, + "end": { + "line": 1, + "column": 30 + } + }, + "value": 10, + "rawValue": 10, + "raw": "10" + } + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/statement-iteration/migrated_0003/actual.js b/test/fixtures/esprima/statement-iteration/migrated_0003/actual.js new file mode 100644 index 0000000000..d766db4e65 --- /dev/null +++ b/test/fixtures/esprima/statement-iteration/migrated_0003/actual.js @@ -0,0 +1 @@ +{ do { } while (false) false } diff --git a/test/fixtures/esprima/statement-iteration/migrated_0003/expected.json b/test/fixtures/esprima/statement-iteration/migrated_0003/expected.json new file mode 100644 index 0000000000..7a2fd03273 --- /dev/null +++ b/test/fixtures/esprima/statement-iteration/migrated_0003/expected.json @@ -0,0 +1,132 @@ +{ + "type": "File", + "start": 0, + "end": 30, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 30 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 30, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 30 + } + }, + "sourceType": "script", + "body": [ + { + "type": "BlockStatement", + "start": 0, + "end": 30, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 30 + } + }, + "body": [ + { + "type": "DoWhileStatement", + "start": 2, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 2 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "body": { + "type": "BlockStatement", + "start": 5, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "body": [] + }, + "test": { + "type": "Literal", + "start": 16, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 16 + }, + "end": { + "line": 1, + "column": 21 + } + }, + "value": false, + "rawValue": false, + "raw": "false" + } + }, + { + "type": "ExpressionStatement", + "start": 23, + "end": 28, + "loc": { + "start": { + "line": 1, + "column": 23 + }, + "end": { + "line": 1, + "column": 28 + } + }, + "expression": { + "type": "Literal", + "start": 23, + "end": 28, + "loc": { + "start": { + "line": 1, + "column": 23 + }, + "end": { + "line": 1, + "column": 28 + } + }, + "value": false, + "rawValue": false, + "raw": "false" + } + } + ] + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/statement-iteration/migrated_0004/actual.js b/test/fixtures/esprima/statement-iteration/migrated_0004/actual.js new file mode 100644 index 0000000000..d36ffddeff --- /dev/null +++ b/test/fixtures/esprima/statement-iteration/migrated_0004/actual.js @@ -0,0 +1 @@ +do that();while (true) diff --git a/test/fixtures/esprima/statement-iteration/migrated_0004/expected.json b/test/fixtures/esprima/statement-iteration/migrated_0004/expected.json new file mode 100644 index 0000000000..a3c55814f4 --- /dev/null +++ b/test/fixtures/esprima/statement-iteration/migrated_0004/expected.json @@ -0,0 +1,113 @@ +{ + "type": "File", + "start": 0, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "sourceType": "script", + "body": [ + { + "type": "DoWhileStatement", + "start": 0, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "body": { + "type": "ExpressionStatement", + "start": 3, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 3 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "expression": { + "type": "CallExpression", + "start": 3, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 3 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "callee": { + "type": "Identifier", + "start": 3, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 3 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "name": "that" + }, + "arguments": [] + } + }, + "test": { + "type": "Literal", + "start": 17, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 17 + }, + "end": { + "line": 1, + "column": 21 + } + }, + "value": true, + "rawValue": true, + "raw": "true" + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/statement-iteration/migrated_0005/actual.js b/test/fixtures/esprima/statement-iteration/migrated_0005/actual.js new file mode 100644 index 0000000000..4977449830 --- /dev/null +++ b/test/fixtures/esprima/statement-iteration/migrated_0005/actual.js @@ -0,0 +1,2 @@ +do that() +;while (true) diff --git a/test/fixtures/esprima/statement-iteration/migrated_0005/expected.json b/test/fixtures/esprima/statement-iteration/migrated_0005/expected.json new file mode 100644 index 0000000000..1ee7296f46 --- /dev/null +++ b/test/fixtures/esprima/statement-iteration/migrated_0005/expected.json @@ -0,0 +1,113 @@ +{ + "type": "File", + "start": 0, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 13 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 13 + } + }, + "sourceType": "script", + "body": [ + { + "type": "DoWhileStatement", + "start": 0, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 13 + } + }, + "body": { + "type": "ExpressionStatement", + "start": 3, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 3 + }, + "end": { + "line": 2, + "column": 1 + } + }, + "expression": { + "type": "CallExpression", + "start": 3, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 3 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "callee": { + "type": "Identifier", + "start": 3, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 3 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "name": "that" + }, + "arguments": [] + } + }, + "test": { + "type": "Literal", + "start": 18, + "end": 22, + "loc": { + "start": { + "line": 2, + "column": 8 + }, + "end": { + "line": 2, + "column": 12 + } + }, + "value": true, + "rawValue": true, + "raw": "true" + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/statement-iteration/migrated_0006/actual.js b/test/fixtures/esprima/statement-iteration/migrated_0006/actual.js new file mode 100644 index 0000000000..850fa0626e --- /dev/null +++ b/test/fixtures/esprima/statement-iteration/migrated_0006/actual.js @@ -0,0 +1 @@ +while (true) doSomething() diff --git a/test/fixtures/esprima/statement-iteration/migrated_0006/expected.json b/test/fixtures/esprima/statement-iteration/migrated_0006/expected.json new file mode 100644 index 0000000000..e3ddda1e17 --- /dev/null +++ b/test/fixtures/esprima/statement-iteration/migrated_0006/expected.json @@ -0,0 +1,113 @@ +{ + "type": "File", + "start": 0, + "end": 26, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 26 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 26, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 26 + } + }, + "sourceType": "script", + "body": [ + { + "type": "WhileStatement", + "start": 0, + "end": 26, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 26 + } + }, + "test": { + "type": "Literal", + "start": 7, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "value": true, + "rawValue": true, + "raw": "true" + }, + "body": { + "type": "ExpressionStatement", + "start": 13, + "end": 26, + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 1, + "column": 26 + } + }, + "expression": { + "type": "CallExpression", + "start": 13, + "end": 26, + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 1, + "column": 26 + } + }, + "callee": { + "type": "Identifier", + "start": 13, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 1, + "column": 24 + } + }, + "name": "doSomething" + }, + "arguments": [] + } + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/statement-iteration/migrated_0007/actual.js b/test/fixtures/esprima/statement-iteration/migrated_0007/actual.js new file mode 100644 index 0000000000..fdf7b8865e --- /dev/null +++ b/test/fixtures/esprima/statement-iteration/migrated_0007/actual.js @@ -0,0 +1 @@ +while (x < 10) { x++; y--; } diff --git a/test/fixtures/esprima/statement-iteration/migrated_0007/expected.json b/test/fixtures/esprima/statement-iteration/migrated_0007/expected.json new file mode 100644 index 0000000000..bf0cf79afd --- /dev/null +++ b/test/fixtures/esprima/statement-iteration/migrated_0007/expected.json @@ -0,0 +1,211 @@ +{ + "type": "File", + "start": 0, + "end": 28, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 28 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 28, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 28 + } + }, + "sourceType": "script", + "body": [ + { + "type": "WhileStatement", + "start": 0, + "end": 28, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 28 + } + }, + "test": { + "type": "BinaryExpression", + "start": 7, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "left": { + "type": "Identifier", + "start": 7, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "name": "x" + }, + "operator": "<", + "right": { + "type": "Literal", + "start": 11, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 11 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "value": 10, + "rawValue": 10, + "raw": "10" + } + }, + "body": { + "type": "BlockStatement", + "start": 15, + "end": 28, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 28 + } + }, + "body": [ + { + "type": "ExpressionStatement", + "start": 17, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 17 + }, + "end": { + "line": 1, + "column": 21 + } + }, + "expression": { + "type": "UpdateExpression", + "start": 17, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 17 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "operator": "++", + "prefix": false, + "argument": { + "type": "Identifier", + "start": 17, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 17 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "name": "x" + } + } + }, + { + "type": "ExpressionStatement", + "start": 22, + "end": 26, + "loc": { + "start": { + "line": 1, + "column": 22 + }, + "end": { + "line": 1, + "column": 26 + } + }, + "expression": { + "type": "UpdateExpression", + "start": 22, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 22 + }, + "end": { + "line": 1, + "column": 25 + } + }, + "operator": "--", + "prefix": false, + "argument": { + "type": "Identifier", + "start": 22, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 22 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "name": "y" + } + } + } + ] + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/statement-iteration/migrated_0008/actual.js b/test/fixtures/esprima/statement-iteration/migrated_0008/actual.js new file mode 100644 index 0000000000..4ab96f0961 --- /dev/null +++ b/test/fixtures/esprima/statement-iteration/migrated_0008/actual.js @@ -0,0 +1 @@ +for(;;); diff --git a/test/fixtures/esprima/statement-iteration/migrated_0008/expected.json b/test/fixtures/esprima/statement-iteration/migrated_0008/expected.json new file mode 100644 index 0000000000..9474ed02f5 --- /dev/null +++ b/test/fixtures/esprima/statement-iteration/migrated_0008/expected.json @@ -0,0 +1,66 @@ +{ + "type": "File", + "start": 0, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ForStatement", + "start": 0, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "init": null, + "test": null, + "update": null, + "body": { + "type": "EmptyStatement", + "start": 7, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 8 + } + } + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/statement-iteration/migrated_0009/actual.js b/test/fixtures/esprima/statement-iteration/migrated_0009/actual.js new file mode 100644 index 0000000000..2454953cbe --- /dev/null +++ b/test/fixtures/esprima/statement-iteration/migrated_0009/actual.js @@ -0,0 +1 @@ +for(;;){} diff --git a/test/fixtures/esprima/statement-iteration/migrated_0009/expected.json b/test/fixtures/esprima/statement-iteration/migrated_0009/expected.json new file mode 100644 index 0000000000..ee4511c5df --- /dev/null +++ b/test/fixtures/esprima/statement-iteration/migrated_0009/expected.json @@ -0,0 +1,67 @@ +{ + "type": "File", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ForStatement", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "init": null, + "test": null, + "update": null, + "body": { + "type": "BlockStatement", + "start": 7, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "body": [] + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/statement-iteration/migrated_0010/actual.js b/test/fixtures/esprima/statement-iteration/migrated_0010/actual.js new file mode 100644 index 0000000000..0031d64209 --- /dev/null +++ b/test/fixtures/esprima/statement-iteration/migrated_0010/actual.js @@ -0,0 +1 @@ +for(x = 0;;); diff --git a/test/fixtures/esprima/statement-iteration/migrated_0010/expected.json b/test/fixtures/esprima/statement-iteration/migrated_0010/expected.json new file mode 100644 index 0000000000..0221127370 --- /dev/null +++ b/test/fixtures/esprima/statement-iteration/migrated_0010/expected.json @@ -0,0 +1,115 @@ +{ + "type": "File", + "start": 0, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ForStatement", + "start": 0, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "init": { + "type": "AssignmentExpression", + "start": 4, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "operator": "=", + "left": { + "type": "Identifier", + "start": 4, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "name": "x" + }, + "right": { + "type": "Literal", + "start": 8, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "value": 0, + "rawValue": 0, + "raw": "0" + } + }, + "test": null, + "update": null, + "body": { + "type": "EmptyStatement", + "start": 12, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 12 + }, + "end": { + "line": 1, + "column": 13 + } + } + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/statement-iteration/migrated_0011/actual.js b/test/fixtures/esprima/statement-iteration/migrated_0011/actual.js new file mode 100644 index 0000000000..efc0f031b7 --- /dev/null +++ b/test/fixtures/esprima/statement-iteration/migrated_0011/actual.js @@ -0,0 +1 @@ +for(var x = 0;;); diff --git a/test/fixtures/esprima/statement-iteration/migrated_0011/expected.json b/test/fixtures/esprima/statement-iteration/migrated_0011/expected.json new file mode 100644 index 0000000000..46c4e44c8f --- /dev/null +++ b/test/fixtures/esprima/statement-iteration/migrated_0011/expected.json @@ -0,0 +1,132 @@ +{ + "type": "File", + "start": 0, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ForStatement", + "start": 0, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "init": { + "type": "VariableDeclaration", + "start": 4, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 8, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "id": { + "type": "Identifier", + "start": 8, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "name": "x" + }, + "init": { + "type": "Literal", + "start": 12, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 12 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "value": 0, + "rawValue": 0, + "raw": "0" + } + } + ], + "kind": "var" + }, + "test": null, + "update": null, + "body": { + "type": "EmptyStatement", + "start": 16, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 16 + }, + "end": { + "line": 1, + "column": 17 + } + } + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/statement-iteration/migrated_0012/actual.js b/test/fixtures/esprima/statement-iteration/migrated_0012/actual.js new file mode 100644 index 0000000000..cec50c4b9c --- /dev/null +++ b/test/fixtures/esprima/statement-iteration/migrated_0012/actual.js @@ -0,0 +1 @@ +for(let x = 0;;); diff --git a/test/fixtures/esprima/statement-iteration/migrated_0012/expected.json b/test/fixtures/esprima/statement-iteration/migrated_0012/expected.json new file mode 100644 index 0000000000..5f7188a434 --- /dev/null +++ b/test/fixtures/esprima/statement-iteration/migrated_0012/expected.json @@ -0,0 +1,132 @@ +{ + "type": "File", + "start": 0, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ForStatement", + "start": 0, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "init": { + "type": "VariableDeclaration", + "start": 4, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 8, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "id": { + "type": "Identifier", + "start": 8, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "name": "x" + }, + "init": { + "type": "Literal", + "start": 12, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 12 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "value": 0, + "rawValue": 0, + "raw": "0" + } + } + ], + "kind": "let" + }, + "test": null, + "update": null, + "body": { + "type": "EmptyStatement", + "start": 16, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 16 + }, + "end": { + "line": 1, + "column": 17 + } + } + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/statement-iteration/migrated_0013/actual.js b/test/fixtures/esprima/statement-iteration/migrated_0013/actual.js new file mode 100644 index 0000000000..97a393701c --- /dev/null +++ b/test/fixtures/esprima/statement-iteration/migrated_0013/actual.js @@ -0,0 +1 @@ +for(var x = 0, y = 1;;); diff --git a/test/fixtures/esprima/statement-iteration/migrated_0013/expected.json b/test/fixtures/esprima/statement-iteration/migrated_0013/expected.json new file mode 100644 index 0000000000..20b89977b6 --- /dev/null +++ b/test/fixtures/esprima/statement-iteration/migrated_0013/expected.json @@ -0,0 +1,181 @@ +{ + "type": "File", + "start": 0, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 24 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 24 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ForStatement", + "start": 0, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 24 + } + }, + "init": { + "type": "VariableDeclaration", + "start": 4, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 8, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "id": { + "type": "Identifier", + "start": 8, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "name": "x" + }, + "init": { + "type": "Literal", + "start": 12, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 12 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "value": 0, + "rawValue": 0, + "raw": "0" + } + }, + { + "type": "VariableDeclarator", + "start": 15, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "id": { + "type": "Identifier", + "start": 15, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "name": "y" + }, + "init": { + "type": "Literal", + "start": 19, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 19 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "value": 1, + "rawValue": 1, + "raw": "1" + } + } + ], + "kind": "var" + }, + "test": null, + "update": null, + "body": { + "type": "EmptyStatement", + "start": 23, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 23 + }, + "end": { + "line": 1, + "column": 24 + } + } + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/statement-iteration/migrated_0014/actual.js b/test/fixtures/esprima/statement-iteration/migrated_0014/actual.js new file mode 100644 index 0000000000..bfa5a751d8 --- /dev/null +++ b/test/fixtures/esprima/statement-iteration/migrated_0014/actual.js @@ -0,0 +1 @@ +for(x = 0; x < 42;); diff --git a/test/fixtures/esprima/statement-iteration/migrated_0014/expected.json b/test/fixtures/esprima/statement-iteration/migrated_0014/expected.json new file mode 100644 index 0000000000..66dff360f5 --- /dev/null +++ b/test/fixtures/esprima/statement-iteration/migrated_0014/expected.json @@ -0,0 +1,164 @@ +{ + "type": "File", + "start": 0, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ForStatement", + "start": 0, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "init": { + "type": "AssignmentExpression", + "start": 4, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "operator": "=", + "left": { + "type": "Identifier", + "start": 4, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "name": "x" + }, + "right": { + "type": "Literal", + "start": 8, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "value": 0, + "rawValue": 0, + "raw": "0" + } + }, + "test": { + "type": "BinaryExpression", + "start": 11, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 11 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "left": { + "type": "Identifier", + "start": 11, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 11 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "name": "x" + }, + "operator": "<", + "right": { + "type": "Literal", + "start": 15, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "value": 42, + "rawValue": 42, + "raw": "42" + } + }, + "update": null, + "body": { + "type": "EmptyStatement", + "start": 19, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 19 + }, + "end": { + "line": 1, + "column": 20 + } + } + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/statement-iteration/migrated_0015/actual.js b/test/fixtures/esprima/statement-iteration/migrated_0015/actual.js new file mode 100644 index 0000000000..252fa9391b --- /dev/null +++ b/test/fixtures/esprima/statement-iteration/migrated_0015/actual.js @@ -0,0 +1 @@ +for(x = 0; x < 42; x++); diff --git a/test/fixtures/esprima/statement-iteration/migrated_0015/expected.json b/test/fixtures/esprima/statement-iteration/migrated_0015/expected.json new file mode 100644 index 0000000000..1943c72a2e --- /dev/null +++ b/test/fixtures/esprima/statement-iteration/migrated_0015/expected.json @@ -0,0 +1,196 @@ +{ + "type": "File", + "start": 0, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 24 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 24 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ForStatement", + "start": 0, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 24 + } + }, + "init": { + "type": "AssignmentExpression", + "start": 4, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "operator": "=", + "left": { + "type": "Identifier", + "start": 4, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "name": "x" + }, + "right": { + "type": "Literal", + "start": 8, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "value": 0, + "rawValue": 0, + "raw": "0" + } + }, + "test": { + "type": "BinaryExpression", + "start": 11, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 11 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "left": { + "type": "Identifier", + "start": 11, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 11 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "name": "x" + }, + "operator": "<", + "right": { + "type": "Literal", + "start": 15, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "value": 42, + "rawValue": 42, + "raw": "42" + } + }, + "update": { + "type": "UpdateExpression", + "start": 19, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 19 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "operator": "++", + "prefix": false, + "argument": { + "type": "Identifier", + "start": 19, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 19 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "name": "x" + } + }, + "body": { + "type": "EmptyStatement", + "start": 23, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 23 + }, + "end": { + "line": 1, + "column": 24 + } + } + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/statement-iteration/migrated_0016/actual.js b/test/fixtures/esprima/statement-iteration/migrated_0016/actual.js new file mode 100644 index 0000000000..3c1e6af8df --- /dev/null +++ b/test/fixtures/esprima/statement-iteration/migrated_0016/actual.js @@ -0,0 +1 @@ +for(x = 0; x < 42; x++) process(x); diff --git a/test/fixtures/esprima/statement-iteration/migrated_0016/expected.json b/test/fixtures/esprima/statement-iteration/migrated_0016/expected.json new file mode 100644 index 0000000000..ea41666efe --- /dev/null +++ b/test/fixtures/esprima/statement-iteration/migrated_0016/expected.json @@ -0,0 +1,245 @@ +{ + "type": "File", + "start": 0, + "end": 35, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 35 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 35, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 35 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ForStatement", + "start": 0, + "end": 35, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 35 + } + }, + "init": { + "type": "AssignmentExpression", + "start": 4, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "operator": "=", + "left": { + "type": "Identifier", + "start": 4, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "name": "x" + }, + "right": { + "type": "Literal", + "start": 8, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "value": 0, + "rawValue": 0, + "raw": "0" + } + }, + "test": { + "type": "BinaryExpression", + "start": 11, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 11 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "left": { + "type": "Identifier", + "start": 11, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 11 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "name": "x" + }, + "operator": "<", + "right": { + "type": "Literal", + "start": 15, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "value": 42, + "rawValue": 42, + "raw": "42" + } + }, + "update": { + "type": "UpdateExpression", + "start": 19, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 19 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "operator": "++", + "prefix": false, + "argument": { + "type": "Identifier", + "start": 19, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 19 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "name": "x" + } + }, + "body": { + "type": "ExpressionStatement", + "start": 24, + "end": 35, + "loc": { + "start": { + "line": 1, + "column": 24 + }, + "end": { + "line": 1, + "column": 35 + } + }, + "expression": { + "type": "CallExpression", + "start": 24, + "end": 34, + "loc": { + "start": { + "line": 1, + "column": 24 + }, + "end": { + "line": 1, + "column": 34 + } + }, + "callee": { + "type": "Identifier", + "start": 24, + "end": 31, + "loc": { + "start": { + "line": 1, + "column": 24 + }, + "end": { + "line": 1, + "column": 31 + } + }, + "name": "process" + }, + "arguments": [ + { + "type": "Identifier", + "start": 32, + "end": 33, + "loc": { + "start": { + "line": 1, + "column": 32 + }, + "end": { + "line": 1, + "column": 33 + } + }, + "name": "x" + } + ] + } + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/statement-iteration/migrated_0017/actual.js b/test/fixtures/esprima/statement-iteration/migrated_0017/actual.js new file mode 100644 index 0000000000..5b8cba78ae --- /dev/null +++ b/test/fixtures/esprima/statement-iteration/migrated_0017/actual.js @@ -0,0 +1 @@ +for(x in list) process(x); diff --git a/test/fixtures/esprima/statement-iteration/migrated_0017/expected.json b/test/fixtures/esprima/statement-iteration/migrated_0017/expected.json new file mode 100644 index 0000000000..f95b2f15a7 --- /dev/null +++ b/test/fixtures/esprima/statement-iteration/migrated_0017/expected.json @@ -0,0 +1,144 @@ +{ + "type": "File", + "start": 0, + "end": 26, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 26 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 26, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 26 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ForInStatement", + "start": 0, + "end": 26, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 26 + } + }, + "left": { + "type": "Identifier", + "start": 4, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "name": "x" + }, + "right": { + "type": "Identifier", + "start": 9, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "name": "list" + }, + "body": { + "type": "ExpressionStatement", + "start": 15, + "end": 26, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 26 + } + }, + "expression": { + "type": "CallExpression", + "start": 15, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 25 + } + }, + "callee": { + "type": "Identifier", + "start": 15, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "name": "process" + }, + "arguments": [ + { + "type": "Identifier", + "start": 23, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 23 + }, + "end": { + "line": 1, + "column": 24 + } + }, + "name": "x" + } + ] + } + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/statement-iteration/migrated_0018/actual.js b/test/fixtures/esprima/statement-iteration/migrated_0018/actual.js new file mode 100644 index 0000000000..f3649e96e1 --- /dev/null +++ b/test/fixtures/esprima/statement-iteration/migrated_0018/actual.js @@ -0,0 +1 @@ +for (var x in list) process(x); diff --git a/test/fixtures/esprima/statement-iteration/migrated_0018/expected.json b/test/fixtures/esprima/statement-iteration/migrated_0018/expected.json new file mode 100644 index 0000000000..50d29b5d32 --- /dev/null +++ b/test/fixtures/esprima/statement-iteration/migrated_0018/expected.json @@ -0,0 +1,178 @@ +{ + "type": "File", + "start": 0, + "end": 31, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 31 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 31, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 31 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ForInStatement", + "start": 0, + "end": 31, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 31 + } + }, + "left": { + "type": "VariableDeclaration", + "start": 5, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 9, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "id": { + "type": "Identifier", + "start": 9, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "name": "x" + }, + "init": null + } + ], + "kind": "var" + }, + "right": { + "type": "Identifier", + "start": 14, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 14 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "name": "list" + }, + "body": { + "type": "ExpressionStatement", + "start": 20, + "end": 31, + "loc": { + "start": { + "line": 1, + "column": 20 + }, + "end": { + "line": 1, + "column": 31 + } + }, + "expression": { + "type": "CallExpression", + "start": 20, + "end": 30, + "loc": { + "start": { + "line": 1, + "column": 20 + }, + "end": { + "line": 1, + "column": 30 + } + }, + "callee": { + "type": "Identifier", + "start": 20, + "end": 27, + "loc": { + "start": { + "line": 1, + "column": 20 + }, + "end": { + "line": 1, + "column": 27 + } + }, + "name": "process" + }, + "arguments": [ + { + "type": "Identifier", + "start": 28, + "end": 29, + "loc": { + "start": { + "line": 1, + "column": 28 + }, + "end": { + "line": 1, + "column": 29 + } + }, + "name": "x" + } + ] + } + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/statement-iteration/migrated_0019/actual.js b/test/fixtures/esprima/statement-iteration/migrated_0019/actual.js new file mode 100644 index 0000000000..406a3a3c22 --- /dev/null +++ b/test/fixtures/esprima/statement-iteration/migrated_0019/actual.js @@ -0,0 +1 @@ +for (var x = 42 in list) process(x); diff --git a/test/fixtures/esprima/statement-iteration/migrated_0019/expected.json b/test/fixtures/esprima/statement-iteration/migrated_0019/expected.json new file mode 100644 index 0000000000..7b65e7a6c3 --- /dev/null +++ b/test/fixtures/esprima/statement-iteration/migrated_0019/expected.json @@ -0,0 +1,195 @@ +{ + "type": "File", + "start": 0, + "end": 36, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 36 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 36, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 36 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ForInStatement", + "start": 0, + "end": 36, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 36 + } + }, + "left": { + "type": "VariableDeclaration", + "start": 5, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 9, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "id": { + "type": "Identifier", + "start": 9, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "name": "x" + }, + "init": { + "type": "Literal", + "start": 13, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "value": 42, + "rawValue": 42, + "raw": "42" + } + } + ], + "kind": "var" + }, + "right": { + "type": "Identifier", + "start": 19, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 19 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "name": "list" + }, + "body": { + "type": "ExpressionStatement", + "start": 25, + "end": 36, + "loc": { + "start": { + "line": 1, + "column": 25 + }, + "end": { + "line": 1, + "column": 36 + } + }, + "expression": { + "type": "CallExpression", + "start": 25, + "end": 35, + "loc": { + "start": { + "line": 1, + "column": 25 + }, + "end": { + "line": 1, + "column": 35 + } + }, + "callee": { + "type": "Identifier", + "start": 25, + "end": 32, + "loc": { + "start": { + "line": 1, + "column": 25 + }, + "end": { + "line": 1, + "column": 32 + } + }, + "name": "process" + }, + "arguments": [ + { + "type": "Identifier", + "start": 33, + "end": 34, + "loc": { + "start": { + "line": 1, + "column": 33 + }, + "end": { + "line": 1, + "column": 34 + } + }, + "name": "x" + } + ] + } + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/statement-iteration/migrated_0020/actual.js b/test/fixtures/esprima/statement-iteration/migrated_0020/actual.js new file mode 100644 index 0000000000..ef04e49f91 --- /dev/null +++ b/test/fixtures/esprima/statement-iteration/migrated_0020/actual.js @@ -0,0 +1 @@ +for (let x in list) process(x); diff --git a/test/fixtures/esprima/statement-iteration/migrated_0020/expected.json b/test/fixtures/esprima/statement-iteration/migrated_0020/expected.json new file mode 100644 index 0000000000..12d30b3dd3 --- /dev/null +++ b/test/fixtures/esprima/statement-iteration/migrated_0020/expected.json @@ -0,0 +1,178 @@ +{ + "type": "File", + "start": 0, + "end": 31, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 31 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 31, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 31 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ForInStatement", + "start": 0, + "end": 31, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 31 + } + }, + "left": { + "type": "VariableDeclaration", + "start": 5, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 9, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "id": { + "type": "Identifier", + "start": 9, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "name": "x" + }, + "init": null + } + ], + "kind": "let" + }, + "right": { + "type": "Identifier", + "start": 14, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 14 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "name": "list" + }, + "body": { + "type": "ExpressionStatement", + "start": 20, + "end": 31, + "loc": { + "start": { + "line": 1, + "column": 20 + }, + "end": { + "line": 1, + "column": 31 + } + }, + "expression": { + "type": "CallExpression", + "start": 20, + "end": 30, + "loc": { + "start": { + "line": 1, + "column": 20 + }, + "end": { + "line": 1, + "column": 30 + } + }, + "callee": { + "type": "Identifier", + "start": 20, + "end": 27, + "loc": { + "start": { + "line": 1, + "column": 20 + }, + "end": { + "line": 1, + "column": 27 + } + }, + "name": "process" + }, + "arguments": [ + { + "type": "Identifier", + "start": 28, + "end": 29, + "loc": { + "start": { + "line": 1, + "column": 28 + }, + "end": { + "line": 1, + "column": 29 + } + }, + "name": "x" + } + ] + } + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/statement-iteration/migrated_0021/actual.js b/test/fixtures/esprima/statement-iteration/migrated_0021/actual.js new file mode 100644 index 0000000000..01e8d6930a --- /dev/null +++ b/test/fixtures/esprima/statement-iteration/migrated_0021/actual.js @@ -0,0 +1 @@ +for (var x = y = z in q); diff --git a/test/fixtures/esprima/statement-iteration/migrated_0021/expected.json b/test/fixtures/esprima/statement-iteration/migrated_0021/expected.json new file mode 100644 index 0000000000..20d1b7032f --- /dev/null +++ b/test/fixtures/esprima/statement-iteration/migrated_0021/expected.json @@ -0,0 +1,176 @@ +{ + "type": "File", + "start": 0, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 25 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 25 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ForInStatement", + "start": 0, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 25 + } + }, + "left": { + "type": "VariableDeclaration", + "start": 5, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 9, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "id": { + "type": "Identifier", + "start": 9, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "name": "x" + }, + "init": { + "type": "AssignmentExpression", + "start": 13, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "operator": "=", + "left": { + "type": "Identifier", + "start": 13, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "name": "y" + }, + "right": { + "type": "Identifier", + "start": 17, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 17 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "name": "z" + } + } + } + ], + "kind": "var" + }, + "right": { + "type": "Identifier", + "start": 22, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 22 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "name": "q" + }, + "body": { + "type": "EmptyStatement", + "start": 24, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 24 + }, + "end": { + "line": 1, + "column": 25 + } + } + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/statement-iteration/migrated_0022/actual.js b/test/fixtures/esprima/statement-iteration/migrated_0022/actual.js new file mode 100644 index 0000000000..e10579bece --- /dev/null +++ b/test/fixtures/esprima/statement-iteration/migrated_0022/actual.js @@ -0,0 +1 @@ +for (var a = b = c = (d in e) in z); diff --git a/test/fixtures/esprima/statement-iteration/migrated_0022/expected.json b/test/fixtures/esprima/statement-iteration/migrated_0022/expected.json new file mode 100644 index 0000000000..f08be47cf5 --- /dev/null +++ b/test/fixtures/esprima/statement-iteration/migrated_0022/expected.json @@ -0,0 +1,241 @@ +{ + "type": "File", + "start": 0, + "end": 36, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 36 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 36, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 36 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ForInStatement", + "start": 0, + "end": 36, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 36 + } + }, + "left": { + "type": "VariableDeclaration", + "start": 5, + "end": 29, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 29 + } + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 9, + "end": 29, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 29 + } + }, + "id": { + "type": "Identifier", + "start": 9, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "name": "a" + }, + "init": { + "type": "AssignmentExpression", + "start": 13, + "end": 29, + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 1, + "column": 29 + } + }, + "operator": "=", + "left": { + "type": "Identifier", + "start": 13, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "name": "b" + }, + "right": { + "type": "AssignmentExpression", + "start": 17, + "end": 29, + "loc": { + "start": { + "line": 1, + "column": 17 + }, + "end": { + "line": 1, + "column": 29 + } + }, + "operator": "=", + "left": { + "type": "Identifier", + "start": 17, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 17 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "name": "c" + }, + "right": { + "type": "BinaryExpression", + "start": 22, + "end": 28, + "loc": { + "start": { + "line": 1, + "column": 22 + }, + "end": { + "line": 1, + "column": 28 + } + }, + "left": { + "type": "Identifier", + "start": 22, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 22 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "name": "d" + }, + "operator": "in", + "right": { + "type": "Identifier", + "start": 27, + "end": 28, + "loc": { + "start": { + "line": 1, + "column": 27 + }, + "end": { + "line": 1, + "column": 28 + } + }, + "name": "e" + }, + "parenthesizedExpression": true + } + } + } + } + ], + "kind": "var" + }, + "right": { + "type": "Identifier", + "start": 33, + "end": 34, + "loc": { + "start": { + "line": 1, + "column": 33 + }, + "end": { + "line": 1, + "column": 34 + } + }, + "name": "z" + }, + "body": { + "type": "EmptyStatement", + "start": 35, + "end": 36, + "loc": { + "start": { + "line": 1, + "column": 35 + }, + "end": { + "line": 1, + "column": 36 + } + } + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/statement-iteration/migrated_0023/actual.js b/test/fixtures/esprima/statement-iteration/migrated_0023/actual.js new file mode 100644 index 0000000000..dbbe45041a --- /dev/null +++ b/test/fixtures/esprima/statement-iteration/migrated_0023/actual.js @@ -0,0 +1 @@ +for (var i = function() { return 10 in [] } in list) process(x); diff --git a/test/fixtures/esprima/statement-iteration/migrated_0023/expected.json b/test/fixtures/esprima/statement-iteration/migrated_0023/expected.json new file mode 100644 index 0000000000..b0f5f0232d --- /dev/null +++ b/test/fixtures/esprima/statement-iteration/migrated_0023/expected.json @@ -0,0 +1,278 @@ +{ + "type": "File", + "start": 0, + "end": 64, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 64 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 64, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 64 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ForInStatement", + "start": 0, + "end": 64, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 64 + } + }, + "left": { + "type": "VariableDeclaration", + "start": 5, + "end": 43, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 43 + } + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 9, + "end": 43, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 43 + } + }, + "id": { + "type": "Identifier", + "start": 9, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "name": "i" + }, + "init": { + "type": "FunctionExpression", + "start": 13, + "end": 43, + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 1, + "column": 43 + } + }, + "id": null, + "generator": false, + "expression": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 24, + "end": 43, + "loc": { + "start": { + "line": 1, + "column": 24 + }, + "end": { + "line": 1, + "column": 43 + } + }, + "body": [ + { + "type": "ReturnStatement", + "start": 26, + "end": 41, + "loc": { + "start": { + "line": 1, + "column": 26 + }, + "end": { + "line": 1, + "column": 41 + } + }, + "argument": { + "type": "BinaryExpression", + "start": 33, + "end": 41, + "loc": { + "start": { + "line": 1, + "column": 33 + }, + "end": { + "line": 1, + "column": 41 + } + }, + "left": { + "type": "Literal", + "start": 33, + "end": 35, + "loc": { + "start": { + "line": 1, + "column": 33 + }, + "end": { + "line": 1, + "column": 35 + } + }, + "value": 10, + "rawValue": 10, + "raw": "10" + }, + "operator": "in", + "right": { + "type": "ArrayExpression", + "start": 39, + "end": 41, + "loc": { + "start": { + "line": 1, + "column": 39 + }, + "end": { + "line": 1, + "column": 41 + } + }, + "elements": [] + } + } + } + ] + } + } + } + ], + "kind": "var" + }, + "right": { + "type": "Identifier", + "start": 47, + "end": 51, + "loc": { + "start": { + "line": 1, + "column": 47 + }, + "end": { + "line": 1, + "column": 51 + } + }, + "name": "list" + }, + "body": { + "type": "ExpressionStatement", + "start": 53, + "end": 64, + "loc": { + "start": { + "line": 1, + "column": 53 + }, + "end": { + "line": 1, + "column": 64 + } + }, + "expression": { + "type": "CallExpression", + "start": 53, + "end": 63, + "loc": { + "start": { + "line": 1, + "column": 53 + }, + "end": { + "line": 1, + "column": 63 + } + }, + "callee": { + "type": "Identifier", + "start": 53, + "end": 60, + "loc": { + "start": { + "line": 1, + "column": 53 + }, + "end": { + "line": 1, + "column": 60 + } + }, + "name": "process" + }, + "arguments": [ + { + "type": "Identifier", + "start": 61, + "end": 62, + "loc": { + "start": { + "line": 1, + "column": 61 + }, + "end": { + "line": 1, + "column": 62 + } + }, + "name": "x" + } + ] + } + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/statement-iteration/migrated_0024/actual.js b/test/fixtures/esprima/statement-iteration/migrated_0024/actual.js new file mode 100644 index 0000000000..6d08a0e3ac --- /dev/null +++ b/test/fixtures/esprima/statement-iteration/migrated_0024/actual.js @@ -0,0 +1 @@ +for (a[b in c] in d); diff --git a/test/fixtures/esprima/statement-iteration/migrated_0024/expected.json b/test/fixtures/esprima/statement-iteration/migrated_0024/expected.json new file mode 100644 index 0000000000..5eba72f1c0 --- /dev/null +++ b/test/fixtures/esprima/statement-iteration/migrated_0024/expected.json @@ -0,0 +1,159 @@ +{ + "type": "File", + "start": 0, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 21 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 21 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ForInStatement", + "start": 0, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 21 + } + }, + "left": { + "type": "MemberExpression", + "start": 5, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "object": { + "type": "Identifier", + "start": 5, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "name": "a" + }, + "property": { + "type": "BinaryExpression", + "start": 7, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "left": { + "type": "Identifier", + "start": 7, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "name": "b" + }, + "operator": "in", + "right": { + "type": "Identifier", + "start": 12, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 12 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "name": "c" + } + }, + "computed": true + }, + "right": { + "type": "Identifier", + "start": 18, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 18 + }, + "end": { + "line": 1, + "column": 19 + } + }, + "name": "d" + }, + "body": { + "type": "EmptyStatement", + "start": 20, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 20 + }, + "end": { + "line": 1, + "column": 21 + } + } + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/statement-iteration/migrated_0025/actual.js b/test/fixtures/esprima/statement-iteration/migrated_0025/actual.js new file mode 100644 index 0000000000..74abefc28d --- /dev/null +++ b/test/fixtures/esprima/statement-iteration/migrated_0025/actual.js @@ -0,0 +1 @@ +for (a(b in c)[0] in d); diff --git a/test/fixtures/esprima/statement-iteration/migrated_0025/expected.json b/test/fixtures/esprima/statement-iteration/migrated_0025/expected.json new file mode 100644 index 0000000000..eac72f5d2b --- /dev/null +++ b/test/fixtures/esprima/statement-iteration/migrated_0025/expected.json @@ -0,0 +1,194 @@ +{ + "type": "File", + "start": 0, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 24 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 24 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ForInStatement", + "start": 0, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 24 + } + }, + "left": { + "type": "MemberExpression", + "start": 5, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "object": { + "type": "CallExpression", + "start": 5, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "callee": { + "type": "Identifier", + "start": 5, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "name": "a" + }, + "arguments": [ + { + "type": "BinaryExpression", + "start": 7, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "left": { + "type": "Identifier", + "start": 7, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "name": "b" + }, + "operator": "in", + "right": { + "type": "Identifier", + "start": 12, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 12 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "name": "c" + } + } + ] + }, + "property": { + "type": "Literal", + "start": 15, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "value": 0, + "rawValue": 0, + "raw": "0" + }, + "computed": true + }, + "right": { + "type": "Identifier", + "start": 21, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 21 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "name": "d" + }, + "body": { + "type": "EmptyStatement", + "start": 23, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 23 + }, + "end": { + "line": 1, + "column": 24 + } + } + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/statement-iteration/migrated_0026/actual.js b/test/fixtures/esprima/statement-iteration/migrated_0026/actual.js new file mode 100644 index 0000000000..6c141a0c23 --- /dev/null +++ b/test/fixtures/esprima/statement-iteration/migrated_0026/actual.js @@ -0,0 +1 @@ +for (a.in in a); diff --git a/test/fixtures/esprima/statement-iteration/migrated_0026/expected.json b/test/fixtures/esprima/statement-iteration/migrated_0026/expected.json new file mode 100644 index 0000000000..df5bd2f21b --- /dev/null +++ b/test/fixtures/esprima/statement-iteration/migrated_0026/expected.json @@ -0,0 +1,127 @@ +{ + "type": "File", + "start": 0, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ForInStatement", + "start": 0, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "left": { + "type": "MemberExpression", + "start": 5, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "object": { + "type": "Identifier", + "start": 5, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "name": "a" + }, + "property": { + "type": "Identifier", + "start": 7, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "name": "in" + }, + "computed": false + }, + "right": { + "type": "Identifier", + "start": 13, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "name": "a" + }, + "body": { + "type": "EmptyStatement", + "start": 15, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 16 + } + } + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/statement-iteration/pattern-in-for-in/actual.js b/test/fixtures/esprima/statement-iteration/pattern-in-for-in/actual.js new file mode 100644 index 0000000000..7bfdb2f282 --- /dev/null +++ b/test/fixtures/esprima/statement-iteration/pattern-in-for-in/actual.js @@ -0,0 +1 @@ +for([a,b[a],{c,d=e,[f]:[g,h().a,(0).k,...i[0]]}] in 0); diff --git a/test/fixtures/esprima/statement-labelled/migrated_0000/actual.js b/test/fixtures/esprima/statement-labelled/migrated_0000/actual.js new file mode 100644 index 0000000000..925da26ad6 --- /dev/null +++ b/test/fixtures/esprima/statement-labelled/migrated_0000/actual.js @@ -0,0 +1 @@ +start: for (;;) break start diff --git a/test/fixtures/esprima/statement-labelled/migrated_0000/expected.json b/test/fixtures/esprima/statement-labelled/migrated_0000/expected.json new file mode 100644 index 0000000000..ea2201a00e --- /dev/null +++ b/test/fixtures/esprima/statement-labelled/migrated_0000/expected.json @@ -0,0 +1,113 @@ +{ + "type": "File", + "start": 0, + "end": 27, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 27 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 27, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 27 + } + }, + "sourceType": "script", + "body": [ + { + "type": "LabeledStatement", + "start": 0, + "end": 27, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 27 + } + }, + "body": { + "type": "ForStatement", + "start": 7, + "end": 27, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 27 + } + }, + "init": null, + "test": null, + "update": null, + "body": { + "type": "BreakStatement", + "start": 16, + "end": 27, + "loc": { + "start": { + "line": 1, + "column": 16 + }, + "end": { + "line": 1, + "column": 27 + } + }, + "label": { + "type": "Identifier", + "start": 22, + "end": 27, + "loc": { + "start": { + "line": 1, + "column": 22 + }, + "end": { + "line": 1, + "column": 27 + } + }, + "name": "start" + } + } + }, + "label": { + "type": "Identifier", + "start": 0, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "name": "start" + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/statement-labelled/migrated_0001/actual.js b/test/fixtures/esprima/statement-labelled/migrated_0001/actual.js new file mode 100644 index 0000000000..c9f77462c3 --- /dev/null +++ b/test/fixtures/esprima/statement-labelled/migrated_0001/actual.js @@ -0,0 +1 @@ +start: while (true) break start diff --git a/test/fixtures/esprima/statement-labelled/migrated_0001/expected.json b/test/fixtures/esprima/statement-labelled/migrated_0001/expected.json new file mode 100644 index 0000000000..cddf16fc26 --- /dev/null +++ b/test/fixtures/esprima/statement-labelled/migrated_0001/expected.json @@ -0,0 +1,128 @@ +{ + "type": "File", + "start": 0, + "end": 31, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 31 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 31, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 31 + } + }, + "sourceType": "script", + "body": [ + { + "type": "LabeledStatement", + "start": 0, + "end": 31, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 31 + } + }, + "body": { + "type": "WhileStatement", + "start": 7, + "end": 31, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 31 + } + }, + "test": { + "type": "Literal", + "start": 14, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 14 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "value": true, + "rawValue": true, + "raw": "true" + }, + "body": { + "type": "BreakStatement", + "start": 20, + "end": 31, + "loc": { + "start": { + "line": 1, + "column": 20 + }, + "end": { + "line": 1, + "column": 31 + } + }, + "label": { + "type": "Identifier", + "start": 26, + "end": 31, + "loc": { + "start": { + "line": 1, + "column": 26 + }, + "end": { + "line": 1, + "column": 31 + } + }, + "name": "start" + } + } + }, + "label": { + "type": "Identifier", + "start": 0, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "name": "start" + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/statement-labelled/migrated_0002/actual.js b/test/fixtures/esprima/statement-labelled/migrated_0002/actual.js new file mode 100644 index 0000000000..3b8d12bfe3 --- /dev/null +++ b/test/fixtures/esprima/statement-labelled/migrated_0002/actual.js @@ -0,0 +1 @@ +__proto__: test diff --git a/test/fixtures/esprima/statement-labelled/migrated_0002/expected.json b/test/fixtures/esprima/statement-labelled/migrated_0002/expected.json new file mode 100644 index 0000000000..c1996f9d1b --- /dev/null +++ b/test/fixtures/esprima/statement-labelled/migrated_0002/expected.json @@ -0,0 +1,95 @@ +{ + "type": "File", + "start": 0, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "sourceType": "script", + "body": [ + { + "type": "LabeledStatement", + "start": 0, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "body": { + "type": "ExpressionStatement", + "start": 11, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 11 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "expression": { + "type": "Identifier", + "start": 11, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 11 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "name": "test" + } + }, + "label": { + "type": "Identifier", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "name": "__proto__" + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/statement-return/migrated_0000/actual.js b/test/fixtures/esprima/statement-return/migrated_0000/actual.js new file mode 100644 index 0000000000..75545f4ec5 --- /dev/null +++ b/test/fixtures/esprima/statement-return/migrated_0000/actual.js @@ -0,0 +1 @@ +(function(){ return }) diff --git a/test/fixtures/esprima/statement-return/migrated_0000/expected.json b/test/fixtures/esprima/statement-return/migrated_0000/expected.json new file mode 100644 index 0000000000..3f86692dc7 --- /dev/null +++ b/test/fixtures/esprima/statement-return/migrated_0000/expected.json @@ -0,0 +1,101 @@ +{ + "type": "File", + "start": 0, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "expression": { + "type": "FunctionExpression", + "start": 1, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 21 + } + }, + "id": null, + "generator": false, + "expression": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 11, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 11 + }, + "end": { + "line": 1, + "column": 21 + } + }, + "body": [ + { + "type": "ReturnStatement", + "start": 13, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 1, + "column": 19 + } + }, + "argument": null + } + ] + }, + "parenthesizedExpression": true + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/statement-return/migrated_0001/actual.js b/test/fixtures/esprima/statement-return/migrated_0001/actual.js new file mode 100644 index 0000000000..775341351c --- /dev/null +++ b/test/fixtures/esprima/statement-return/migrated_0001/actual.js @@ -0,0 +1 @@ +(function(){ return; }) diff --git a/test/fixtures/esprima/statement-return/migrated_0001/expected.json b/test/fixtures/esprima/statement-return/migrated_0001/expected.json new file mode 100644 index 0000000000..f66370e4d6 --- /dev/null +++ b/test/fixtures/esprima/statement-return/migrated_0001/expected.json @@ -0,0 +1,101 @@ +{ + "type": "File", + "start": 0, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "expression": { + "type": "FunctionExpression", + "start": 1, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "id": null, + "generator": false, + "expression": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 11, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 11 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "body": [ + { + "type": "ReturnStatement", + "start": 13, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "argument": null + } + ] + }, + "parenthesizedExpression": true + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/statement-return/migrated_0002/actual.js b/test/fixtures/esprima/statement-return/migrated_0002/actual.js new file mode 100644 index 0000000000..c641c6eba2 --- /dev/null +++ b/test/fixtures/esprima/statement-return/migrated_0002/actual.js @@ -0,0 +1 @@ +(function(){ return x; }) diff --git a/test/fixtures/esprima/statement-return/migrated_0002/expected.json b/test/fixtures/esprima/statement-return/migrated_0002/expected.json new file mode 100644 index 0000000000..864565296e --- /dev/null +++ b/test/fixtures/esprima/statement-return/migrated_0002/expected.json @@ -0,0 +1,116 @@ +{ + "type": "File", + "start": 0, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 25 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 25 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 25 + } + }, + "expression": { + "type": "FunctionExpression", + "start": 1, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 24 + } + }, + "id": null, + "generator": false, + "expression": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 11, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 11 + }, + "end": { + "line": 1, + "column": 24 + } + }, + "body": [ + { + "type": "ReturnStatement", + "start": 13, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "argument": { + "type": "Identifier", + "start": 20, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 20 + }, + "end": { + "line": 1, + "column": 21 + } + }, + "name": "x" + } + } + ] + }, + "parenthesizedExpression": true + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/statement-return/migrated_0003/actual.js b/test/fixtures/esprima/statement-return/migrated_0003/actual.js new file mode 100644 index 0000000000..81b8918812 --- /dev/null +++ b/test/fixtures/esprima/statement-return/migrated_0003/actual.js @@ -0,0 +1 @@ +(function(){ return x * y }) diff --git a/test/fixtures/esprima/statement-return/migrated_0003/expected.json b/test/fixtures/esprima/statement-return/migrated_0003/expected.json new file mode 100644 index 0000000000..9c0041eb71 --- /dev/null +++ b/test/fixtures/esprima/statement-return/migrated_0003/expected.json @@ -0,0 +1,148 @@ +{ + "type": "File", + "start": 0, + "end": 28, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 28 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 28, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 28 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 28, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 28 + } + }, + "expression": { + "type": "FunctionExpression", + "start": 1, + "end": 27, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 27 + } + }, + "id": null, + "generator": false, + "expression": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 11, + "end": 27, + "loc": { + "start": { + "line": 1, + "column": 11 + }, + "end": { + "line": 1, + "column": 27 + } + }, + "body": [ + { + "type": "ReturnStatement", + "start": 13, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 1, + "column": 25 + } + }, + "argument": { + "type": "BinaryExpression", + "start": 20, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 20 + }, + "end": { + "line": 1, + "column": 25 + } + }, + "left": { + "type": "Identifier", + "start": 20, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 20 + }, + "end": { + "line": 1, + "column": 21 + } + }, + "name": "x" + }, + "operator": "*", + "right": { + "type": "Identifier", + "start": 24, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 24 + }, + "end": { + "line": 1, + "column": 25 + } + }, + "name": "y" + } + } + } + ] + }, + "parenthesizedExpression": true + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/statement-switch/migrated_0000/actual.js b/test/fixtures/esprima/statement-switch/migrated_0000/actual.js new file mode 100644 index 0000000000..25005bdb2a --- /dev/null +++ b/test/fixtures/esprima/statement-switch/migrated_0000/actual.js @@ -0,0 +1 @@ +switch (x) {} diff --git a/test/fixtures/esprima/statement-switch/migrated_0000/expected.json b/test/fixtures/esprima/statement-switch/migrated_0000/expected.json new file mode 100644 index 0000000000..e48fd0f035 --- /dev/null +++ b/test/fixtures/esprima/statement-switch/migrated_0000/expected.json @@ -0,0 +1,65 @@ +{ + "type": "File", + "start": 0, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "sourceType": "script", + "body": [ + { + "type": "SwitchStatement", + "start": 0, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "discriminant": { + "type": "Identifier", + "start": 8, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "name": "x" + }, + "cases": [] + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/statement-switch/migrated_0001/actual.js b/test/fixtures/esprima/statement-switch/migrated_0001/actual.js new file mode 100644 index 0000000000..412007b26f --- /dev/null +++ b/test/fixtures/esprima/statement-switch/migrated_0001/actual.js @@ -0,0 +1 @@ +switch (answer) { case 42: hi(); break; } diff --git a/test/fixtures/esprima/statement-switch/migrated_0001/expected.json b/test/fixtures/esprima/statement-switch/migrated_0001/expected.json new file mode 100644 index 0000000000..62e79f338e --- /dev/null +++ b/test/fixtures/esprima/statement-switch/migrated_0001/expected.json @@ -0,0 +1,164 @@ +{ + "type": "File", + "start": 0, + "end": 41, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 41 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 41, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 41 + } + }, + "sourceType": "script", + "body": [ + { + "type": "SwitchStatement", + "start": 0, + "end": 41, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 41 + } + }, + "discriminant": { + "type": "Identifier", + "start": 8, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "name": "answer" + }, + "cases": [ + { + "type": "SwitchCase", + "start": 18, + "end": 39, + "loc": { + "start": { + "line": 1, + "column": 18 + }, + "end": { + "line": 1, + "column": 39 + } + }, + "consequent": [ + { + "type": "ExpressionStatement", + "start": 27, + "end": 32, + "loc": { + "start": { + "line": 1, + "column": 27 + }, + "end": { + "line": 1, + "column": 32 + } + }, + "expression": { + "type": "CallExpression", + "start": 27, + "end": 31, + "loc": { + "start": { + "line": 1, + "column": 27 + }, + "end": { + "line": 1, + "column": 31 + } + }, + "callee": { + "type": "Identifier", + "start": 27, + "end": 29, + "loc": { + "start": { + "line": 1, + "column": 27 + }, + "end": { + "line": 1, + "column": 29 + } + }, + "name": "hi" + }, + "arguments": [] + } + }, + { + "type": "BreakStatement", + "start": 33, + "end": 39, + "loc": { + "start": { + "line": 1, + "column": 33 + }, + "end": { + "line": 1, + "column": 39 + } + }, + "label": null + } + ], + "test": { + "type": "Literal", + "start": 23, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 23 + }, + "end": { + "line": 1, + "column": 25 + } + }, + "value": 42, + "rawValue": 42, + "raw": "42" + } + } + ] + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/statement-switch/migrated_0002/actual.js b/test/fixtures/esprima/statement-switch/migrated_0002/actual.js new file mode 100644 index 0000000000..dcf477dadd --- /dev/null +++ b/test/fixtures/esprima/statement-switch/migrated_0002/actual.js @@ -0,0 +1 @@ +switch (answer) { case 42: hi(); break; default: break } diff --git a/test/fixtures/esprima/statement-switch/migrated_0002/expected.json b/test/fixtures/esprima/statement-switch/migrated_0002/expected.json new file mode 100644 index 0000000000..b29ad0f66d --- /dev/null +++ b/test/fixtures/esprima/statement-switch/migrated_0002/expected.json @@ -0,0 +1,198 @@ +{ + "type": "File", + "start": 0, + "end": 56, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 56 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 56, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 56 + } + }, + "sourceType": "script", + "body": [ + { + "type": "SwitchStatement", + "start": 0, + "end": 56, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 56 + } + }, + "discriminant": { + "type": "Identifier", + "start": 8, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "name": "answer" + }, + "cases": [ + { + "type": "SwitchCase", + "start": 18, + "end": 39, + "loc": { + "start": { + "line": 1, + "column": 18 + }, + "end": { + "line": 1, + "column": 39 + } + }, + "consequent": [ + { + "type": "ExpressionStatement", + "start": 27, + "end": 32, + "loc": { + "start": { + "line": 1, + "column": 27 + }, + "end": { + "line": 1, + "column": 32 + } + }, + "expression": { + "type": "CallExpression", + "start": 27, + "end": 31, + "loc": { + "start": { + "line": 1, + "column": 27 + }, + "end": { + "line": 1, + "column": 31 + } + }, + "callee": { + "type": "Identifier", + "start": 27, + "end": 29, + "loc": { + "start": { + "line": 1, + "column": 27 + }, + "end": { + "line": 1, + "column": 29 + } + }, + "name": "hi" + }, + "arguments": [] + } + }, + { + "type": "BreakStatement", + "start": 33, + "end": 39, + "loc": { + "start": { + "line": 1, + "column": 33 + }, + "end": { + "line": 1, + "column": 39 + } + }, + "label": null + } + ], + "test": { + "type": "Literal", + "start": 23, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 23 + }, + "end": { + "line": 1, + "column": 25 + } + }, + "value": 42, + "rawValue": 42, + "raw": "42" + } + }, + { + "type": "SwitchCase", + "start": 40, + "end": 54, + "loc": { + "start": { + "line": 1, + "column": 40 + }, + "end": { + "line": 1, + "column": 54 + } + }, + "consequent": [ + { + "type": "BreakStatement", + "start": 49, + "end": 54, + "loc": { + "start": { + "line": 1, + "column": 49 + }, + "end": { + "line": 1, + "column": 54 + } + }, + "label": null + } + ], + "test": null + } + ] + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/statement-throw/migrated_0000/actual.js b/test/fixtures/esprima/statement-throw/migrated_0000/actual.js new file mode 100644 index 0000000000..c7426bffc6 --- /dev/null +++ b/test/fixtures/esprima/statement-throw/migrated_0000/actual.js @@ -0,0 +1 @@ +throw x; diff --git a/test/fixtures/esprima/statement-throw/migrated_0000/expected.json b/test/fixtures/esprima/statement-throw/migrated_0000/expected.json new file mode 100644 index 0000000000..0e9f3c0da0 --- /dev/null +++ b/test/fixtures/esprima/statement-throw/migrated_0000/expected.json @@ -0,0 +1,64 @@ +{ + "type": "File", + "start": 0, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ThrowStatement", + "start": 0, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "argument": { + "type": "Identifier", + "start": 6, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "name": "x" + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/statement-throw/migrated_0001/actual.js b/test/fixtures/esprima/statement-throw/migrated_0001/actual.js new file mode 100644 index 0000000000..22d107700d --- /dev/null +++ b/test/fixtures/esprima/statement-throw/migrated_0001/actual.js @@ -0,0 +1 @@ +throw x * y diff --git a/test/fixtures/esprima/statement-throw/migrated_0001/expected.json b/test/fixtures/esprima/statement-throw/migrated_0001/expected.json new file mode 100644 index 0000000000..91f3d0ffa7 --- /dev/null +++ b/test/fixtures/esprima/statement-throw/migrated_0001/expected.json @@ -0,0 +1,96 @@ +{ + "type": "File", + "start": 0, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ThrowStatement", + "start": 0, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "argument": { + "type": "BinaryExpression", + "start": 6, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "left": { + "type": "Identifier", + "start": 6, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "name": "x" + }, + "operator": "*", + "right": { + "type": "Identifier", + "start": 10, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "name": "y" + } + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/statement-throw/migrated_0002/actual.js b/test/fixtures/esprima/statement-throw/migrated_0002/actual.js new file mode 100644 index 0000000000..b1590926c9 --- /dev/null +++ b/test/fixtures/esprima/statement-throw/migrated_0002/actual.js @@ -0,0 +1 @@ +throw { message: "Error" } diff --git a/test/fixtures/esprima/statement-throw/migrated_0002/expected.json b/test/fixtures/esprima/statement-throw/migrated_0002/expected.json new file mode 100644 index 0000000000..fe437eefa7 --- /dev/null +++ b/test/fixtures/esprima/statement-throw/migrated_0002/expected.json @@ -0,0 +1,118 @@ +{ + "type": "File", + "start": 0, + "end": 26, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 26 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 26, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 26 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ThrowStatement", + "start": 0, + "end": 26, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 26 + } + }, + "argument": { + "type": "ObjectExpression", + "start": 6, + "end": 26, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 26 + } + }, + "properties": [ + { + "type": "Property", + "start": 8, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 24 + } + }, + "method": false, + "shorthand": false, + "computed": false, + "key": { + "type": "Identifier", + "start": 8, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "name": "message" + }, + "value": { + "type": "Literal", + "start": 17, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 17 + }, + "end": { + "line": 1, + "column": 24 + } + }, + "value": "Error", + "rawValue": "Error", + "raw": "\"Error\"" + }, + "kind": "init" + } + ] + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/statement-try/migrated_0000/actual.js b/test/fixtures/esprima/statement-try/migrated_0000/actual.js new file mode 100644 index 0000000000..f264c628b5 --- /dev/null +++ b/test/fixtures/esprima/statement-try/migrated_0000/actual.js @@ -0,0 +1 @@ +try { } catch (e) { } diff --git a/test/fixtures/esprima/statement-try/migrated_0000/expected.json b/test/fixtures/esprima/statement-try/migrated_0000/expected.json new file mode 100644 index 0000000000..49a3324324 --- /dev/null +++ b/test/fixtures/esprima/statement-try/migrated_0000/expected.json @@ -0,0 +1,113 @@ +{ + "type": "File", + "start": 0, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 21 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 21 + } + }, + "sourceType": "script", + "body": [ + { + "type": "TryStatement", + "start": 0, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 21 + } + }, + "block": { + "type": "BlockStatement", + "start": 4, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "body": [] + }, + "handler": { + "type": "CatchClause", + "start": 8, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 21 + } + }, + "param": { + "type": "Identifier", + "start": 15, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "name": "e" + }, + "body": { + "type": "BlockStatement", + "start": 18, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 18 + }, + "end": { + "line": 1, + "column": 21 + } + }, + "body": [] + } + }, + "guardedHandlers": [], + "finalizer": null + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/statement-try/migrated_0001/actual.js b/test/fixtures/esprima/statement-try/migrated_0001/actual.js new file mode 100644 index 0000000000..5d9613956b --- /dev/null +++ b/test/fixtures/esprima/statement-try/migrated_0001/actual.js @@ -0,0 +1 @@ +try { } catch (eval) { } diff --git a/test/fixtures/esprima/statement-try/migrated_0001/expected.json b/test/fixtures/esprima/statement-try/migrated_0001/expected.json new file mode 100644 index 0000000000..4fa8f999b5 --- /dev/null +++ b/test/fixtures/esprima/statement-try/migrated_0001/expected.json @@ -0,0 +1,113 @@ +{ + "type": "File", + "start": 0, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 24 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 24 + } + }, + "sourceType": "script", + "body": [ + { + "type": "TryStatement", + "start": 0, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 24 + } + }, + "block": { + "type": "BlockStatement", + "start": 4, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "body": [] + }, + "handler": { + "type": "CatchClause", + "start": 8, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 24 + } + }, + "param": { + "type": "Identifier", + "start": 15, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 19 + } + }, + "name": "eval" + }, + "body": { + "type": "BlockStatement", + "start": 21, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 21 + }, + "end": { + "line": 1, + "column": 24 + } + }, + "body": [] + } + }, + "guardedHandlers": [], + "finalizer": null + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/statement-try/migrated_0002/actual.js b/test/fixtures/esprima/statement-try/migrated_0002/actual.js new file mode 100644 index 0000000000..b2a574c326 --- /dev/null +++ b/test/fixtures/esprima/statement-try/migrated_0002/actual.js @@ -0,0 +1 @@ +try { } catch (arguments) { } diff --git a/test/fixtures/esprima/statement-try/migrated_0002/expected.json b/test/fixtures/esprima/statement-try/migrated_0002/expected.json new file mode 100644 index 0000000000..42cc2e8bf7 --- /dev/null +++ b/test/fixtures/esprima/statement-try/migrated_0002/expected.json @@ -0,0 +1,113 @@ +{ + "type": "File", + "start": 0, + "end": 29, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 29 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 29, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 29 + } + }, + "sourceType": "script", + "body": [ + { + "type": "TryStatement", + "start": 0, + "end": 29, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 29 + } + }, + "block": { + "type": "BlockStatement", + "start": 4, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "body": [] + }, + "handler": { + "type": "CatchClause", + "start": 8, + "end": 29, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 29 + } + }, + "param": { + "type": "Identifier", + "start": 15, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 24 + } + }, + "name": "arguments" + }, + "body": { + "type": "BlockStatement", + "start": 26, + "end": 29, + "loc": { + "start": { + "line": 1, + "column": 26 + }, + "end": { + "line": 1, + "column": 29 + } + }, + "body": [] + } + }, + "guardedHandlers": [], + "finalizer": null + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/statement-try/migrated_0003/actual.js b/test/fixtures/esprima/statement-try/migrated_0003/actual.js new file mode 100644 index 0000000000..83fb8d6e80 --- /dev/null +++ b/test/fixtures/esprima/statement-try/migrated_0003/actual.js @@ -0,0 +1 @@ +try { } catch (e) { say(e) } diff --git a/test/fixtures/esprima/statement-try/migrated_0003/expected.json b/test/fixtures/esprima/statement-try/migrated_0003/expected.json new file mode 100644 index 0000000000..bb353db32f --- /dev/null +++ b/test/fixtures/esprima/statement-try/migrated_0003/expected.json @@ -0,0 +1,178 @@ +{ + "type": "File", + "start": 0, + "end": 28, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 28 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 28, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 28 + } + }, + "sourceType": "script", + "body": [ + { + "type": "TryStatement", + "start": 0, + "end": 28, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 28 + } + }, + "block": { + "type": "BlockStatement", + "start": 4, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "body": [] + }, + "handler": { + "type": "CatchClause", + "start": 8, + "end": 28, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 28 + } + }, + "param": { + "type": "Identifier", + "start": 15, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "name": "e" + }, + "body": { + "type": "BlockStatement", + "start": 18, + "end": 28, + "loc": { + "start": { + "line": 1, + "column": 18 + }, + "end": { + "line": 1, + "column": 28 + } + }, + "body": [ + { + "type": "ExpressionStatement", + "start": 20, + "end": 26, + "loc": { + "start": { + "line": 1, + "column": 20 + }, + "end": { + "line": 1, + "column": 26 + } + }, + "expression": { + "type": "CallExpression", + "start": 20, + "end": 26, + "loc": { + "start": { + "line": 1, + "column": 20 + }, + "end": { + "line": 1, + "column": 26 + } + }, + "callee": { + "type": "Identifier", + "start": 20, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 20 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "name": "say" + }, + "arguments": [ + { + "type": "Identifier", + "start": 24, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 24 + }, + "end": { + "line": 1, + "column": 25 + } + }, + "name": "e" + } + ] + } + } + ] + } + }, + "guardedHandlers": [], + "finalizer": null + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/statement-try/migrated_0004/actual.js b/test/fixtures/esprima/statement-try/migrated_0004/actual.js new file mode 100644 index 0000000000..6c596bdefb --- /dev/null +++ b/test/fixtures/esprima/statement-try/migrated_0004/actual.js @@ -0,0 +1 @@ +try { } finally { cleanup(stuff) } diff --git a/test/fixtures/esprima/statement-try/migrated_0004/expected.json b/test/fixtures/esprima/statement-try/migrated_0004/expected.json new file mode 100644 index 0000000000..ca8f6bd080 --- /dev/null +++ b/test/fixtures/esprima/statement-try/migrated_0004/expected.json @@ -0,0 +1,147 @@ +{ + "type": "File", + "start": 0, + "end": 34, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 34 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 34, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 34 + } + }, + "sourceType": "script", + "body": [ + { + "type": "TryStatement", + "start": 0, + "end": 34, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 34 + } + }, + "block": { + "type": "BlockStatement", + "start": 4, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "body": [] + }, + "handler": null, + "guardedHandlers": [], + "finalizer": { + "type": "BlockStatement", + "start": 16, + "end": 34, + "loc": { + "start": { + "line": 1, + "column": 16 + }, + "end": { + "line": 1, + "column": 34 + } + }, + "body": [ + { + "type": "ExpressionStatement", + "start": 18, + "end": 32, + "loc": { + "start": { + "line": 1, + "column": 18 + }, + "end": { + "line": 1, + "column": 32 + } + }, + "expression": { + "type": "CallExpression", + "start": 18, + "end": 32, + "loc": { + "start": { + "line": 1, + "column": 18 + }, + "end": { + "line": 1, + "column": 32 + } + }, + "callee": { + "type": "Identifier", + "start": 18, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 18 + }, + "end": { + "line": 1, + "column": 25 + } + }, + "name": "cleanup" + }, + "arguments": [ + { + "type": "Identifier", + "start": 26, + "end": 31, + "loc": { + "start": { + "line": 1, + "column": 26 + }, + "end": { + "line": 1, + "column": 31 + } + }, + "name": "stuff" + } + ] + } + } + ] + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/statement-try/migrated_0005/actual.js b/test/fixtures/esprima/statement-try/migrated_0005/actual.js new file mode 100644 index 0000000000..ea86126dc6 --- /dev/null +++ b/test/fixtures/esprima/statement-try/migrated_0005/actual.js @@ -0,0 +1 @@ +try { doThat(); } catch (e) { say(e) } diff --git a/test/fixtures/esprima/statement-try/migrated_0005/expected.json b/test/fixtures/esprima/statement-try/migrated_0005/expected.json new file mode 100644 index 0000000000..291705c18b --- /dev/null +++ b/test/fixtures/esprima/statement-try/migrated_0005/expected.json @@ -0,0 +1,226 @@ +{ + "type": "File", + "start": 0, + "end": 38, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 38 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 38, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 38 + } + }, + "sourceType": "script", + "body": [ + { + "type": "TryStatement", + "start": 0, + "end": 38, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 38 + } + }, + "block": { + "type": "BlockStatement", + "start": 4, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "body": [ + { + "type": "ExpressionStatement", + "start": 6, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "expression": { + "type": "CallExpression", + "start": 6, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "callee": { + "type": "Identifier", + "start": 6, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "name": "doThat" + }, + "arguments": [] + } + } + ] + }, + "handler": { + "type": "CatchClause", + "start": 18, + "end": 38, + "loc": { + "start": { + "line": 1, + "column": 18 + }, + "end": { + "line": 1, + "column": 38 + } + }, + "param": { + "type": "Identifier", + "start": 25, + "end": 26, + "loc": { + "start": { + "line": 1, + "column": 25 + }, + "end": { + "line": 1, + "column": 26 + } + }, + "name": "e" + }, + "body": { + "type": "BlockStatement", + "start": 28, + "end": 38, + "loc": { + "start": { + "line": 1, + "column": 28 + }, + "end": { + "line": 1, + "column": 38 + } + }, + "body": [ + { + "type": "ExpressionStatement", + "start": 30, + "end": 36, + "loc": { + "start": { + "line": 1, + "column": 30 + }, + "end": { + "line": 1, + "column": 36 + } + }, + "expression": { + "type": "CallExpression", + "start": 30, + "end": 36, + "loc": { + "start": { + "line": 1, + "column": 30 + }, + "end": { + "line": 1, + "column": 36 + } + }, + "callee": { + "type": "Identifier", + "start": 30, + "end": 33, + "loc": { + "start": { + "line": 1, + "column": 30 + }, + "end": { + "line": 1, + "column": 33 + } + }, + "name": "say" + }, + "arguments": [ + { + "type": "Identifier", + "start": 34, + "end": 35, + "loc": { + "start": { + "line": 1, + "column": 34 + }, + "end": { + "line": 1, + "column": 35 + } + }, + "name": "e" + } + ] + } + } + ] + } + }, + "guardedHandlers": [], + "finalizer": null + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/statement-try/migrated_0006/actual.js b/test/fixtures/esprima/statement-try/migrated_0006/actual.js new file mode 100644 index 0000000000..2557ec761a --- /dev/null +++ b/test/fixtures/esprima/statement-try/migrated_0006/actual.js @@ -0,0 +1 @@ +try { doThat(); } catch (e) { say(e) } finally { cleanup(stuff) } diff --git a/test/fixtures/esprima/statement-try/migrated_0006/expected.json b/test/fixtures/esprima/statement-try/migrated_0006/expected.json new file mode 100644 index 0000000000..9dd799f3ee --- /dev/null +++ b/test/fixtures/esprima/statement-try/migrated_0006/expected.json @@ -0,0 +1,306 @@ +{ + "type": "File", + "start": 0, + "end": 65, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 65 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 65, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 65 + } + }, + "sourceType": "script", + "body": [ + { + "type": "TryStatement", + "start": 0, + "end": 65, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 65 + } + }, + "block": { + "type": "BlockStatement", + "start": 4, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "body": [ + { + "type": "ExpressionStatement", + "start": 6, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "expression": { + "type": "CallExpression", + "start": 6, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "callee": { + "type": "Identifier", + "start": 6, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "name": "doThat" + }, + "arguments": [] + } + } + ] + }, + "handler": { + "type": "CatchClause", + "start": 18, + "end": 38, + "loc": { + "start": { + "line": 1, + "column": 18 + }, + "end": { + "line": 1, + "column": 38 + } + }, + "param": { + "type": "Identifier", + "start": 25, + "end": 26, + "loc": { + "start": { + "line": 1, + "column": 25 + }, + "end": { + "line": 1, + "column": 26 + } + }, + "name": "e" + }, + "body": { + "type": "BlockStatement", + "start": 28, + "end": 38, + "loc": { + "start": { + "line": 1, + "column": 28 + }, + "end": { + "line": 1, + "column": 38 + } + }, + "body": [ + { + "type": "ExpressionStatement", + "start": 30, + "end": 36, + "loc": { + "start": { + "line": 1, + "column": 30 + }, + "end": { + "line": 1, + "column": 36 + } + }, + "expression": { + "type": "CallExpression", + "start": 30, + "end": 36, + "loc": { + "start": { + "line": 1, + "column": 30 + }, + "end": { + "line": 1, + "column": 36 + } + }, + "callee": { + "type": "Identifier", + "start": 30, + "end": 33, + "loc": { + "start": { + "line": 1, + "column": 30 + }, + "end": { + "line": 1, + "column": 33 + } + }, + "name": "say" + }, + "arguments": [ + { + "type": "Identifier", + "start": 34, + "end": 35, + "loc": { + "start": { + "line": 1, + "column": 34 + }, + "end": { + "line": 1, + "column": 35 + } + }, + "name": "e" + } + ] + } + } + ] + } + }, + "guardedHandlers": [], + "finalizer": { + "type": "BlockStatement", + "start": 47, + "end": 65, + "loc": { + "start": { + "line": 1, + "column": 47 + }, + "end": { + "line": 1, + "column": 65 + } + }, + "body": [ + { + "type": "ExpressionStatement", + "start": 49, + "end": 63, + "loc": { + "start": { + "line": 1, + "column": 49 + }, + "end": { + "line": 1, + "column": 63 + } + }, + "expression": { + "type": "CallExpression", + "start": 49, + "end": 63, + "loc": { + "start": { + "line": 1, + "column": 49 + }, + "end": { + "line": 1, + "column": 63 + } + }, + "callee": { + "type": "Identifier", + "start": 49, + "end": 56, + "loc": { + "start": { + "line": 1, + "column": 49 + }, + "end": { + "line": 1, + "column": 56 + } + }, + "name": "cleanup" + }, + "arguments": [ + { + "type": "Identifier", + "start": 57, + "end": 62, + "loc": { + "start": { + "line": 1, + "column": 57 + }, + "end": { + "line": 1, + "column": 62 + } + }, + "name": "stuff" + } + ] + } + } + ] + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/statement-variable/complex-pattern-requires-init/actual.js b/test/fixtures/esprima/statement-variable/complex-pattern-requires-init/actual.js new file mode 100644 index 0000000000..9fc941b2c1 --- /dev/null +++ b/test/fixtures/esprima/statement-variable/complex-pattern-requires-init/actual.js @@ -0,0 +1 @@ +var [] diff --git a/test/fixtures/esprima/statement-variable/complex-pattern-requires-init/options.json b/test/fixtures/esprima/statement-variable/complex-pattern-requires-init/options.json new file mode 100644 index 0000000000..8cb567ee77 --- /dev/null +++ b/test/fixtures/esprima/statement-variable/complex-pattern-requires-init/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Complex binding patterns require an initialization value (1:6)" +} \ No newline at end of file diff --git a/test/fixtures/esprima/statement-variable/migrated_0000/actual.js b/test/fixtures/esprima/statement-variable/migrated_0000/actual.js new file mode 100644 index 0000000000..2660e277b1 --- /dev/null +++ b/test/fixtures/esprima/statement-variable/migrated_0000/actual.js @@ -0,0 +1 @@ +var x diff --git a/test/fixtures/esprima/statement-variable/migrated_0000/expected.json b/test/fixtures/esprima/statement-variable/migrated_0000/expected.json new file mode 100644 index 0000000000..ec2dadfcf0 --- /dev/null +++ b/test/fixtures/esprima/statement-variable/migrated_0000/expected.json @@ -0,0 +1,83 @@ +{ + "type": "File", + "start": 0, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "sourceType": "script", + "body": [ + { + "type": "VariableDeclaration", + "start": 0, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 4, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "id": { + "type": "Identifier", + "start": 4, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "name": "x" + }, + "init": null + } + ], + "kind": "var" + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/statement-variable/migrated_0001/actual.js b/test/fixtures/esprima/statement-variable/migrated_0001/actual.js new file mode 100644 index 0000000000..fecb2697c9 --- /dev/null +++ b/test/fixtures/esprima/statement-variable/migrated_0001/actual.js @@ -0,0 +1 @@ +var x, y; diff --git a/test/fixtures/esprima/statement-variable/migrated_0001/expected.json b/test/fixtures/esprima/statement-variable/migrated_0001/expected.json new file mode 100644 index 0000000000..4ed5077fe0 --- /dev/null +++ b/test/fixtures/esprima/statement-variable/migrated_0001/expected.json @@ -0,0 +1,115 @@ +{ + "type": "File", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "sourceType": "script", + "body": [ + { + "type": "VariableDeclaration", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 4, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "id": { + "type": "Identifier", + "start": 4, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "name": "x" + }, + "init": null + }, + { + "type": "VariableDeclarator", + "start": 7, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "id": { + "type": "Identifier", + "start": 7, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "name": "y" + }, + "init": null + } + ], + "kind": "var" + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/statement-variable/migrated_0002/actual.js b/test/fixtures/esprima/statement-variable/migrated_0002/actual.js new file mode 100644 index 0000000000..9a3e04e016 --- /dev/null +++ b/test/fixtures/esprima/statement-variable/migrated_0002/actual.js @@ -0,0 +1 @@ +var x = 42 diff --git a/test/fixtures/esprima/statement-variable/migrated_0002/expected.json b/test/fixtures/esprima/statement-variable/migrated_0002/expected.json new file mode 100644 index 0000000000..a5b0f49382 --- /dev/null +++ b/test/fixtures/esprima/statement-variable/migrated_0002/expected.json @@ -0,0 +1,100 @@ +{ + "type": "File", + "start": 0, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "sourceType": "script", + "body": [ + { + "type": "VariableDeclaration", + "start": 0, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 4, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "id": { + "type": "Identifier", + "start": 4, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "name": "x" + }, + "init": { + "type": "Literal", + "start": 8, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "value": 42, + "rawValue": 42, + "raw": "42" + } + } + ], + "kind": "var" + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/statement-variable/migrated_0003/actual.js b/test/fixtures/esprima/statement-variable/migrated_0003/actual.js new file mode 100644 index 0000000000..52b77fe20a --- /dev/null +++ b/test/fixtures/esprima/statement-variable/migrated_0003/actual.js @@ -0,0 +1 @@ +var eval = 42, arguments = 42 diff --git a/test/fixtures/esprima/statement-variable/migrated_0003/expected.json b/test/fixtures/esprima/statement-variable/migrated_0003/expected.json new file mode 100644 index 0000000000..6ed6cc90fa --- /dev/null +++ b/test/fixtures/esprima/statement-variable/migrated_0003/expected.json @@ -0,0 +1,149 @@ +{ + "type": "File", + "start": 0, + "end": 29, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 29 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 29, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 29 + } + }, + "sourceType": "script", + "body": [ + { + "type": "VariableDeclaration", + "start": 0, + "end": 29, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 29 + } + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 4, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "id": { + "type": "Identifier", + "start": 4, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "name": "eval" + }, + "init": { + "type": "Literal", + "start": 11, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 11 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "value": 42, + "rawValue": 42, + "raw": "42" + } + }, + { + "type": "VariableDeclarator", + "start": 15, + "end": 29, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 29 + } + }, + "id": { + "type": "Identifier", + "start": 15, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 24 + } + }, + "name": "arguments" + }, + "init": { + "type": "Literal", + "start": 27, + "end": 29, + "loc": { + "start": { + "line": 1, + "column": 27 + }, + "end": { + "line": 1, + "column": 29 + } + }, + "value": 42, + "rawValue": 42, + "raw": "42" + } + } + ], + "kind": "var" + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/statement-variable/migrated_0004/actual.js b/test/fixtures/esprima/statement-variable/migrated_0004/actual.js new file mode 100644 index 0000000000..ac20052692 --- /dev/null +++ b/test/fixtures/esprima/statement-variable/migrated_0004/actual.js @@ -0,0 +1 @@ +var x = 14, y = 3, z = 1977 diff --git a/test/fixtures/esprima/statement-variable/migrated_0004/expected.json b/test/fixtures/esprima/statement-variable/migrated_0004/expected.json new file mode 100644 index 0000000000..6b9e9e3f3a --- /dev/null +++ b/test/fixtures/esprima/statement-variable/migrated_0004/expected.json @@ -0,0 +1,198 @@ +{ + "type": "File", + "start": 0, + "end": 27, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 27 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 27, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 27 + } + }, + "sourceType": "script", + "body": [ + { + "type": "VariableDeclaration", + "start": 0, + "end": 27, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 27 + } + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 4, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "id": { + "type": "Identifier", + "start": 4, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "name": "x" + }, + "init": { + "type": "Literal", + "start": 8, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "value": 14, + "rawValue": 14, + "raw": "14" + } + }, + { + "type": "VariableDeclarator", + "start": 12, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 12 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "id": { + "type": "Identifier", + "start": 12, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 12 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "name": "y" + }, + "init": { + "type": "Literal", + "start": 16, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 16 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "value": 3, + "rawValue": 3, + "raw": "3" + } + }, + { + "type": "VariableDeclarator", + "start": 19, + "end": 27, + "loc": { + "start": { + "line": 1, + "column": 19 + }, + "end": { + "line": 1, + "column": 27 + } + }, + "id": { + "type": "Identifier", + "start": 19, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 19 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "name": "z" + }, + "init": { + "type": "Literal", + "start": 23, + "end": 27, + "loc": { + "start": { + "line": 1, + "column": 23 + }, + "end": { + "line": 1, + "column": 27 + } + }, + "value": 1977, + "rawValue": 1977, + "raw": "1977" + } + } + ], + "kind": "var" + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/statement-variable/migrated_0005/actual.js b/test/fixtures/esprima/statement-variable/migrated_0005/actual.js new file mode 100644 index 0000000000..db88914197 --- /dev/null +++ b/test/fixtures/esprima/statement-variable/migrated_0005/actual.js @@ -0,0 +1 @@ +var implements, interface, package diff --git a/test/fixtures/esprima/statement-variable/migrated_0005/expected.json b/test/fixtures/esprima/statement-variable/migrated_0005/expected.json new file mode 100644 index 0000000000..17a5559327 --- /dev/null +++ b/test/fixtures/esprima/statement-variable/migrated_0005/expected.json @@ -0,0 +1,147 @@ +{ + "type": "File", + "start": 0, + "end": 34, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 34 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 34, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 34 + } + }, + "sourceType": "script", + "body": [ + { + "type": "VariableDeclaration", + "start": 0, + "end": 34, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 34 + } + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 4, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "id": { + "type": "Identifier", + "start": 4, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "name": "implements" + }, + "init": null + }, + { + "type": "VariableDeclarator", + "start": 16, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 16 + }, + "end": { + "line": 1, + "column": 25 + } + }, + "id": { + "type": "Identifier", + "start": 16, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 16 + }, + "end": { + "line": 1, + "column": 25 + } + }, + "name": "interface" + }, + "init": null + }, + { + "type": "VariableDeclarator", + "start": 27, + "end": 34, + "loc": { + "start": { + "line": 1, + "column": 27 + }, + "end": { + "line": 1, + "column": 34 + } + }, + "id": { + "type": "Identifier", + "start": 27, + "end": 34, + "loc": { + "start": { + "line": 1, + "column": 27 + }, + "end": { + "line": 1, + "column": 34 + } + }, + "name": "package" + }, + "init": null + } + ], + "kind": "var" + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/statement-variable/migrated_0006/actual.js b/test/fixtures/esprima/statement-variable/migrated_0006/actual.js new file mode 100644 index 0000000000..5d2ca7181e --- /dev/null +++ b/test/fixtures/esprima/statement-variable/migrated_0006/actual.js @@ -0,0 +1 @@ +var private, protected, public, static diff --git a/test/fixtures/esprima/statement-variable/migrated_0006/expected.json b/test/fixtures/esprima/statement-variable/migrated_0006/expected.json new file mode 100644 index 0000000000..8744560249 --- /dev/null +++ b/test/fixtures/esprima/statement-variable/migrated_0006/expected.json @@ -0,0 +1,179 @@ +{ + "type": "File", + "start": 0, + "end": 38, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 38 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 38, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 38 + } + }, + "sourceType": "script", + "body": [ + { + "type": "VariableDeclaration", + "start": 0, + "end": 38, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 38 + } + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 4, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "id": { + "type": "Identifier", + "start": 4, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "name": "private" + }, + "init": null + }, + { + "type": "VariableDeclarator", + "start": 13, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "id": { + "type": "Identifier", + "start": 13, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "name": "protected" + }, + "init": null + }, + { + "type": "VariableDeclarator", + "start": 24, + "end": 30, + "loc": { + "start": { + "line": 1, + "column": 24 + }, + "end": { + "line": 1, + "column": 30 + } + }, + "id": { + "type": "Identifier", + "start": 24, + "end": 30, + "loc": { + "start": { + "line": 1, + "column": 24 + }, + "end": { + "line": 1, + "column": 30 + } + }, + "name": "public" + }, + "init": null + }, + { + "type": "VariableDeclarator", + "start": 32, + "end": 38, + "loc": { + "start": { + "line": 1, + "column": 32 + }, + "end": { + "line": 1, + "column": 38 + } + }, + "id": { + "type": "Identifier", + "start": 32, + "end": 38, + "loc": { + "start": { + "line": 1, + "column": 32 + }, + "end": { + "line": 1, + "column": 38 + } + }, + "name": "static" + }, + "init": null + } + ], + "kind": "var" + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/statement-with/migrated_0000/actual.js b/test/fixtures/esprima/statement-with/migrated_0000/actual.js new file mode 100644 index 0000000000..b3f4ca4b0d --- /dev/null +++ b/test/fixtures/esprima/statement-with/migrated_0000/actual.js @@ -0,0 +1 @@ +with (x) foo = bar diff --git a/test/fixtures/esprima/statement-with/migrated_0000/expected.json b/test/fixtures/esprima/statement-with/migrated_0000/expected.json new file mode 100644 index 0000000000..f4e3da9d15 --- /dev/null +++ b/test/fixtures/esprima/statement-with/migrated_0000/expected.json @@ -0,0 +1,127 @@ +{ + "type": "File", + "start": 0, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "sourceType": "script", + "body": [ + { + "type": "WithStatement", + "start": 0, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "object": { + "type": "Identifier", + "start": 6, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "name": "x" + }, + "body": { + "type": "ExpressionStatement", + "start": 9, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "expression": { + "type": "AssignmentExpression", + "start": 9, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "operator": "=", + "left": { + "type": "Identifier", + "start": 9, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "name": "foo" + }, + "right": { + "type": "Identifier", + "start": 15, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "name": "bar" + } + } + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/statement-with/migrated_0001/actual.js b/test/fixtures/esprima/statement-with/migrated_0001/actual.js new file mode 100644 index 0000000000..66310a50db --- /dev/null +++ b/test/fixtures/esprima/statement-with/migrated_0001/actual.js @@ -0,0 +1 @@ +with (x) foo = bar; diff --git a/test/fixtures/esprima/statement-with/migrated_0001/expected.json b/test/fixtures/esprima/statement-with/migrated_0001/expected.json new file mode 100644 index 0000000000..9e895a7f45 --- /dev/null +++ b/test/fixtures/esprima/statement-with/migrated_0001/expected.json @@ -0,0 +1,127 @@ +{ + "type": "File", + "start": 0, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 19 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 19 + } + }, + "sourceType": "script", + "body": [ + { + "type": "WithStatement", + "start": 0, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 19 + } + }, + "object": { + "type": "Identifier", + "start": 6, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "name": "x" + }, + "body": { + "type": "ExpressionStatement", + "start": 9, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 19 + } + }, + "expression": { + "type": "AssignmentExpression", + "start": 9, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "operator": "=", + "left": { + "type": "Identifier", + "start": 9, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "name": "foo" + }, + "right": { + "type": "Identifier", + "start": 15, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "name": "bar" + } + } + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/statement-with/migrated_0002/actual.js b/test/fixtures/esprima/statement-with/migrated_0002/actual.js new file mode 100644 index 0000000000..9a8f202108 --- /dev/null +++ b/test/fixtures/esprima/statement-with/migrated_0002/actual.js @@ -0,0 +1 @@ +with (x) { foo = bar } diff --git a/test/fixtures/esprima/statement-with/migrated_0002/expected.json b/test/fixtures/esprima/statement-with/migrated_0002/expected.json new file mode 100644 index 0000000000..d9e30cca90 --- /dev/null +++ b/test/fixtures/esprima/statement-with/migrated_0002/expected.json @@ -0,0 +1,144 @@ +{ + "type": "File", + "start": 0, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "sourceType": "script", + "body": [ + { + "type": "WithStatement", + "start": 0, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "object": { + "type": "Identifier", + "start": 6, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "name": "x" + }, + "body": { + "type": "BlockStatement", + "start": 9, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "body": [ + { + "type": "ExpressionStatement", + "start": 11, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 11 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "expression": { + "type": "AssignmentExpression", + "start": 11, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 11 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "operator": "=", + "left": { + "type": "Identifier", + "start": 11, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 11 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "name": "foo" + }, + "right": { + "type": "Identifier", + "start": 17, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 17 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "name": "bar" + } + } + } + ] + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/experimental/async-functions/illegal-parens/actual.js b/test/fixtures/experimental/async-functions/illegal-parens/actual.js new file mode 100644 index 0000000000..facf8ca53c --- /dev/null +++ b/test/fixtures/experimental/async-functions/illegal-parens/actual.js @@ -0,0 +1 @@ +var foo = async ((foo)) => {}; diff --git a/test/fixtures/experimental/async-functions/illegal-parens/options.json b/test/fixtures/experimental/async-functions/illegal-parens/options.json new file mode 100644 index 0000000000..fa579aa831 --- /dev/null +++ b/test/fixtures/experimental/async-functions/illegal-parens/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Unexpected token (1:24)" +} diff --git a/test/fixtures/flow/regression/arrow-function-parens-with-return-type/actual.js b/test/fixtures/flow/regression/arrow-function-parens-with-return-type/actual.js new file mode 100644 index 0000000000..0d85be0d03 --- /dev/null +++ b/test/fixtures/flow/regression/arrow-function-parens-with-return-type/actual.js @@ -0,0 +1 @@ +var foo = ((foo)): string => {}; diff --git a/test/fixtures/flow/regression/arrow-function-parens-with-return-type/expected.json b/test/fixtures/flow/regression/arrow-function-parens-with-return-type/expected.json new file mode 100644 index 0000000000..4fba0bba88 --- /dev/null +++ b/test/fixtures/flow/regression/arrow-function-parens-with-return-type/expected.json @@ -0,0 +1,166 @@ +{ + "type": "File", + "start": 0, + "end": 32, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 32 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 32, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 32 + } + }, + "sourceType": "module", + "body": [ + { + "type": "VariableDeclaration", + "start": 0, + "end": 32, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 32 + } + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 4, + "end": 31, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 31 + } + }, + "id": { + "type": "Identifier", + "start": 4, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "name": "foo" + }, + "init": { + "type": "ArrowFunctionExpression", + "start": 10, + "end": 31, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 31 + } + }, + "id": null, + "generator": false, + "expression": false, + "async": false, + "params": [ + { + "type": "Identifier", + "start": 12, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 12 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "name": "foo", + "parenthesizedExpression": true + } + ], + "body": { + "type": "BlockStatement", + "start": 29, + "end": 31, + "loc": { + "start": { + "line": 1, + "column": 29 + }, + "end": { + "line": 1, + "column": 31 + } + }, + "body": [] + }, + "returnType": { + "type": "TypeAnnotation", + "start": 17, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 17 + }, + "end": { + "line": 1, + "column": 25 + } + }, + "typeAnnotation": { + "type": "StringTypeAnnotation", + "start": 19, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 19 + }, + "end": { + "line": 1, + "column": 25 + } + } + } + } + } + } + ], + "kind": "var" + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/flow/regression/arrow-function-parens-with-return-type/options.json b/test/fixtures/flow/regression/arrow-function-parens-with-return-type/options.json new file mode 100644 index 0000000000..e806dd7b3a --- /dev/null +++ b/test/fixtures/flow/regression/arrow-function-parens-with-return-type/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Unexpected token (1:17)" +} diff --git a/test/fixtures/harmony/arrow-functions/inner-parens/actual.js b/test/fixtures/harmony/arrow-functions/inner-parens/actual.js new file mode 100644 index 0000000000..9f3d7cb5de --- /dev/null +++ b/test/fixtures/harmony/arrow-functions/inner-parens/actual.js @@ -0,0 +1 @@ +var foo = ((foo)) => {}; diff --git a/test/fixtures/harmony/arrow-functions/inner-parens/options.json b/test/fixtures/harmony/arrow-functions/inner-parens/options.json new file mode 100644 index 0000000000..cb6c66081e --- /dev/null +++ b/test/fixtures/harmony/arrow-functions/inner-parens/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Unexpected token (1:11)" +} diff --git a/test/fixtures/harmony/uncategorised/289/expected.json b/test/fixtures/harmony/uncategorised/289/expected.json new file mode 100644 index 0000000000..6db69cefb7 --- /dev/null +++ b/test/fixtures/harmony/uncategorised/289/expected.json @@ -0,0 +1,187 @@ +{ + "type": "File", + "start": 0, + "end": 32, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 32 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 32, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 32 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 32, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 32 + } + }, + "expression": { + "type": "ObjectExpression", + "start": 1, + "end": 30, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 30 + } + }, + "properties": [ + { + "type": "Property", + "start": 3, + "end": 28, + "loc": { + "start": { + "line": 1, + "column": 3 + }, + "end": { + "line": 1, + "column": 28 + } + }, + "method": true, + "shorthand": false, + "computed": false, + "key": { + "type": "Identifier", + "start": 3, + "end": 4, + "loc": { + "start": { + "line": 1, + "column": 3 + }, + "end": { + "line": 1, + "column": 4 + } + }, + "name": "t" + }, + "kind": "init", + "value": { + "type": "FunctionExpression", + "start": 4, + "end": 28, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 28 + } + }, + "id": null, + "generator": false, + "expression": false, + "params": [ + { + "type": "Identifier", + "start": 5, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "name": "eval" + } + ], + "body": { + "type": "BlockStatement", + "start": 11, + "end": 28, + "loc": { + "start": { + "line": 1, + "column": 11 + }, + "end": { + "line": 1, + "column": 28 + } + }, + "body": [ + { + "type": "ExpressionStatement", + "start": 13, + "end": 26, + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 1, + "column": 26 + } + }, + "expression": { + "type": "Literal", + "start": 13, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 1, + "column": 25 + } + }, + "value": "use strict", + "rawValue": "use strict", + "raw": "\"use strict\"" + } + } + ] + } + } + } + ], + "parenthesizedExpression": true + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/harmony/uncategorised/297/expected.json b/test/fixtures/harmony/uncategorised/297/expected.json new file mode 100644 index 0000000000..338190dde1 --- /dev/null +++ b/test/fixtures/harmony/uncategorised/297/expected.json @@ -0,0 +1,167 @@ +{ + "type": "File", + "start": 0, + "end": 30, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 30 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 30, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 30 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 30, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 30 + } + }, + "expression": { + "type": "ArrowFunctionExpression", + "start": 0, + "end": 30, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 30 + } + }, + "id": null, + "generator": false, + "expression": false, + "params": [ + { + "type": "Identifier", + "start": 1, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "name": "eval" + } + ], + "body": { + "type": "BlockStatement", + "start": 10, + "end": 30, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 30 + } + }, + "body": [ + { + "type": "ExpressionStatement", + "start": 12, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 12 + }, + "end": { + "line": 1, + "column": 25 + } + }, + "expression": { + "type": "Literal", + "start": 12, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 12 + }, + "end": { + "line": 1, + "column": 24 + } + }, + "value": "use strict", + "rawValue": "use strict", + "raw": "\"use strict\"" + } + }, + { + "type": "ExpressionStatement", + "start": 26, + "end": 28, + "loc": { + "start": { + "line": 1, + "column": 26 + }, + "end": { + "line": 1, + "column": 28 + } + }, + "expression": { + "type": "Literal", + "start": 26, + "end": 28, + "loc": { + "start": { + "line": 1, + "column": 26 + }, + "end": { + "line": 1, + "column": 28 + } + }, + "value": 42, + "rawValue": 42, + "raw": "42" + } + } + ] + } + } + } + ] + } +} \ No newline at end of file